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
51#define FRU_PRODUCT_NAME_REG 0x70
52#define FRU_PRODUCT_PART_NUMBER_REG 0x71
53#define FRU_PRODUCT_PART_VERSION_REG 0x72
54#define FRU_PRODUCT_SERIAL_NUMBER_REG 0x73
55#define FRU_PRODUCT_ASSET_TAG_REG 0x74
56#define FRU_PRODUCT_CUSTOM_DATA_1_REG 0x75
57#define FRU_PRODUCT_CUSTOM_DATA_2_REG 0x76
58
59#define SET_SENSOR_POLLING_COMMAND_REG 0xF0
60
66
69void sensor_data_table_init(void);
70
72
73typedef struct _telemetry_info_ {
75 uint16_t data_size;
76 bool (*sensor_data_init)(telemetry_info *, uint8_t *);
77
79
80#endif
void update_sensor_data_8_table(void)
Definition: plat_i2c_target.c:577
void update_sensor_data_2_5_table(void)
Definition: plat_i2c_target.c:553
void sensor_data_table_init(void)
Definition: plat_i2c_target.c:847
i2c_bridge_command_error
Definition: plat_i2c_target.h:61
@ I2C_BRIDGE_COMMAND_SUCCESS
Definition: plat_i2c_target.h:62
@ I2C_BRIDGE_COMMAND_IN_PROCESS
Definition: plat_i2c_target.h:63
@ I2C_BRIDGE_COMMAND_FAILURE
Definition: plat_i2c_target.h:64
struct _telemetry_info_ telemetry_info
Definition: plat_i2c_target.h:71
Definition: plat_i2c_target.h:73
uint16_t data_size
Definition: plat_i2c_target.h:75
uint8_t telemetry_offset
Definition: plat_i2c_target.h:74
bool(* sensor_data_init)(telemetry_info *, uint8_t *)
Definition: plat_i2c_target.h:76