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 "sensor.h"
#include "ast_adc.h"
#include "intel_peci.h"
#include "hal_gpio.h"
#include "plat_class.h"
#include "plat_gpio.h"
#include "plat_hook.h"
#include "plat_i2c.h"
#include "plat_i3c.h"
#include "plat_dimm.h"
#include "power_status.h"
#include "pmbus.h"
#include "tmp431.h"
#include "libutil.h"
#include "xdpe15284.h"
#include <logging/log.h>
Include dependency graph for plat_sensor_table.c:

Functions

 LOG_MODULE_REGISTER (plat_sensor_table)
 
void load_sensor_config (void)
 
uint8_t pal_get_extend_sensor_config ()
 
int set_vr_page (uint8_t bus, uint8_t addr, uint8_t page)
 
void check_vr_type (uint8_t index)
 
void check_outlet_temp_type (uint8_t index)
 
void pal_extend_sensor_config ()
 
bool pal_is_time_to_poll (uint8_t sensor_num, int poll_time)
 
uint8_t get_hsc_pwr_reading (int *reading)
 
bool disable_dimm_pmic_sensor (uint8_t sensor_num)
 
uint8_t get_dimm_status (uint8_t dimm_index)
 

Variables

SET_GPIO_VALUE_CFG pre_bat_3v = { A_P3V_BAT_SCALED_EN_R, GPIO_HIGH }
 
SET_GPIO_VALUE_CFG post_bat_3v = { A_P3V_BAT_SCALED_EN_R, GPIO_LOW }
 
sensor_poll_time_cfg diff_poll_time_sensor_table []
 
dimm_pmic_mapping_cfg dimm_pmic_map_table []
 
sensor_cfg plat_sensor_config []
 
sensor_cfg mp5990_sensor_config_table []
 
sensor_cfg adm1278_sensor_config_table []
 
sensor_cfg ltc4286_sensor_config_table []
 
sensor_cfg ltc4282_sensor_config_table []
 
sensor_cfg evt3_class1_adi_temperature_sensor_table []
 
sensor_cfg DPV2_sensor_config_table []
 
const int SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_sensor_config)
 

Function Documentation

◆ check_outlet_temp_type()

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

◆ check_vr_type()

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

◆ disable_dimm_pmic_sensor()

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

◆ get_dimm_status()

uint8_t get_dimm_status ( uint8_t  dimm_index)

◆ get_hsc_pwr_reading()

uint8_t get_hsc_pwr_reading ( int *  reading)
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.

◆ pal_get_extend_sensor_config()

uint8_t pal_get_extend_sensor_config ( void  )

◆ pal_is_time_to_poll()

bool pal_is_time_to_poll ( uint8_t  sensor_num,
int  poll_time 
)

◆ set_vr_page()

int set_vr_page ( uint8_t  bus,
uint8_t  addr,
uint8_t  page 
)
Here is the call graph for this function:

Variable Documentation

◆ adm1278_sensor_config_table

sensor_cfg adm1278_sensor_config_table[]
Initial value:
= {
ENABLE_SENSOR_POLLING, 0, SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL,
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &adm1278_init_args[0] },
}
#define I2C_BUS2
Definition: plat_i2c.h:25
@ PMBUS_READ_IOUT
Definition: pmbus.h:118
@ PMBUS_READ_TEMPERATURE_1
Definition: pmbus.h:119
@ PMBUS_READ_PIN
Definition: pmbus.h:129
@ PMBUS_READ_VIN
Definition: pmbus.h:114
@ SENSOR_INIT_STATUS
Definition: sensor.h:240
@ ENABLE_SENSOR_POLLING
Definition: sensor.h:196
#define POLL_TIME_DEFAULT
Definition: sensor.h:48
@ sensor_dev_adm1278
Definition: sensor.h:122
#define SAMPLE_COUNT_DEFAULT
Definition: sensor.h:46
bool post_adm1278_power_read(sensor_cfg *cfg, void *args, int *reading)
Definition: plat_hook.c:208
bool post_adm1278_current_read(sensor_cfg *cfg, void *args, int *reading)
Definition: plat_hook.c:233
adm1278_init_arg adm1278_init_args[]
Definition: plat_hook.c:44
#define SENSOR_NUM_CUR_HSCOUT
Definition: plat_sensor_table.h:94
#define SENSOR_NUM_PWR_HSCIN
Definition: plat_sensor_table.h:105
#define SENSOR_NUM_TEMP_HSC
Definition: plat_sensor_table.h:64
#define SENSOR_NUM_VOL_HSCIN
Definition: plat_sensor_table.h:85
bool stby_access(uint8_t sensor_number)
Definition: sensor.c:1111
#define ADI_ADM1278_ADDR
Definition: plat_sensor_table.h:31

◆ diff_poll_time_sensor_table

sensor_poll_time_cfg diff_poll_time_sensor_table[]
Initial value:
= {
}
#define SENSOR_NUM_VOL_BAT3V
Definition: plat_sensor_table.h:77

◆ dimm_pmic_map_table

dimm_pmic_mapping_cfg dimm_pmic_map_table[]
Initial value:
= {
}
#define SENSOR_NUM_TEMP_DIMM_A4
Definition: plat_sensor_table.h:72
#define SENSOR_NUM_PWR_DIMMA4_PMIC
Definition: plat_sensor_table.h:118
#define SENSOR_NUM_TEMP_DIMM_A0
Definition: plat_sensor_table.h:69
#define SENSOR_NUM_PWR_DIMMA7_PMIC
Definition: plat_sensor_table.h:120
#define SENSOR_NUM_PWR_DIMMA6_PMIC
Definition: plat_sensor_table.h:119
#define SENSOR_NUM_TEMP_DIMM_A3
Definition: plat_sensor_table.h:71
#define SENSOR_NUM_PWR_DIMMA2_PMIC
Definition: plat_sensor_table.h:116
#define SENSOR_NUM_TEMP_DIMM_A2
Definition: plat_sensor_table.h:70
#define SENSOR_NUM_PWR_DIMMA3_PMIC
Definition: plat_sensor_table.h:117
#define SENSOR_NUM_PWR_DIMMA0_PMIC
Definition: plat_sensor_table.h:115
#define SENSOR_NUM_TEMP_DIMM_A6
Definition: plat_sensor_table.h:73
#define SENSOR_NUM_TEMP_DIMM_A7
Definition: plat_sensor_table.h:74

◆ DPV2_sensor_config_table

sensor_cfg DPV2_sensor_config_table[]
Initial value:
= {
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &max16550a_init_args[0] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &max16550a_init_args[0] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &max16550a_init_args[0] },
ENABLE_SENSOR_POLLING, 0, SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL,
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &max16550a_init_args[0] },
}
#define I2C_BUS9
Definition: plat_i2c.h:32
@ PMBUS_READ_VOUT
Definition: pmbus.h:117
bool dc_access(uint8_t sensor_num)
Definition: sensor.c:1116
@ sensor_dev_max16550a
Definition: sensor.h:136
max16550a_init_arg max16550a_init_args[]
Definition: plat_hook.c:104
#define DPV2_16_ADDR
Definition: plat_sensor_table.h:61
#define SENSOR_NUM_TEMP_DPV2_EFUSE
Definition: plat_sensor_table.h:135
#define SENSOR_NUM_VOL_DPV2_12VIN
Definition: plat_sensor_table.h:132
#define SENSOR_NUM_PWR_DPV2
Definition: plat_sensor_table.h:136
#define SENSOR_NUM_VOL_DPV2_12VOUT
Definition: plat_sensor_table.h:133
#define SENSOR_NUM_CUR_DPV2OUT
Definition: plat_sensor_table.h:134

◆ evt3_class1_adi_temperature_sensor_table

sensor_cfg evt3_class1_adi_temperature_sensor_table[]
Initial value:
= {
ENABLE_SENSOR_POLLING, 0, SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, NULL },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, NULL },
}
#define SENSOR_NUM_TEMP_TMP75_OUT
Definition: plat_sensor_table.h:41
@ sensor_dev_tmp431
Definition: sensor.h:132
@ TMP431_LOCAL_TEMPERATRUE
Definition: tmp431.h:21
@ TMP431_REMOTE_TEMPERATRUE
Definition: tmp431.h:22
#define TMP431_ADDR
Definition: plat_sensor_table.h:29

◆ ltc4282_sensor_config_table

sensor_cfg ltc4282_sensor_config_table[]
Initial value:
= {
}
bool post_ltc4282_read(sensor_cfg *cfg, void *args, int *reading)
Definition: plat_hook.c:1135
@ 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
ltc4282_init_arg ltc4282_init_args[]
Definition: plat_hook.c:42
#define ADI_LTC4282_ADDR
Definition: plat_sensor_table.h:35

◆ ltc4286_sensor_config_table

◆ mp5990_sensor_config_table

◆ plat_sensor_config

sensor_cfg plat_sensor_config[]

◆ post_bat_3v

SET_GPIO_VALUE_CFG post_bat_3v = { A_P3V_BAT_SCALED_EN_R, GPIO_LOW }

◆ pre_bat_3v

SET_GPIO_VALUE_CFG pre_bat_3v = { A_P3V_BAT_SCALED_EN_R, GPIO_HIGH }

◆ SENSOR_CONFIG_SIZE

const int SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_sensor_config)