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 "plat_def.h"
23
24/* SENSOR POLLING TIME(second) */
25#define POLL_TIME_BAT3V 3600
26
27/* SENSOR ADDRESS(7-bit)/OFFSET */
28#define E1S_SSD_ADDR (0xD4 >> 1)
29#define FPGA_ADDR (0xC0 >> 1)
30#define TEMP_HSC_ADDR (0x98 >> 1)
31#define MP5990_ADDR (0xA0 >> 1)
32#define MP5990_ADDR_1 (0xC0 >> 1) // for board >= EVT2
33#define RS31380R_ADDR (0xC0 >> 1)
34#define INA230_ADDR (0x8A >> 1)
35#define INA3221_ADDR (0x80 >> 1)
36#define TMP451_ADDR (0x98 >> 1)
37#define TMP75_ADDR (0x90 >> 1)
38#define AL_RETIMER_ADDR (0x40 >> 1)
39#define TI_RETIMER_ADDR (0x20 >> 1)
40
41/* SENSOR OFFSET */
42#define SSD_TEMP_OFFSET 0x00
43#define TMP75_TEMP_OFFSET 0x00
44
45/* threshold sensor number, 1 based - temperature */
46#define SENSOR_NUM_TEMP_TMP451_IN 0x1
47#define SENSOR_NUM_TEMP_TMP451_OUT 0x2
48#define SENSOR_NUM_TEMP_TMP75_FIO 0x3
49#define SENSOR_NUM_TEMP_CPU 0x4
50#define SENSOR_NUM_TEMP_FPGA 0x5
51#define SENSOR_NUM_TEMP_E1S_SSD 0x6
52#define SENSOR_NUM_TEMP_HSC 0x7
53#define SENSOR_NUM_TEMP_CPUDVDD 0x8
54#define SENSOR_NUM_TEMP_CPUVDD 0x9
55#define SENSOR_NUM_TEMP_SOCVDD 0xA
56#define SENSOR_NUM_TEMP_RETIMER 0xB
57#define SENSOR_NUM_TEMP_LPDDR5_UP 0xC
58#define SENSOR_NUM_TEMP_LPDDR5_DOWN 0xD
59
60/* SENSOR NUMBER(1 based) - voltage */
61#define SENSOR_NUM_VOL_HSCIN 0x10
62#define SENSOR_NUM_VOL_ADC0_P12V_STBY 0x11
63#define SENSOR_NUM_VOL_ADC1_VDD_1V8 0x12
64#define SENSOR_NUM_VOL_ADC2_P3V3_STBY 0x13
65#define SENSOR_NUM_VOL_ADC3_SOCVDD 0x14
66#define SENSOR_NUM_VOL_ADC4_P3V_BAT 0x15
67#define SENSOR_NUM_VOL_ADC5_CPUVDD 0x16
68#define SENSOR_NUM_VOL_ADC6_FPGA_VCC_AO 0x17
69#define SENSOR_NUM_VOL_ADC7_1V2 0x18
70#define SENSOR_NUM_VOL_ADC9_VDD_3V3 0x19
71#define SENSOR_NUM_VOL_ADC10_P1V2_STBY 0x1A
72#define SENSOR_NUM_VOL_ADC11_FBVDDQ 0x1B
73#define SENSOR_NUM_VOL_ADC12_FBVDDP2 0x1C
74#define SENSOR_NUM_VOL_ADC13_FBVDD1 0x1D
75#define SENSOR_NUM_VOL_ADC14_P5V_STBY 0x1E
76#define SENSOR_NUM_VOL_ADC15_CPU_DVDD 0x1F
77#define SENSOR_NUM_VOL_E1S 0x20
78#define SENSOR_NUM_VOL_CPUDVDD 0x21
79#define SENSOR_NUM_VOL_CPUVDD 0x22
80#define SENSOR_NUM_VOL_SOCVDD 0x23
81
82/* SENSOR NUMBER(1 based) - current */
83#define SENSOR_NUM_CUR_HSCOUT 0x25
84#define SENSOR_NUM_CUR_E1S 0x26
85#define SENSOR_NUM_CUR_CPUDVDD 0x27
86#define SENSOR_NUM_CUR_CPUVDD 0x28
87#define SENSOR_NUM_CUR_SOCVDD 0x29
88
89/* SENSOR NUMBER(1 based) - power */
90#define SENSOR_NUM_PWR_CPU 0x30
91#define SENSOR_NUM_PWR_HSCIN 0x31
92#define SENSOR_NUM_PWR_E1S 0x32
93#define SENSOR_NUM_PWR_CPUDVDD 0x33
94#define SENSOR_NUM_PWR_CPUVDD 0x34
95#define SENSOR_NUM_PWR_SOCVDD 0x35
96
97/* SENSOR NUMBER(1 based) - state */
98#define SENSOR_NUM_OTH_CPU_THROTTLE 0x40
99#define SENSOR_NUM_OTH_POWER_BREAK 0x41
100#define SENSOR_NUM_OTH_SPARE_CHANNEL 0x42
101#define SENSOR_NUM_OTH_PAGE_RETIRE_CNT 0x43
102
103/* SENSOR NUMBER - sel */
104#define SENSOR_NUM_SYSTEM_STATUS 0x10
105#define SENSOR_NUM_POWER_ERROR 0x56
106#define SENSOR_NUM_PROC_FAIL 0x65
107#define SENSOR_NUM_VR_OCP 0x71
108#define SENSOR_NUM_CPU_FAULT 0xC0
109
110#define IPMI_EVENT_OFFSET_SYS_E1S_ALERT 0x86
111#define IPMI_EVENT_CPUVDD_OCP_ASSERT 0x06
112
113uint8_t plat_get_config_size();
114void load_sensor_config(void);
115bool modify_sensor_cfg();
116
117#endif
void load_sensor_config(void)
Definition: sensor.c:1413
uint8_t plat_get_config_size()
Definition: sensor.c:1408
bool modify_sensor_cfg()
Definition: plat_sensor_table.c:249