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 "stdbool.h"
22
23/* Define configuration for sensors */
24#define NIC_TEMP_OFFSET 0x01
25#define NIC_OPTICS_TEMP_OFFSET 0x01
26#define TMP75_TEMP_OFFSET 0x00
27#define NIC_ADDR (0x3E >> 1)
28#define NIC_0_POWER_MONITOR_ADDR (0x80 >> 1)
29#define NIC_1_POWER_MONITOR_ADDR (0x82 >> 1)
30#define NIC_2_POWER_MONITOR_ADDR (0x84 >> 1)
31#define NIC_3_POWER_MONITOR_ADDR (0x86 >> 1)
32#define NIC_4_POWER_MONITOR_ADDR (0x88 >> 1)
33#define NIC_5_POWER_MONITOR_ADDR (0x8A >> 1)
34#define NIC_6_POWER_MONITOR_ADDR (0x8C >> 1)
35#define NIC_7_POWER_MONITOR_ADDR (0x8E >> 1)
36
37#define HSC_MP5990_ADDR (0x40 >> 1)
38#define HSC_LTC4282_ADDR (0x82 >> 1)
39#define HSC_LTC4286_ADDR (0x82 >> 1)
40#define HSC_TEMP_NCT7718W_ADDR (0x98 >> 1)
41
42#define PEX_0_1_P0V8_VR_ADDR (0xC0 >> 1)
43#define PEX_2_3_P0V8_VR_ADDR (0xC4 >> 1)
44
45#define PEX_0_P1V25_POWER_MONITOR_ADDR (0x80 >> 1)
46#define PEX_1_P1V25_POWER_MONITOR_ADDR (0x82 >> 1)
47#define PEX_2_P1V25_POWER_MONITOR_ADDR (0x88 >> 1)
48#define PEX_3_P1V25_POWER_MONITOR_ADDR (0x8A >> 1)
49#define PEX_P1V8_POWER_MONITOR_ADDR (0x98 >> 1)
50#define DVT_PEX_P1V8_POWER_MONITOR_ADDR (0x9A >> 1)
51
52#define EVT_PEX_SWITCH_I2C_ADDR (0xD8 >> 1)
53
54#define DVT_PEX_SWITCH_0_I2C_ADDR (0xC0 >> 1)
55#define DVT_PEX_SWITCH_1_I2C_ADDR (0xC2 >> 1)
56#define DVT_PEX_SWITCH_2_I2C_ADDR (0xC4 >> 1)
57#define DVT_PEX_SWITCH_3_I2C_ADDR (0xC6 >> 1)
58
59#define SYSTEM_INLET_TEMP_ADDR (0x90 >> 1)
60#define SYSTEM_OUTLET_TEMP_L1_ADDR (0x90 >> 1)
61#define SYSTEM_OUTLET_TEMP_L2_ADDR (0x94 >> 1)
62#define SYSTEM_OUTLET_TEMP_R1_ADDR (0x98 >> 1)
63#define SYSTEM_OUTLET_TEMP_R2_ADDR (0x9C >> 1)
64
65#define SSD_COMMON_ADDR (0xD4 >> 1)
66#define SSD_OFFSET 0x00
67#define SSD_0_POWER_MONITOR_ADDR (0x80 >> 1)
68#define SSD_1_POWER_MONITOR_ADDR (0x82 >> 1)
69#define SSD_2_POWER_MONITOR_ADDR (0x84 >> 1)
70#define SSD_3_POWER_MONITOR_ADDR (0x86 >> 1)
71#define SSD_4_POWER_MONITOR_ADDR (0x88 >> 1)
72#define SSD_5_POWER_MONITOR_ADDR (0x8A >> 1)
73#define SSD_6_POWER_MONITOR_ADDR (0x8C >> 1)
74#define SSD_7_POWER_MONITOR_ADDR (0x8E >> 1)
75#define SSD_8_POWER_MONITOR_ADDR (0x90 >> 1)
76#define SSD_9_POWER_MONITOR_ADDR (0x92 >> 1)
77#define SSD_10_POWER_MONITOR_ADDR (0x94 >> 1)
78#define SSD_11_POWER_MONITOR_ADDR (0x96 >> 1)
79#define SSD_12_POWER_MONITOR_ADDR (0x98 >> 1)
80#define SSD_13_POWER_MONITOR_ADDR (0x9A >> 1)
81#define SSD_14_POWER_MONITOR_ADDR (0x9C >> 1)
82#define SSD_15_POWER_MONITOR_ADDR (0x9E >> 1)
83
84/* Define the device maximum number in this platform */
85#define PEX_MAX_NUMBER 4
86#define NIC_MAX_NUMBER 8
87#define SSD_MAX_NUMBER 16
88
89/* Define the sensor numbers used in this platform */
90#define SENSOR_NUM_TEMP_NIC_0 0x01
91#define SENSOR_NUM_VOLT_NIC_0 0x02
92#define SENSOR_NUM_IOUT_NIC_0 0x03
93#define SENSOR_NUM_POUT_NIC_0 0x04
94
95#define SENSOR_NUM_TEMP_NIC_1 0x05
96#define SENSOR_NUM_VOLT_NIC_1 0x06
97#define SENSOR_NUM_IOUT_NIC_1 0x07
98#define SENSOR_NUM_POUT_NIC_1 0x08
99
100#define SENSOR_NUM_TEMP_NIC_2 0x0A
101#define SENSOR_NUM_VOLT_NIC_2 0x0B
102#define SENSOR_NUM_IOUT_NIC_2 0x0C
103#define SENSOR_NUM_POUT_NIC_2 0x0D
104
105#define SENSOR_NUM_TEMP_NIC_3 0x11
106#define SENSOR_NUM_VOLT_NIC_3 0x12
107#define SENSOR_NUM_IOUT_NIC_3 0x13
108#define SENSOR_NUM_POUT_NIC_3 0x14
109
110#define SENSOR_NUM_TEMP_NIC_4 0x15
111#define SENSOR_NUM_VOLT_NIC_4 0x16
112#define SENSOR_NUM_IOUT_NIC_4 0x17
113#define SENSOR_NUM_POUT_NIC_4 0x18
114
115#define SENSOR_NUM_TEMP_NIC_5 0x1A
116#define SENSOR_NUM_VOLT_NIC_5 0x1B
117#define SENSOR_NUM_IOUT_NIC_5 0x1C
118#define SENSOR_NUM_POUT_NIC_5 0x1D
119
120#define SENSOR_NUM_TEMP_NIC_6 0x21
121#define SENSOR_NUM_VOLT_NIC_6 0x22
122#define SENSOR_NUM_IOUT_NIC_6 0x23
123#define SENSOR_NUM_POUT_NIC_6 0x24
124
125#define SENSOR_NUM_TEMP_NIC_7 0x25
126#define SENSOR_NUM_VOLT_NIC_7 0x26
127#define SENSOR_NUM_IOUT_NIC_7 0x27
128#define SENSOR_NUM_POUT_NIC_7 0x28
129
130#define SENSOR_NUM_TEMP_PDB_HSC 0x2A
131#define SENSOR_NUM_VOUT_PDB_HSC 0x2B
132#define SENSOR_NUM_IOUT_PDB_HSC 0x2C
133#define SENSOR_NUM_POUT_PDB_HSC 0x2D
134
135#define SENSOR_NUM_BB_P12V_AUX 0x30
136#define SENSOR_NUM_BB_P5V_AUX 0x31
137#define SENSOR_NUM_BB_P3V3_AUX 0x32
138#define SENSOR_NUM_BB_P1V2_AUX 0x33
139#define SENSOR_NUM_BB_P3V3 0x34
140#define SENSOR_NUM_BB_P1V8_PEX0 0x35
141#define SENSOR_NUM_BB_P1V8_PEX1 0x36
142#define SENSOR_NUM_BB_P1V8_PEX2 0x37
143#define SENSOR_NUM_BB_P1V8_PEX3 0x38
144
145#define SENSOR_NUM_PEX_0_VR_TEMP 0x40
146#define SENSOR_NUM_P0V8_VOLT_PEX_0 0x41
147#define SENSOR_NUM_P0V8_IOUT_PEX_0 0x42
148#define SENSOR_NUM_P0V8_POUT_PEX_0 0x43
149#define SENSOR_NUM_P1V25_VOLT_PEX_0 0x44
150#define SENSOR_NUM_P1V25_IOUT_PEX_0 0x45
151#define SENSOR_NUM_P1V25_POUT_PEX_0 0x46
152
153#define SENSOR_NUM_PEX_1_VR_TEMP 0x47
154#define SENSOR_NUM_P0V8_VOLT_PEX_1 0x48
155#define SENSOR_NUM_P0V8_IOUT_PEX_1 0x49
156#define SENSOR_NUM_P0V8_POUT_PEX_1 0x4A
157#define SENSOR_NUM_P1V25_VOLT_PEX_1 0x4B
158#define SENSOR_NUM_P1V25_IOUT_PEX_1 0x4C
159#define SENSOR_NUM_P1V25_POUT_PEX_1 0x4D
160
161#define SENSOR_NUM_PEX_2_VR_TEMP 0x50
162#define SENSOR_NUM_P0V8_VOLT_PEX_2 0x51
163#define SENSOR_NUM_P0V8_IOUT_PEX_2 0x52
164#define SENSOR_NUM_P0V8_POUT_PEX_2 0x53
165#define SENSOR_NUM_P1V25_VOLT_PEX_2 0x54
166#define SENSOR_NUM_P1V25_IOUT_PEX_2 0x55
167#define SENSOR_NUM_P1V25_POUT_PEX_2 0x56
168
169#define SENSOR_NUM_PEX_3_VR_TEMP 0x57
170#define SENSOR_NUM_P0V8_VOLT_PEX_3 0x58
171#define SENSOR_NUM_P0V8_IOUT_PEX_3 0x59
172#define SENSOR_NUM_P0V8_POUT_PEX_3 0x5A
173#define SENSOR_NUM_P1V25_VOLT_PEX_3 0x5B
174#define SENSOR_NUM_P1V25_IOUT_PEX_3 0x5C
175#define SENSOR_NUM_P1V25_POUT_PEX_3 0x5D
176
177#define SENSOR_NUM_P1V8_VOLT_PEX 0x60
178#define SENSOR_NUM_P1V8_IOUT_PEX 0x61
179#define SENSOR_NUM_P1V8_POUT_PEX 0x62
180
181#define SENSOR_NUM_TEMP_PEX_0 0x6A
182#define SENSOR_NUM_TEMP_PEX_1 0x6B
183#define SENSOR_NUM_TEMP_PEX_2 0x6C
184#define SENSOR_NUM_TEMP_PEX_3 0x6D
185
186#define SENSOR_NUM_SYSTEM_INLET_TEMP 0x70
187#define SENSOR_NUM_OUTLET_TEMP_L1 0x71
188#define SENSOR_NUM_OUTLET_TEMP_L2 0x72
189#define SENSOR_NUM_OUTLET_TEMP_R1 0x73
190#define SENSOR_NUM_OUTLET_TEMP_R2 0x74
191
192#define SENSOR_NUM_TEMP_E1S_0 0x80
193#define SENSOR_NUM_VOLT_E1S_0 0x81
194#define SENSOR_NUM_CURR_E1S_0 0x82
195#define SENSOR_NUM_POUT_E1S_0 0x83
196
197#define SENSOR_NUM_TEMP_E1S_1 0x84
198#define SENSOR_NUM_VOLT_E1S_1 0x85
199#define SENSOR_NUM_CURR_E1S_1 0x86
200#define SENSOR_NUM_POUT_E1S_1 0x87
201
202#define SENSOR_NUM_TEMP_E1S_2 0x88
203#define SENSOR_NUM_VOLT_E1S_2 0x89
204#define SENSOR_NUM_CURR_E1S_2 0x8A
205#define SENSOR_NUM_POUT_E1S_2 0x8B
206
207#define SENSOR_NUM_TEMP_E1S_3 0x8C
208#define SENSOR_NUM_VOLT_E1S_3 0x8D
209#define SENSOR_NUM_CURR_E1S_3 0x8E
210#define SENSOR_NUM_POUT_E1S_3 0x8F
211
212#define SENSOR_NUM_TEMP_E1S_4 0x90
213#define SENSOR_NUM_VOLT_E1S_4 0x91
214#define SENSOR_NUM_CURR_E1S_4 0x92
215#define SENSOR_NUM_POUT_E1S_4 0x93
216
217#define SENSOR_NUM_TEMP_E1S_5 0x94
218#define SENSOR_NUM_VOLT_E1S_5 0x95
219#define SENSOR_NUM_CURR_E1S_5 0x96
220#define SENSOR_NUM_POUT_E1S_5 0x97
221
222#define SENSOR_NUM_TEMP_E1S_6 0x98
223#define SENSOR_NUM_VOLT_E1S_6 0x99
224#define SENSOR_NUM_CURR_E1S_6 0x9A
225#define SENSOR_NUM_POUT_E1S_6 0x9B
226
227#define SENSOR_NUM_TEMP_E1S_7 0x9C
228#define SENSOR_NUM_VOLT_E1S_7 0x9D
229#define SENSOR_NUM_CURR_E1S_7 0x9E
230#define SENSOR_NUM_POUT_E1S_7 0x9F
231
232#define SENSOR_NUM_TEMP_E1S_8 0xA0
233#define SENSOR_NUM_VOLT_E1S_8 0xA1
234#define SENSOR_NUM_CURR_E1S_8 0xA2
235#define SENSOR_NUM_POUT_E1S_8 0xA3
236
237#define SENSOR_NUM_TEMP_E1S_9 0xA4
238#define SENSOR_NUM_VOLT_E1S_9 0xA5
239#define SENSOR_NUM_CURR_E1S_9 0xA6
240#define SENSOR_NUM_POUT_E1S_9 0xA7
241
242#define SENSOR_NUM_TEMP_E1S_10 0xA8
243#define SENSOR_NUM_VOLT_E1S_10 0xA9
244#define SENSOR_NUM_CURR_E1S_10 0xAA
245#define SENSOR_NUM_POUT_E1S_10 0xAB
246
247#define SENSOR_NUM_TEMP_E1S_11 0xAC
248#define SENSOR_NUM_VOLT_E1S_11 0xAD
249#define SENSOR_NUM_CURR_E1S_11 0xAE
250#define SENSOR_NUM_POUT_E1S_11 0xAF
251
252#define SENSOR_NUM_TEMP_E1S_12 0xB0
253#define SENSOR_NUM_VOLT_E1S_12 0xB1
254#define SENSOR_NUM_CURR_E1S_12 0xB2
255#define SENSOR_NUM_POUT_E1S_12 0xB3
256
257#define SENSOR_NUM_TEMP_E1S_13 0xB4
258#define SENSOR_NUM_VOLT_E1S_13 0xB5
259#define SENSOR_NUM_CURR_E1S_13 0xB6
260#define SENSOR_NUM_POUT_E1S_13 0xB7
261
262#define SENSOR_NUM_TEMP_E1S_14 0xB8
263#define SENSOR_NUM_VOLT_E1S_14 0xB9
264#define SENSOR_NUM_CURR_E1S_14 0xBA
265#define SENSOR_NUM_POUT_E1S_14 0xBB
266
267#define SENSOR_NUM_TEMP_E1S_15 0xBC
268#define SENSOR_NUM_VOLT_E1S_15 0xBD
269#define SENSOR_NUM_CURR_E1S_15 0xBE
270#define SENSOR_NUM_POUT_E1S_15 0xBF
271
272#define SENSOR_NUM_TEMP_NIC_OPTICS_0 0xC0
273#define SENSOR_NUM_TEMP_NIC_OPTICS_1 0xC1
274#define SENSOR_NUM_TEMP_NIC_OPTICS_2 0xC2
275#define SENSOR_NUM_TEMP_NIC_OPTICS_3 0xC3
276#define SENSOR_NUM_TEMP_NIC_OPTICS_4 0xC4
277#define SENSOR_NUM_TEMP_NIC_OPTICS_5 0xC5
278#define SENSOR_NUM_TEMP_NIC_OPTICS_6 0xC6
279#define SENSOR_NUM_TEMP_NIC_OPTICS_7 0xC7
280
281/* The sensors of different source components by ADC */
282#define SENSOR_NUM_HSC_TYPE 0xF0
283#define SENSOR_NUM_VR_TYPE 0xF1
284#define SENSOR_NUM_ADC_TYPE 0xF2
285
286uint8_t plat_get_config_size();
287void load_sensor_config(void);
288bool is_e1s_access(uint8_t sensor_num);
289bool is_nic_access(uint8_t sensor_num);
290bool is_nic_optics_access(uint8_t sensor_num);
291bool is_dc_access(uint8_t sensor_num);
292
293#endif
void load_sensor_config(void)
Definition: sensor.c:1405
uint8_t plat_get_config_size()
Definition: sensor.c:1400
bool is_dc_access(uint8_t sensor_num)
Definition: plat_sensor_table.c:1564
bool is_e1s_access(uint8_t sensor_num)
Definition: plat_sensor_table.c:1921
bool is_nic_access(uint8_t sensor_num)
Definition: plat_sensor_table.c:1642
bool is_nic_optics_access(uint8_t sensor_num)
Definition: plat_sensor_table.c:1649
uint8_t sensor_num
Definition: storage_handler.h:6