OpenBIC
OpenSource Bridge-IC
plat_sensor_table.c File Reference
#include "plat_sensor_table.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <logging/log.h>
#include "sensor.h"
#include "ast_adc.h"
#include "intel_peci.h"
#include "hal_gpio.h"
#include "plat_gpio.h"
#include "plat_hook.h"
#include "plat_i2c.h"
#include "power_status.h"
#include "pmbus.h"
#include "tmp431.h"
#include "libutil.h"
#include "i2c-mux-tca9548.h"
#include "isl28022.h"
#include "pex89000.h"
#include "util_sys.h"
#include "plat_class.h"
#include "plat_pldm_monitor.h"
Include dependency graph for plat_sensor_table.c:

Functions

 LOG_MODULE_REGISTER (plat_sensor_table)
 
void load_sensor_config (void)
 
void pal_extend_sensor_config ()
 
uint8_t pal_get_extend_sensor_config ()
 
bool is_e1s_access (uint8_t sensor_num)
 
bool is_nic_access (uint8_t sensor_num)
 
bool is_nic_optics_access (uint8_t sensor_num)
 
bool is_dc_access (uint8_t sensor_num)
 

Variables

sensor_cfg plat_sensor_config []
 
sensor_cfg evt_pex_sensor_config_table []
 
sensor_cfg dvt_pex_sensor_config_table []
 
sensor_cfg mp5990_hsc_sensor_config_table []
 
sensor_cfg ltc4282_hsc_sensor_config_table []
 
sensor_cfg ltc4286_hsc_sensor_config_table []
 
sensor_cfg isl69259_vr_sensor_config_table []
 
sensor_cfg xdpe12284_vr_sensor_config_table []
 
sensor_cfg mp2971_vr_sensor_config_table []
 
sensor_cfg isl28022_power_monitor_sensor_config_table []
 
sensor_cfg ina230_power_monitor_sensor_config_table []
 
const int SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_sensor_config)
 

Function Documentation

◆ is_dc_access()

bool is_dc_access ( uint8_t  sensor_num)
Here is the call graph for this function:

◆ is_e1s_access()

bool is_e1s_access ( uint8_t  sensor_num)
Here is the call graph for this function:

◆ is_nic_access()

bool is_nic_access ( uint8_t  sensor_num)
Here is the call graph for this function:

◆ is_nic_optics_access()

bool is_nic_optics_access ( uint8_t  sensor_num)
Here is the call graph for this function:

◆ load_sensor_config()

void load_sensor_config ( void  )
Here is the call graph for this function:

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_sensor_table  )

◆ pal_extend_sensor_config()

void pal_extend_sensor_config ( void  )

EVT2 switch board has two configurations that will cause the need to load different sensor table.

1st : ISL69259(VR) + MPS5990(HSC) + ISL28022(Power monitor IC) 2nd : XDPE12284(VR) + LTC4282(HSC) + INA230(Power monitor IC)

Since the BOARD_ID pins were originally used to identify which configuration has no function in this stage, so the current configuration is identified by IC_DEVICE_ID which gets from the VR chip.

The way to identify different configurations by BOARD_ID will be added back in the next stage.

Here is the call graph for this function:

◆ pal_get_extend_sensor_config()

uint8_t pal_get_extend_sensor_config ( void  )
Here is the call graph for this function:

Variable Documentation

◆ dvt_pex_sensor_config_table

sensor_cfg dvt_pex_sensor_config_table[]
Initial value:
= {
ENABLE_SENSOR_POLLING, 0, SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL,
ENABLE_SENSOR_POLLING, 0, SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL,
ENABLE_SENSOR_POLLING, 0, SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL,
ENABLE_SENSOR_POLLING, 0, SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL,
}
#define I2C_BUS10
Definition: plat_i2c.h:33
pex89000_init_arg pex_sensor_init_args[]
Definition: plat_hook.c:533
bool is_dc_access(uint8_t sensor_num)
Definition: plat_sensor_table.c:1564
#define SENSOR_NUM_TEMP_PEX_0
Definition: plat_sensor_table.h:60
#define SENSOR_NUM_TEMP_PEX_1
Definition: plat_sensor_table.h:61
#define DVT_PEX_SWITCH_2_I2C_ADDR
Definition: plat_sensor_table.h:56
#define DVT_PEX_SWITCH_0_I2C_ADDR
Definition: plat_sensor_table.h:54
#define DVT_PEX_SWITCH_3_I2C_ADDR
Definition: plat_sensor_table.h:57
#define SENSOR_NUM_TEMP_PEX_2
Definition: plat_sensor_table.h:183
#define SENSOR_NUM_TEMP_PEX_3
Definition: plat_sensor_table.h:184
#define DVT_PEX_SWITCH_1_I2C_ADDR
Definition: plat_sensor_table.h:55
@ PEX_TEMP
Definition: pex89000.h:45
@ ENABLE_SENSOR_POLLING
Definition: sensor.h:197
@ SENSOR_INIT_STATUS
Definition: sensor.h:241
#define POLL_TIME_DEFAULT
Definition: sensor.h:48
@ sensor_dev_pex89000
Definition: sensor.h:127
#define SAMPLE_COUNT_DEFAULT
Definition: sensor.h:46

◆ evt_pex_sensor_config_table

sensor_cfg evt_pex_sensor_config_table[]
Initial value:
= {
NULL, &pex_sensor_init_args[0] },
NULL, &pex_sensor_init_args[1] },
NULL, &pex_sensor_init_args[2] },
NULL, &pex_sensor_init_args[3] },
}
bool pre_pex89000_read(sensor_cfg *cfg, void *args)
Definition: plat_hook.c:899
pex89000_pre_proc_arg pex89000_pre_read_args[]
Definition: plat_hook.c:968
bool post_i2c_bus_read(sensor_cfg *cfg, void *args, int *reading)
Definition: plat_hook.c:1056
#define EVT_PEX_SWITCH_I2C_ADDR
Definition: plat_sensor_table.h:52

◆ ina230_power_monitor_sensor_config_table

sensor_cfg ina230_power_monitor_sensor_config_table[]

◆ isl28022_power_monitor_sensor_config_table

sensor_cfg isl28022_power_monitor_sensor_config_table[]

◆ isl69259_vr_sensor_config_table

sensor_cfg isl69259_vr_sensor_config_table[]

◆ ltc4282_hsc_sensor_config_table

sensor_cfg ltc4282_hsc_sensor_config_table[]
Initial value:
= {
}
#define I2C_BUS6
Definition: plat_i2c.h:29
bool pre_i2c_bus_read(sensor_cfg *cfg, void *args)
Definition: plat_hook.c:1034
nct7718w_init_arg nct7718w_init_args[]
Definition: plat_hook.c:924
ltc4282_init_arg ltc4282_hsc_init_args[]
Definition: plat_hook.c:288
struct tca9548 mux_conf_addr_0xe0[]
Definition: plat_hook.c:948
bool post_ltc4282_read(sensor_cfg *cfg, void *args, int *reading)
Definition: plat_hook.c:1135
#define SENSOR_NUM_TEMP_PDB_HSC
Definition: plat_sensor_table.h:130
#define HSC_TEMP_NCT7718W_ADDR
Definition: plat_sensor_table.h:40
#define HSC_LTC4282_ADDR
Definition: plat_sensor_table.h:38
#define SENSOR_NUM_POUT_PDB_HSC
Definition: plat_sensor_table.h:133
#define SENSOR_NUM_IOUT_PDB_HSC
Definition: plat_sensor_table.h:132
#define SENSOR_NUM_VOUT_PDB_HSC
Definition: plat_sensor_table.h:131
@ NCT7718W_LOCAL_TEMP_OFFSET
Definition: sensor.h:68
@ sensor_dev_nct7718w
Definition: sensor.h:140
@ sensor_dev_ltc4282
Definition: sensor.h:130
@ LTC4282_POWER_OFFSET
Definition: sensor.h:53
@ LTC4282_VSOURCE_OFFSET
Definition: sensor.h:54
@ LTC4282_VSENSE_OFFSET
Definition: sensor.h:52
bool stby_access(uint8_t sensor_number)
Definition: sensor.c:1119

◆ ltc4286_hsc_sensor_config_table

sensor_cfg ltc4286_hsc_sensor_config_table[]
Initial value:
= {
}
ltc4286_init_arg ltc4286_hsc_init_args[]
Definition: plat_hook.c:295
bool post_ltc4286_read(sensor_cfg *cfg, void *args, int *reading)
Definition: plat_hook.c:1171
#define HSC_LTC4286_ADDR
Definition: plat_sensor_table.h:39
@ PMBUS_READ_IOUT
Definition: pmbus.h:118
@ PMBUS_READ_VOUT
Definition: pmbus.h:117
@ PMBUS_READ_PIN
Definition: pmbus.h:129
@ sensor_dev_ltc4286
Definition: sensor.h:141

◆ mp2971_vr_sensor_config_table

sensor_cfg mp2971_vr_sensor_config_table[]

◆ mp5990_hsc_sensor_config_table

sensor_cfg mp5990_hsc_sensor_config_table[]
Initial value:
= {
}
bool post_mp5990_read(sensor_cfg *cfg, void *args, int *reading)
Definition: plat_hook.c:1097
mp5990_init_arg mp5990_hsc_init_args[]
Definition: plat_hook.c:279
#define HSC_MP5990_ADDR
Definition: plat_sensor_table.h:37
@ PMBUS_READ_TEMPERATURE_1
Definition: pmbus.h:119
@ PMBUS_READ_VIN
Definition: pmbus.h:114
@ sensor_dev_mp5990
Definition: sensor.h:125

◆ plat_sensor_config

sensor_cfg plat_sensor_config[]

◆ SENSOR_CONFIG_SIZE

const int SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_sensor_config)

◆ xdpe12284_vr_sensor_config_table

sensor_cfg xdpe12284_vr_sensor_config_table[]