OpenBIC
OpenSource Bridge-IC
plat_sensor_table.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_SENSOR_TABLE_H
18#define PLAT_SENSOR_TABLE_H
19
20#include <stdint.h>
21#include "sensor.h"
22
23#define SENSOR_NUM_POWER_ERROR 0x56
24#define SENSOR_NUM_SYSTEM_STATUS 0x10
25
26#define EXPA_RETIMER_EEPROM_ADDR (0xA0 >> 1)
27#define EXPA_RETIMER_ADDR (0x46 >> 1)
28#define TMP75_EXPA_TEMP_ADDR (0x94 >> 1)
29#define TMP75_EXPB_TEMP_ADDR (0x9A >> 1)
30#define INA233_EXPA_E1S_0_ADDR (0x98 >> 1)
31#define INA233_EXPA_E1S_1_ADDR (0x88 >> 1)
32#define INA233_EXPA_E1S_2_ADDR (0x8C >> 1)
33#define INA233_EXPA_MAIN_ADDR (0x9A >> 1)
34#define INA233_EXPB_E1S_0_ADDR (0x98 >> 1)
35#define INA233_EXPB_E1S_1_ADDR (0x92 >> 1)
36#define INA233_EXPB_E1S_2_ADDR (0x88 >> 1)
37#define INA233_EXPB_E1S_3_ADDR (0x82 >> 1)
38#define INA233_EXPB_E1S_4_ADDR (0x8A >> 1)
39#define INA233_EXPB_MAIN_ADDR (0x90 >> 1)
40#define NVME_ADDR (0xD4 >> 1)
41
42#define TMP75_TEMP_OFFSET 0x00
43#define NVME_TEMP_OFFSET 0x00
44#define INA233_VOLT_OFFSET 0x8B
45#define INA233_CURR_OFFSET 0x8C
46#define INA233_PWR_OFFSET 0x96
47
48#define SQ5220X_VOL_OFFSET 0x02
49#define SQ5220X_PWR_OFFSET 0x03
50#define SQ5220X_CUR_OFFSET 0x04
51
52/* The difference between sensor number in each position is 0x30.
53 * E.g. : SENSOR_NUM_1OU_TEMP is 0x40 and SENSOR_NUM_2OU_TEMP is 0x70.
54 */
55#define SENSOR_NUMBER_INTERVAL 0x30
56
58
59 //1OU
61
66
70
75
80
85
89
91
92 //2OU
94
101
107
111
118
125
131
132 //3OU
134
139
143
148
153
158
162
164
165 //4OU
167
182
189
196
202};
203
205void pal_extend_sensor_config(void);
206void load_sensor_config(void);
207uint8_t pal_get_extend_sensor_config(void);
210int check_pwr_monitor_type(void);
211
215};
216
217#endif
void load_sensor_config(void)
Definition: sensor.c:1413
void pal_extend_sensor_config(void)
Definition: sensor.c:1074
void change_power_monitor_config_for_sq5220x(void)
Definition: plat_sensor_table.c:444
void pal_change_sensor_config_number(void)
Definition: plat_sensor_table.c:488
SENSOR_NUM
Definition: plat_sensor_table.h:57
@ SENSOR_NUM_2OU_E1S_SSD3_P12V_CURR
Definition: plat_sensor_table.h:115
@ SENSOR_NUM_4OU_E1S_SSD4_P12V_PWR
Definition: plat_sensor_table.h:194
@ SENSOR_NUM_1OU_P1V8_ADC_VOLT
Definition: plat_sensor_table.h:72
@ SENSOR_NUM_2OU_E1S_SSD1_P12V_CURR
Definition: plat_sensor_table.h:113
@ SENSOR_NUM_4OU_E1S_SSD3_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:177
@ SENSOR_NUM_3OU_E1S_SSD2_P12V_PWR
Definition: plat_sensor_table.h:156
@ SENSOR_NUM_4OU_MAIN_P12V_CURR
Definition: plat_sensor_table.h:188
@ SENSOR_NUM_3OU_E1S_SSD2_P12V_CURR
Definition: plat_sensor_table.h:151
@ SENSOR_NUM_1OU_E1S_SSD2_TEMP_C
Definition: plat_sensor_table.h:88
@ SENSOR_NUM_3OU_E1S_SSD0_P12V_PWR
Definition: plat_sensor_table.h:154
@ SENSOR_NUM_1OU_E1S_SSD0_TEMP_C
Definition: plat_sensor_table.h:86
@ SENSOR_NUM_2OU_E1S_SSD1_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:103
@ SENSOR_NUM_1OU_TEMP
Definition: plat_sensor_table.h:60
@ SENSOR_NUM_3OU_P12V_EDGE_PWR
Definition: plat_sensor_table.h:157
@ SENSOR_NUM_4OU_E1S_SSD4_TEMP_C
Definition: plat_sensor_table.h:201
@ SENSOR_NUM_1OU_P0V9_ADC_VOLT
Definition: plat_sensor_table.h:73
@ SENSOR_NUM_3OU_P12V_EDGE_CURR
Definition: plat_sensor_table.h:152
@ SENSOR_NUM_2OU_P1V8_STBY_ADC_VOLT
Definition: plat_sensor_table.h:109
@ SENSOR_NUM_3OU_E1S_SSD0_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:140
@ SENSOR_NUM_4OU_E1S_SSD3_P12V_CURR
Definition: plat_sensor_table.h:186
@ SENSOR_NUM_3OU_P0V9_ADC_VOLT
Definition: plat_sensor_table.h:146
@ SENSOR_NUM_1OU_E1S_SSD0_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:67
@ SENSOR_NUM_2OU_E1S_SSD4_P12V_PWR
Definition: plat_sensor_table.h:123
@ SENSOR_NUM_4OU_E1S_SSD0_TEMP_C
Definition: plat_sensor_table.h:197
@ SENSOR_NUM_3OU_E1S_SSD1_P12V_CURR
Definition: plat_sensor_table.h:150
@ SENSOR_NUM_3OU_E1S_SSD0_P12V_VOLT
Definition: plat_sensor_table.h:135
@ SENSOR_NUM_2OU_P1V2_STBY_ADC_VOLT
Definition: plat_sensor_table.h:110
@ SENSOR_NUM_4OU_E1S_SSD2_P12V_PWR
Definition: plat_sensor_table.h:192
@ SENSOR_NUM_1OU_RE_TIMER_TEMP_C
Definition: plat_sensor_table.h:90
@ SENSOR_NUM_2OU_MAIN_P12V_VOLT
Definition: plat_sensor_table.h:100
@ SENSOR_NUM_2OU_E1S_SSD0_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:102
@ SENSOR_NUM_4OU_E1S_SSD3_TEMP_C
Definition: plat_sensor_table.h:200
@ SENSOR_NUM_4OU_E1S_SSD3_P12V_VOLT
Definition: plat_sensor_table.h:171
@ SENSOR_NUM_1OU_P12V_EDGE_VOLT
Definition: plat_sensor_table.h:65
@ SENSOR_NUM_1OU_E1S_SSD2_P12V_CURR
Definition: plat_sensor_table.h:78
@ SENSOR_NUM_4OU_E1S_SSD2_TEMP_C
Definition: plat_sensor_table.h:199
@ SENSOR_NUM_4OU_E1S_SSD2_P12V_VOLT
Definition: plat_sensor_table.h:170
@ SENSOR_NUM_2OU_P3V3_STBY_ADC_VOLT
Definition: plat_sensor_table.h:108
@ SENSOR_NUM_2OU_MAIN_P12V_CURR
Definition: plat_sensor_table.h:117
@ SENSOR_NUM_3OU_E1S_SSD1_P12V_PWR
Definition: plat_sensor_table.h:155
@ SENSOR_NUM_3OU_E1S_SSD1_P12V_VOLT
Definition: plat_sensor_table.h:136
@ SENSOR_NUM_1OU_E1S_SSD1_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:68
@ SENSOR_NUM_1OU_E1S_SSD0_P12V_CURR
Definition: plat_sensor_table.h:76
@ SENSOR_NUM_4OU_P1V8_STBY_ADC_VOLT
Definition: plat_sensor_table.h:180
@ SENSOR_NUM_4OU_P1V2_STBY_ADC_VOLT
Definition: plat_sensor_table.h:181
@ SENSOR_NUM_4OU_E1S_SSD4_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:178
@ SENSOR_NUM_1OU_P1V2_ADC_VOLT
Definition: plat_sensor_table.h:74
@ SENSOR_NUM_3OU_P1V8_ADC_VOLT
Definition: plat_sensor_table.h:145
@ SENSOR_NUM_4OU_TEMP
Definition: plat_sensor_table.h:166
@ SENSOR_NUM_2OU_E1S_SSD3_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:105
@ SENSOR_NUM_4OU_E1S_SSD1_TEMP_C
Definition: plat_sensor_table.h:198
@ SENSOR_NUM_4OU_E1S_SSD4_P12V_CURR
Definition: plat_sensor_table.h:187
@ SENSOR_NUM_4OU_E1S_SSD2_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:176
@ SENSOR_NUM_2OU_E1S_SSD2_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:104
@ SENSOR_NUM_4OU_MAIN_P12V_PWR
Definition: plat_sensor_table.h:195
@ SENSOR_NUM_4OU_E1S_SSD1_P12V_VOLT
Definition: plat_sensor_table.h:169
@ SENSOR_NUM_2OU_E1S_SSD1_P12V_PWR
Definition: plat_sensor_table.h:120
@ SENSOR_NUM_1OU_E1S_SSD1_P12V_PWR
Definition: plat_sensor_table.h:82
@ SENSOR_NUM_1OU_E1S_SSD0_P12V_PWR
Definition: plat_sensor_table.h:81
@ SENSOR_NUM_2OU_E1S_SSD4_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:106
@ SENSOR_NUM_2OU_E1S_SSD1_TEMP_C
Definition: plat_sensor_table.h:127
@ SENSOR_NUM_4OU_E1S_SSD1_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:175
@ SENSOR_NUM_1OU_P12V_EDGE_CURR
Definition: plat_sensor_table.h:79
@ SENSOR_NUM_2OU_E1S_SSD4_P12V_CURR
Definition: plat_sensor_table.h:116
@ SENSOR_NUM_2OU_E1S_SSD3_P12V_PWR
Definition: plat_sensor_table.h:122
@ SENSOR_NUM_2OU_E1S_SSD4_P12V_VOLT
Definition: plat_sensor_table.h:99
@ SENSOR_NUM_1OU_P12V_EDGE_PWR
Definition: plat_sensor_table.h:84
@ SENSOR_NUM_2OU_E1S_SSD1_P12V_VOLT
Definition: plat_sensor_table.h:96
@ SENSOR_NUM_2OU_E1S_SSD2_TEMP_C
Definition: plat_sensor_table.h:128
@ SENSOR_NUM_2OU_E1S_SSD3_TEMP_C
Definition: plat_sensor_table.h:129
@ SENSOR_NUM_4OU_E1S_SSD0_P12V_VOLT
Definition: plat_sensor_table.h:168
@ SENSOR_NUM_1OU_E1S_SSD2_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:69
@ SENSOR_NUM_3OU_E1S_SSD1_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:141
@ SENSOR_NUM_1OU_E1S_SSD0_P12V_VOLT
Definition: plat_sensor_table.h:62
@ SENSOR_NUM_2OU_E1S_SSD2_P12V_CURR
Definition: plat_sensor_table.h:114
@ SENSOR_NUM_3OU_E1S_SSD2_TEMP_C
Definition: plat_sensor_table.h:161
@ SENSOR_NUM_2OU_E1S_SSD0_P12V_VOLT
Definition: plat_sensor_table.h:95
@ SENSOR_NUM_2OU_TEMP
Definition: plat_sensor_table.h:93
@ SENSOR_NUM_3OU_E1S_SSD1_TEMP_C
Definition: plat_sensor_table.h:160
@ SENSOR_NUM_3OU_E1S_SSD2_P12V_VOLT
Definition: plat_sensor_table.h:137
@ SENSOR_NUM_1OU_E1S_SSD2_P12V_VOLT
Definition: plat_sensor_table.h:64
@ SENSOR_NUM_1OU_E1S_SSD1_TEMP_C
Definition: plat_sensor_table.h:87
@ SENSOR_NUM_2OU_E1S_SSD0_P12V_PWR
Definition: plat_sensor_table.h:119
@ SENSOR_NUM_1OU_P3V3_STBY_ADC_VOLT
Definition: plat_sensor_table.h:71
@ SENSOR_NUM_1OU_E1S_SSD1_P12V_CURR
Definition: plat_sensor_table.h:77
@ SENSOR_NUM_2OU_E1S_SSD0_TEMP_C
Definition: plat_sensor_table.h:126
@ SENSOR_NUM_3OU_RE_TIMER_TEMP_C
Definition: plat_sensor_table.h:163
@ SENSOR_NUM_1OU_E1S_SSD2_P12V_PWR
Definition: plat_sensor_table.h:83
@ SENSOR_NUM_2OU_E1S_SSD2_P12V_VOLT
Definition: plat_sensor_table.h:97
@ SENSOR_NUM_1OU_E1S_SSD1_P12V_VOLT
Definition: plat_sensor_table.h:63
@ SENSOR_NUM_3OU_E1S_SSD0_P12V_CURR
Definition: plat_sensor_table.h:149
@ SENSOR_NUM_4OU_P3V3_STBY_ADC_VOLT
Definition: plat_sensor_table.h:179
@ SENSOR_NUM_2OU_E1S_SSD4_TEMP_C
Definition: plat_sensor_table.h:130
@ SENSOR_NUM_4OU_E1S_SSD0_P12V_CURR
Definition: plat_sensor_table.h:183
@ SENSOR_NUM_3OU_P3V3_STBY_ADC_VOLT
Definition: plat_sensor_table.h:144
@ SENSOR_NUM_4OU_E1S_SSD0_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:174
@ SENSOR_NUM_4OU_E1S_SSD1_P12V_CURR
Definition: plat_sensor_table.h:184
@ SENSOR_NUM_4OU_E1S_SSD2_P12V_CURR
Definition: plat_sensor_table.h:185
@ SENSOR_NUM_4OU_E1S_SSD4_P12V_VOLT
Definition: plat_sensor_table.h:172
@ SENSOR_NUM_4OU_E1S_SSD1_P12V_PWR
Definition: plat_sensor_table.h:191
@ SENSOR_NUM_3OU_P12V_EDGE_VOLT
Definition: plat_sensor_table.h:138
@ SENSOR_NUM_4OU_E1S_SSD0_P12V_PWR
Definition: plat_sensor_table.h:190
@ SENSOR_NUM_3OU_P1V2_ADC_VOLT
Definition: plat_sensor_table.h:147
@ SENSOR_NUM_2OU_E1S_SSD2_P12V_PWR
Definition: plat_sensor_table.h:121
@ SENSOR_NUM_3OU_TEMP
Definition: plat_sensor_table.h:133
@ SENSOR_NUM_4OU_MAIN_P12V_VOLT
Definition: plat_sensor_table.h:173
@ SENSOR_NUM_4OU_E1S_SSD3_P12V_PWR
Definition: plat_sensor_table.h:193
@ SENSOR_NUM_2OU_E1S_SSD0_P12V_CURR
Definition: plat_sensor_table.h:112
@ SENSOR_NUM_3OU_E1S_SSD2_P3V3_ADC_VOLT
Definition: plat_sensor_table.h:142
@ SENSOR_NUM_2OU_E1S_SSD3_P12V_VOLT
Definition: plat_sensor_table.h:98
@ SENSOR_NUM_2OU_MAIN_P12V_PWR
Definition: plat_sensor_table.h:124
@ SENSOR_NUM_3OU_E1S_SSD0_TEMP_C
Definition: plat_sensor_table.h:159
uint8_t pal_get_extend_sensor_config(void)
Definition: sensor.c:1084
POWER_MONITOR_TYPE
Definition: plat_sensor_table.h:212
@ PWR_INA233
Definition: plat_sensor_table.h:213
@ PWR_SQ5220X
Definition: plat_sensor_table.h:214
void change_ina233_sensor_addr(void)
Definition: plat_sensor_table.c:409
int check_pwr_monitor_type(void)
Definition: plat_sensor_table.c:381