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#include "common_i2c_mux.h"
23
24#define PEX_MAX_NUMBER 2
25
26/* define config for sensors */
27#define TMP75_IN_ADDR 0x48
28#define TMP75_OUT_ADDR 0x4A
29#define TMP75_TEMP_OFFSET 0x00
30#define LM75BD118_TEMP_OFFSET 0x00
31#define XDPE15284D_ADDR 0x64
32#define ADM1272_1_ADDR 0x10
33#define ADM1272_2_ADDR 0x13
34#define LTC4286_1_ADDR 0x40
35#define LTC4286_2_ADDR 0x41
36#define POWER_BRICK_1_ADDR 0x60
37#define POWER_BRICK_2_ADDR 0x61
38#define INA233_12V_1_7_ADDR 0x45
39#define INA233_12V_2_8_ADDR 0x44
40#define INA233_12V_3_9_ADDR 0x43
41#define INA233_12V_4_10_ADDR 0x42
42#define INA233_12V_5_11_ADDR 0x41
43#define INA233_12V_6_ADDR 0x46
44#define INA233_12V_12_ADDR 0x40
45#define PEX89144_I2C0_ADDR 0x61
46#define PEX89144_I2CS_ADDR 0x59
47#define PEX89144_0_MUX_ADDR 0x70
48#define PEX89144_1_MUX_ADDR 0x71
49#define SQ52205_P1V25_1_ADDR 0x40
50#define SQ52205_P1V25_2_ADDR 0x41
51#define FIO_THERMAL_ADDR 0x48
52#define P1V8_PEX_ADC_CHANNEL 4
53#define P1V8_PEX_LOW_THRESHOLD 1.674
54
55/* Temperature sensor number, 1 based */
56#define SENSOR_NUM_TEMP_OUTLET_1 0x01
57#define SENSOR_NUM_TEMP_OUTLET_2 0x02
58#define SENSOR_NUM_TEMP_HSC_1 0x03
59#define SENSOR_NUM_TEMP_HSC_2 0x04
60#define SENSOR_NUM_TEMP_PEX_0 0x05
61#define SENSOR_NUM_TEMP_PEX_1 0x06
62#define SENSOR_NUM_TEMP_XDPE15284 0x07
63#define SENSOR_NUM_TEMP_POWER_BRICK_1 0x09
64#define SENSOR_NUM_TEMP_POWER_BRICK_2 0x0A
65#define SENSOR_NUM_TEMP_P0V8_VDD_1 0x5F
66#define SENSOR_NUM_TEMP_P0V8_VDD_2 0x60
67#define SENSOR_NUM_TEMP_FIO_INLET 0x67
68
69/* Voltage sensor number */
70#define SENSOR_NUM_VOL_P51V_AUX_L 0x0B
71#define SENSOR_NUM_VOL_P51V_AUX_R 0x0C
72#define SENSOR_NUM_VOL_P51V_STBY_L 0x53
73#define SENSOR_NUM_VOL_P51V_STBY_R 0x54
74#define SENSOR_NUM_VOL_P12V_AUX_1 0x0D
75#define SENSOR_NUM_VOL_P12V_AUX_2 0x0E
76#define SENSOR_NUM_VOL_P5V_AUX 0x10
77#define SENSOR_NUM_VOL_P3V3_AUX 0x11
78#define SENSOR_NUM_VOL_P1V2_AUX 0x12
79#define SENSOR_NUM_VOL_P1V8_PEX 0x13
80#define SENSOR_NUM_VOL_P1V8_VDD_1 0x1E
81#define SENSOR_NUM_VOL_P1V8_VDD_2 0x1F
82#define SENSOR_NUM_VOL_P1V25_VDD_1 0x20
83#define SENSOR_NUM_VOL_P1V25_VDD_2 0x21
84#define SENSOR_NUM_VOL_P0V8_VDD_1 0x57
85#define SENSOR_NUM_VOL_P0V8_VDD_2 0x58
86#define SENSOR_NUM_VOL_P12V_1_M_AUX 0x61
87#define SENSOR_NUM_VOL_P12V_2_M_AUX 0x62
88
89#define SENSOR_NUM_VOL_P12V_ACCL_1 0x23
90#define SENSOR_NUM_VOL_P12V_ACCL_2 0x24
91#define SENSOR_NUM_VOL_P12V_ACCL_3 0x25
92#define SENSOR_NUM_VOL_P12V_ACCL_4 0x26
93#define SENSOR_NUM_VOL_P12V_ACCL_5 0x27
94#define SENSOR_NUM_VOL_P12V_ACCL_6 0x28
95#define SENSOR_NUM_VOL_P12V_ACCL_7 0x29
96#define SENSOR_NUM_VOL_P12V_ACCL_8 0x2A
97#define SENSOR_NUM_VOL_P12V_ACCL_9 0x2C
98#define SENSOR_NUM_VOL_P12V_ACCL_10 0x2D
99#define SENSOR_NUM_VOL_P12V_ACCL_11 0x2E
100#define SENSOR_NUM_VOL_P12V_ACCL_12 0x2F
101
102/* Current sensor number */
103#define SENSOR_NUM_CUR_P51V_AUX_L 0x30
104#define SENSOR_NUM_CUR_P51V_AUX_R 0x31
105#define SENSOR_NUM_CUR_P51V_STBY_L 0x5D
106#define SENSOR_NUM_CUR_P51V_STBY_R 0x5E
107#define SENSOR_NUM_CUR_P12V_AUX_1 0x32
108#define SENSOR_NUM_CUR_P12V_AUX_2 0x33
109#define SENSOR_NUM_CUR_P0V8_VDD_1 0x59
110#define SENSOR_NUM_CUR_P0V8_VDD_2 0x5A
111#define SENSOR_NUM_CUR_P12V_1_M_AUX 0x63
112#define SENSOR_NUM_CUR_P12V_2_M_AUX 0x64
113
114#define SENSOR_NUM_CUR_P12V_ACCL_1 0x34
115#define SENSOR_NUM_CUR_P12V_ACCL_2 0x35
116#define SENSOR_NUM_CUR_P12V_ACCL_3 0x36
117#define SENSOR_NUM_CUR_P12V_ACCL_4 0x37
118#define SENSOR_NUM_CUR_P12V_ACCL_5 0x38
119#define SENSOR_NUM_CUR_P12V_ACCL_6 0x39
120#define SENSOR_NUM_CUR_P12V_ACCL_7 0x3A
121#define SENSOR_NUM_CUR_P12V_ACCL_8 0x3C
122#define SENSOR_NUM_CUR_P12V_ACCL_9 0x3D
123#define SENSOR_NUM_CUR_P12V_ACCL_10 0x3E
124#define SENSOR_NUM_CUR_P12V_ACCL_11 0x3F
125#define SENSOR_NUM_CUR_P12V_ACCL_12 0x40
126
127/* Power sensor number */
128#define SENSOR_NUM_PWR_P51V_AUX_L 0x41
129#define SENSOR_NUM_PWR_P51V_AUX_R 0x42
130#define SENSOR_NUM_PWR_P51V_STBY_L 0x55
131#define SENSOR_NUM_PWR_P51V_STBY_R 0x56
132#define SENSOR_NUM_PWR_P12V_AUX_1 0x43
133#define SENSOR_NUM_PWR_P12V_AUX_2 0x44
134#define SENSOR_NUM_PWR_P0V8_VDD_1 0x5B
135#define SENSOR_NUM_PWR_P0V8_VDD_2 0x5C
136#define SENSOR_NUM_PWR_P12V_1_M_AUX 0x65
137#define SENSOR_NUM_PWR_P12V_2_M_AUX 0x66
138
139#define SENSOR_NUM_PWR_P12V_ACCL_1 0x45
140#define SENSOR_NUM_PWR_P12V_ACCL_2 0x46
141#define SENSOR_NUM_PWR_P12V_ACCL_3 0x47
142#define SENSOR_NUM_PWR_P12V_ACCL_4 0x48
143#define SENSOR_NUM_PWR_P12V_ACCL_5 0x49
144#define SENSOR_NUM_PWR_P12V_ACCL_6 0x4A
145#define SENSOR_NUM_PWR_P12V_ACCL_7 0x4B
146#define SENSOR_NUM_PWR_P12V_ACCL_8 0x4C
147#define SENSOR_NUM_PWR_P12V_ACCL_9 0x4D
148#define SENSOR_NUM_PWR_P12V_ACCL_10 0x50
149#define SENSOR_NUM_PWR_P12V_ACCL_11 0x51
150#define SENSOR_NUM_PWR_P12V_ACCL_12 0x52
151
153#define SENSOR_NUM_TEMP_ACCL_1_FREYA_1 0x70
154#define SENSOR_NUM_VOL_ACCL_1_FREYA_1_1 0x71
155#define SENSOR_NUM_VOL_ACCL_1_FREYA_1_2 0x72
156#define SENSOR_NUM_TEMP_ACCL_1_FREYA_2 0x73
157#define SENSOR_NUM_VOL_ACCL_1_FREYA_2_1 0x74
158#define SENSOR_NUM_VOL_ACCL_1_FREYA_2_2 0x75
159#define SENSOR_NUM_VOL_ACCL_1_ASIC_1_P12V_AUX 0xB8
160#define SENSOR_NUM_VOL_ACCL_1_ASIC_2_P12V_AUX 0xB9
161
163#define SENSOR_NUM_TEMP_ACCL_2_FREYA_1 0x76
164#define SENSOR_NUM_VOL_ACCL_2_FREYA_1_1 0x77
165#define SENSOR_NUM_VOL_ACCL_2_FREYA_1_2 0x78
166#define SENSOR_NUM_TEMP_ACCL_2_FREYA_2 0x79
167#define SENSOR_NUM_VOL_ACCL_2_FREYA_2_1 0x7A
168#define SENSOR_NUM_VOL_ACCL_2_FREYA_2_2 0x7B
169#define SENSOR_NUM_VOL_ACCL_2_ASIC_1_P12V_AUX 0xBA
170#define SENSOR_NUM_VOL_ACCL_2_ASIC_2_P12V_AUX 0xBB
171
173#define SENSOR_NUM_TEMP_ACCL_3_FREYA_1 0x7C
174#define SENSOR_NUM_VOL_ACCL_3_FREYA_1_1 0x7D
175#define SENSOR_NUM_VOL_ACCL_3_FREYA_1_2 0x7E
176#define SENSOR_NUM_TEMP_ACCL_3_FREYA_2 0x7F
177#define SENSOR_NUM_VOL_ACCL_3_FREYA_2_1 0x80
178#define SENSOR_NUM_VOL_ACCL_3_FREYA_2_2 0x81
179#define SENSOR_NUM_VOL_ACCL_3_ASIC_1_P12V_AUX 0xBC
180#define SENSOR_NUM_VOL_ACCL_3_ASIC_2_P12V_AUX 0xBD
181
183#define SENSOR_NUM_TEMP_ACCL_4_FREYA_1 0x82
184#define SENSOR_NUM_VOL_ACCL_4_FREYA_1_1 0x83
185#define SENSOR_NUM_VOL_ACCL_4_FREYA_1_2 0x84
186#define SENSOR_NUM_TEMP_ACCL_4_FREYA_2 0x85
187#define SENSOR_NUM_VOL_ACCL_4_FREYA_2_1 0x86
188#define SENSOR_NUM_VOL_ACCL_4_FREYA_2_2 0x87
189#define SENSOR_NUM_VOL_ACCL_4_ASIC_1_P12V_AUX 0xBE
190#define SENSOR_NUM_VOL_ACCL_4_ASIC_2_P12V_AUX 0xBF
191
193#define SENSOR_NUM_TEMP_ACCL_5_FREYA_1 0x88
194#define SENSOR_NUM_VOL_ACCL_5_FREYA_1_1 0x89
195#define SENSOR_NUM_VOL_ACCL_5_FREYA_1_2 0x8A
196#define SENSOR_NUM_TEMP_ACCL_5_FREYA_2 0x8B
197#define SENSOR_NUM_VOL_ACCL_5_FREYA_2_1 0x8C
198#define SENSOR_NUM_VOL_ACCL_5_FREYA_2_2 0x8D
199#define SENSOR_NUM_VOL_ACCL_5_ASIC_1_P12V_AUX 0xC0
200#define SENSOR_NUM_VOL_ACCL_5_ASIC_2_P12V_AUX 0xC1
201
203#define SENSOR_NUM_TEMP_ACCL_6_FREYA_1 0x8E
204#define SENSOR_NUM_VOL_ACCL_6_FREYA_1_1 0x8F
205#define SENSOR_NUM_VOL_ACCL_6_FREYA_1_2 0x90
206#define SENSOR_NUM_TEMP_ACCL_6_FREYA_2 0x91
207#define SENSOR_NUM_VOL_ACCL_6_FREYA_2_1 0x92
208#define SENSOR_NUM_VOL_ACCL_6_FREYA_2_2 0x93
209#define SENSOR_NUM_VOL_ACCL_6_ASIC_1_P12V_AUX 0xC2
210#define SENSOR_NUM_VOL_ACCL_6_ASIC_2_P12V_AUX 0xC3
211
213#define SENSOR_NUM_TEMP_ACCL_7_FREYA_1 0x94
214#define SENSOR_NUM_VOL_ACCL_7_FREYA_1_1 0x95
215#define SENSOR_NUM_VOL_ACCL_7_FREYA_1_2 0x96
216#define SENSOR_NUM_TEMP_ACCL_7_FREYA_2 0x97
217#define SENSOR_NUM_VOL_ACCL_7_FREYA_2_1 0x98
218#define SENSOR_NUM_VOL_ACCL_7_FREYA_2_2 0x99
219#define SENSOR_NUM_VOL_ACCL_7_ASIC_1_P12V_AUX 0xC4
220#define SENSOR_NUM_VOL_ACCL_7_ASIC_2_P12V_AUX 0xC5
221
223#define SENSOR_NUM_TEMP_ACCL_8_FREYA_1 0x9A
224#define SENSOR_NUM_VOL_ACCL_8_FREYA_1_1 0x9B
225#define SENSOR_NUM_VOL_ACCL_8_FREYA_1_2 0x9C
226#define SENSOR_NUM_TEMP_ACCL_8_FREYA_2 0x9D
227#define SENSOR_NUM_VOL_ACCL_8_FREYA_2_1 0x9E
228#define SENSOR_NUM_VOL_ACCL_8_FREYA_2_2 0x9F
229#define SENSOR_NUM_VOL_ACCL_8_ASIC_1_P12V_AUX 0xC6
230#define SENSOR_NUM_VOL_ACCL_8_ASIC_2_P12V_AUX 0xC7
231
233#define SENSOR_NUM_TEMP_ACCL_9_FREYA_1 0xA0
234#define SENSOR_NUM_VOL_ACCL_9_FREYA_1_1 0xA1
235#define SENSOR_NUM_VOL_ACCL_9_FREYA_1_2 0xA2
236#define SENSOR_NUM_TEMP_ACCL_9_FREYA_2 0xA3
237#define SENSOR_NUM_VOL_ACCL_9_FREYA_2_1 0xA4
238#define SENSOR_NUM_VOL_ACCL_9_FREYA_2_2 0xA5
239#define SENSOR_NUM_VOL_ACCL_9_ASIC_1_P12V_AUX 0xC8
240#define SENSOR_NUM_VOL_ACCL_9_ASIC_2_P12V_AUX 0xC9
241
243#define SENSOR_NUM_TEMP_ACCL_10_FREYA_1 0xA6
244#define SENSOR_NUM_VOL_ACCL_10_FREYA_1_1 0xA7
245#define SENSOR_NUM_VOL_ACCL_10_FREYA_1_2 0xA8
246#define SENSOR_NUM_TEMP_ACCL_10_FREYA_2 0xA9
247#define SENSOR_NUM_VOL_ACCL_10_FREYA_2_1 0xAA
248#define SENSOR_NUM_VOL_ACCL_10_FREYA_2_2 0xAB
249#define SENSOR_NUM_VOL_ACCL_10_ASIC_1_P12V_AUX 0xCA
250#define SENSOR_NUM_VOL_ACCL_10_ASIC_2_P12V_AUX 0xCB
251
253#define SENSOR_NUM_TEMP_ACCL_11_FREYA_1 0xAC
254#define SENSOR_NUM_VOL_ACCL_11_FREYA_1_1 0xAD
255#define SENSOR_NUM_VOL_ACCL_11_FREYA_1_2 0xAE
256#define SENSOR_NUM_TEMP_ACCL_11_FREYA_2 0xAF
257#define SENSOR_NUM_VOL_ACCL_11_FREYA_2_1 0xB0
258#define SENSOR_NUM_VOL_ACCL_11_FREYA_2_2 0xB1
259#define SENSOR_NUM_VOL_ACCL_11_ASIC_1_P12V_AUX 0xCC
260#define SENSOR_NUM_VOL_ACCL_11_ASIC_2_P12V_AUX 0xCD
261
263#define SENSOR_NUM_TEMP_ACCL_12_FREYA_1 0xB2
264#define SENSOR_NUM_VOL_ACCL_12_FREYA_1_1 0xB3
265#define SENSOR_NUM_VOL_ACCL_12_FREYA_1_2 0xB4
266#define SENSOR_NUM_TEMP_ACCL_12_FREYA_2 0xB5
267#define SENSOR_NUM_VOL_ACCL_12_FREYA_2_1 0xB6
268#define SENSOR_NUM_VOL_ACCL_12_FREYA_2_2 0xB7
269#define SENSOR_NUM_VOL_ACCL_12_ASIC_1_P12V_AUX 0xCE
270#define SENSOR_NUM_VOL_ACCL_12_ASIC_2_P12V_AUX 0xCF
271
273#define ACCL_FREYA_1_ADDR (0xD6 >> 1)
274#define ACCL_FREYA_2_ADDR (0xD0 >> 1)
275#define ACCL_ARTEMIS_MODULE_1_ADDR (0xD4 >> 1)
276#define ACCL_ARTEMIS_MODULE_2_ADDR (0xD8 >> 1)
277
278#define ACCL_FREYA_SENSOR_COUNT 6
279#define ACCL_ARTEMIS_MODULE_SENSOR_COUNT 8
280#define ACCL_POWER_GOOD_TIME_DEFAULT 0
281#define ACCL_SENSOR_POLL_DELAY_MS 10000
282
284 uint8_t num;
285 uint8_t port;
286 uint8_t target_addr;
290
292 uint8_t card_id;
296
303};
304
305void load_sensor_config(void);
306bool is_acb_power_good();
307bool is_dc_access(uint8_t sensor_num);
308struct k_mutex *get_i2c_mux_mutex(uint8_t i2c_bus);
309int get_accl_bus(uint8_t card_id, uint8_t sensor_number);
310sensor_cfg *get_accl_sensor_config(uint8_t card_id, uint8_t sensor_num);
311bool get_accl_mux_config(uint8_t card_id, mux_config *accl_mux);
312sensor_cfg *get_accl_sensor_cfg_info(uint8_t card_id, uint8_t *cfg_count);
313bool is_accl_power_good(uint8_t card_id);
314bool is_accl_cable_power_good(uint8_t card_id);
315bool is_accl_cable_power_good_timeout(uint8_t card_id);
316bool is_accl_cable_power_good_fault(uint8_t card_id);
320bool is_time_to_poll_card_sensor(uint8_t card_id);
321bool get_accl_power_status(uint8_t card_id, uint8_t option);
322
323#endif
void load_sensor_config(void)
Definition: sensor.c:1405
bool is_accl_power_good(uint8_t card_id)
Definition: plat_sensor_table.c:1543
struct k_mutex * get_i2c_mux_mutex(uint8_t i2c_bus)
Definition: plat_hook.c:901
sensor_cfg * get_common_sensor_cfg_info(uint8_t sensor_num)
Definition: sensor.c:763
bool get_accl_mux_config(uint8_t card_id, mux_config *accl_mux)
Definition: plat_sensor_table.c:1623
void update_plat_sensor_cfg_by_stage()
Definition: plat_sensor_table.c:1391
sensor_cfg * get_accl_sensor_cfg_info(uint8_t card_id, uint8_t *cfg_count)
Definition: plat_sensor_table.c:1441
struct _sensor_compatible_cfg sensor_compatible_cfg
bool is_accl_cable_power_good_fault(uint8_t card_id)
Definition: plat_sensor_table.c:1559
bool is_accl_cable_power_good_timeout(uint8_t card_id)
Definition: plat_sensor_table.c:1554
sensor_cfg * get_accl_sensor_config(uint8_t card_id, uint8_t sensor_num)
Definition: plat_sensor_table.c:1601
int get_accl_bus(uint8_t card_id, uint8_t sensor_number)
Definition: plat_sensor_table.c:1591
bool is_dc_access(uint8_t sensor_num)
Definition: plat_sensor_table.c:1564
bool get_accl_power_status(uint8_t card_id, uint8_t option)
Definition: plat_sensor_table.c:1489
bool is_time_to_poll_card_sensor(uint8_t card_id)
Definition: plat_sensor_table.c:1636
bool is_acb_power_good()
Definition: plat_sensor_table.c:1462
ACCL_POWER_REGISTER_OPTION
Definition: plat_sensor_table.h:297
@ ACCL_CARD_3V3_POWER_GOOD
Definition: plat_sensor_table.h:299
@ ACCL_CABLE_POWER_GOOD_FAULT
Definition: plat_sensor_table.h:302
@ ACCL_CABLE_POWER_GOOD
Definition: plat_sensor_table.h:300
@ ACCL_CARD_12V_POWER_GOOD
Definition: plat_sensor_table.h:298
@ ACCL_CABLE_POWER_GOOD_TIMEOUT
Definition: plat_sensor_table.h:301
bool is_accl_cable_power_good(uint8_t card_id)
Definition: plat_sensor_table.c:1549
struct _sensor_poll_delay_cfg sensor_poll_delay_cfg
sensor_cfg * get_artemis_module_sensor_cfg(uint8_t card_id)
uint8_t sensor_num
Definition: storage_handler.h:6
Definition: common_i2c_mux.h:23
Definition: sensor.h:255
Definition: plat_sensor_table.h:283
uint8_t port
Definition: plat_sensor_table.h:285
uint8_t num
Definition: plat_sensor_table.h:284
void * pre_sensor_read_args
Definition: plat_sensor_table.h:287
void * post_sensor_read_args
Definition: plat_sensor_table.h:288
uint8_t target_addr
Definition: plat_sensor_table.h:286
Definition: plat_sensor_table.h:291
uint8_t card_id
Definition: plat_sensor_table.h:292
int64_t card_first_power_good_time
Definition: plat_sensor_table.h:294
bool is_last_time_power_good
Definition: plat_sensor_table.h:293