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 "pmbus.h"
#include "plat_def.h"
#include "tmp461.h"
#include "pt5161l.h"
#include "ds160pt801.h"
#include "plat_class.h"
#include "plat_hook.h"
#include "plat_i2c.h"
#include "plat_i3c.h"
#include "plat_power_status.h"
#include "libutil.h"
#include <logging/log.h>
Include dependency graph for plat_sensor_table.c:

Functions

 LOG_MODULE_REGISTER (plat_sensor_table)
 
bool modify_sensor_cfg ()
 
void pal_extend_sensor_config ()
 
uint8_t pal_get_extend_sensor_config ()
 
bool pal_is_time_to_poll (uint8_t sensor_num, int poll_time)
 
void load_sensor_config (void)
 

Variables

sensor_poll_time_cfg diff_poll_time_sensor_table []
 
sensor_cfg plat_sensor_config []
 
sensor_cfg mp5990_sensor_config_table []
 
sensor_cfg mp5990_temp_sensor_config_table []
 
sensor_cfg rs31380r_sensor_config_table []
 
sensor_cfg rs31380r_temp_sensor_config_table []
 
sensor_cfg pt4080l_sensor_config_table []
 
sensor_cfg ds160pt801_sensor_config_table []
 
const int SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_sensor_config)
 

Function Documentation

◆ 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  )

◆ modify_sensor_cfg()

bool modify_sensor_cfg ( )
Here is the call graph for this function:

◆ 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 
)

Variable Documentation

◆ diff_poll_time_sensor_table

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

◆ ds160pt801_sensor_config_table

sensor_cfg ds160pt801_sensor_config_table[]
Initial value:
= {
DS160PT801_READ_TEMP, retimer_access, 0, 0, SAMPLE_COUNT_DEFAULT, POLL_TIME_DEFAULT,
NULL, NULL, NULL },
}
#define I2C_BUS2
Definition: plat_i2c.h:25
struct tca9548 mux_conf_addr_0xe2[]
Definition: plat_hook.c:955
bool retimer_access(uint8_t sensor_num)
Definition: plat_sensor_table.c:566
@ SENSOR_INIT_STATUS
Definition: sensor.h:240
@ ENABLE_SENSOR_POLLING
Definition: sensor.h:196
#define POLL_TIME_DEFAULT
Definition: sensor.h:48
@ sensor_dev_ds160pt801
Definition: sensor.h:175
#define SAMPLE_COUNT_DEFAULT
Definition: sensor.h:46
bool pre_ds160pt801_read(sensor_cfg *cfg, void *args)
Definition: plat_hook.c:331
#define TI_RETIMER_ADDR
Definition: plat_sensor_table.h:39
#define SENSOR_NUM_TEMP_RETIMER
Definition: plat_sensor_table.h:56

◆ mp5990_sensor_config_table

sensor_cfg mp5990_sensor_config_table[]
Initial value:
= {
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &mp5990_init_args[0] },
}
mp5990_init_arg mp5990_init_args[]
Definition: plat_hook.c:46
@ PMBUS_READ_IOUT
Definition: pmbus.h:118
@ PMBUS_READ_EIN
Definition: pmbus.h:113
@ PMBUS_READ_VIN
Definition: pmbus.h:114
@ sensor_dev_mp5990
Definition: sensor.h:125
#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_VOL_HSCIN
Definition: plat_sensor_table.h:85
bool stby_access(uint8_t sensor_number)
Definition: sensor.c:1111
bool post_mp5990_cur_read(sensor_cfg *cfg, void *args, int *reading)
Definition: plat_hook.c:260
bool post_mp5990_pwr_read(sensor_cfg *cfg, void *args, int *reading)
Definition: plat_hook.c:278
#define MP5990_ADDR
Definition: plat_sensor_table.h:57

◆ mp5990_temp_sensor_config_table

sensor_cfg mp5990_temp_sensor_config_table[]
Initial value:
= {
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &mp5990_init_args[0] },
}
@ PMBUS_READ_TEMPERATURE_1
Definition: pmbus.h:119
#define SENSOR_NUM_TEMP_HSC
Definition: plat_sensor_table.h:64

◆ plat_sensor_config

sensor_cfg plat_sensor_config[]

◆ pt4080l_sensor_config_table

sensor_cfg pt4080l_sensor_config_table[]
Initial value:
= {
NULL, NULL, &pt5161l_init_args[0] },
}
pt5161l_init_arg pt5161l_init_args[]
Definition: plat_hook.c:244
#define PT5161L_TEMP_OFFSET
Definition: pt5161l.h:47
@ sensor_dev_pt5161l
Definition: sensor.h:157
bool pre_pt4080l_read(sensor_cfg *cfg, void *args)
Definition: plat_hook.c:290
#define AL_RETIMER_ADDR
Definition: plat_sensor_table.h:38

◆ rs31380r_sensor_config_table

sensor_cfg rs31380r_sensor_config_table[]
Initial value:
= {
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &rs31380r_init_args[0] },
}
@ PMBUS_READ_PIN
Definition: pmbus.h:129
@ sensor_dev_rs31380r
Definition: sensor.h:176
bool post_rs31380r_pwr_read(sensor_cfg *cfg, void *args, int *reading)
Definition: plat_hook.c:242
rs31380r_init_arg rs31380r_init_args[]
Definition: plat_hook.c:78
bool post_rs31380r_cur_read(sensor_cfg *cfg, void *args, int *reading)
Definition: plat_hook.c:225
#define RS31380R_ADDR
Definition: plat_sensor_table.h:33

◆ rs31380r_temp_sensor_config_table

◆ SENSOR_CONFIG_SIZE

const int SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_sensor_config)