OpenBIC
OpenSource Bridge-IC
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
plat_i2c_target.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef PLAT_I2C_SLAVE_H
18#define PLAT_I2C_SLAVE_H
19
20#include <drivers/i2c.h>
21#include "hal_i2c_target.h"
22
23#define TARGET_ENABLE 1
24#define TARGET_DISABLE 0
25
26#define TELEMETRY_BUFF_SIZE 255
27
28#define SENSOR_INIT_DATA_0_REG 0x00
29#define SENSOR_INIT_DATA_1_REG 0x01
30#define SENSOR_READING_0_REG 0x02
31#define SENSOR_READING_1_REG 0x03
32#define SENSOR_READING_2_REG 0x04
33#define SENSOR_READING_3_REG 0x05
34#define INVENTORY_IDS_REG 0x06
35#define OWL_NIC_MAC_ADDRESSES_REG 0x07 //not used
36#define STRAP_CAPABILTITY_REG 0x08
37#define WRITE_STRAP_PIN_VALUE_REG 0x09
38
39#define I2C_BRIDGE_COMMAND_REG 0x40
40#define I2C_BRIDGE_COMMAND_STATUS_REG 0x41
41#define I2C_BRIDGE_COMMAND_RESPONSE_REG 0x42
42
43#define FRU_BOARD_PART_NUMBER_REG 0x60
44#define FRU_BOARD_SERIAL_NUMBER_REG 0x61
45#define FRU_BOARD_PRODUCT_NAME_REG 0x62
46#define FRU_BOARD_CUSTOM_DATA_1_REG 0x63
47#define FRU_BOARD_CUSTOM_DATA_2_REG 0x64
48#define FRU_BOARD_CUSTOM_DATA_3_REG 0x65
49#define FRU_BOARD_CUSTOM_DATA_4_REG 0x66
50#define FRU_BOARD_CUSTOM_DATA_5_REG 0x67
51#define FRU_BOARD_CUSTOM_DATA_6_REG 0x68
52#define FRU_BOARD_CUSTOM_DATA_7_REG 0x69
53#define FRU_BOARD_CUSTOM_DATA_8_REG 0x6A
54#define FRU_BOARD_CUSTOM_DATA_9_REG 0x6B
55#define FRU_BOARD_CUSTOM_DATA_10_REG 0x6C
56
57#define FRU_PRODUCT_NAME_REG 0x70
58#define FRU_PRODUCT_PART_NUMBER_REG 0x71
59#define FRU_PRODUCT_PART_VERSION_REG 0x72
60#define FRU_PRODUCT_SERIAL_NUMBER_REG 0x73
61#define FRU_PRODUCT_ASSET_TAG_REG 0x74
62#define FRU_PRODUCT_CUSTOM_DATA_1_REG 0x75
63#define FRU_PRODUCT_CUSTOM_DATA_2_REG 0x76
64
65#define SET_SENSOR_POLLING_COMMAND_REG 0xF0
66
72
76
78
79typedef struct _telemetry_info_ {
81 uint16_t data_size;
82 bool (*telemetry_table_init)(telemetry_info *, uint8_t *);
83
85
86#endif
void plat_telemetry_table_init(void)
Definition: plat_i2c_target.c:881
void update_sensor_reading_table(void)
Definition: plat_i2c_target.c:573
void update_strap_capability_table(void)
Definition: plat_i2c_target.c:597
i2c_bridge_command_error
Definition: plat_i2c_target.h:67
@ I2C_BRIDGE_COMMAND_SUCCESS
Definition: plat_i2c_target.h:68
@ I2C_BRIDGE_COMMAND_IN_PROCESS
Definition: plat_i2c_target.h:69
@ I2C_BRIDGE_COMMAND_FAILURE
Definition: plat_i2c_target.h:70
struct _telemetry_info_ telemetry_info
Definition: plat_i2c_target.h:77
Definition: plat_i2c_target.h:79
uint16_t data_size
Definition: plat_i2c_target.h:81
uint8_t telemetry_offset
Definition: plat_i2c_target.h:80
bool(* telemetry_table_init)(telemetry_info *, uint8_t *)
Definition: plat_i2c_target.h:82