OpenBIC
OpenSource Bridge-IC
plat_sensor_table.c File Reference
#include <string.h>
#include <logging/log.h>
#include "ast_adc.h"
#include "sensor.h"
#include "power_status.h"
#include "pmbus.h"
#include "pt5161l.h"
#include "ina233.h"
#include "plat_i2c.h"
#include "plat_sensor_table.h"
#include "plat_hook.h"
#include "plat_class.h"
#include "plat_power_seq.h"
#include "ipmi.h"
#include "libipmi.h"
Include dependency graph for plat_sensor_table.c:

Functions

 LOG_MODULE_REGISTER (plat_sensor)
 
bool e1s_access (uint8_t sensor_num)
 
bool retimer_access (uint8_t sensor_num)
 
bool edge_access (uint8_t sensor_num)
 
void load_sensor_config (void)
 
uint8_t pal_get_extend_sensor_config ()
 
int check_pwr_monitor_type (void)
 
void change_ina233_sensor_addr ()
 
void change_power_monitor_config_for_sq5220x (void)
 
void pal_change_sensor_config_number ()
 
void pal_extend_sensor_config ()
 

Variables

bool is_pwr_mnt_first_read [] = { false, false, false, false, false }
 
sensor_cfg plat_sensor_config []
 
sensor_cfg plat_expansion_A_sensor_config []
 
sensor_cfg plat_expansion_B_sensor_config []
 
const int SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_sensor_config)
 

Function Documentation

◆ change_ina233_sensor_addr()

void change_ina233_sensor_addr ( void  )

◆ change_power_monitor_config_for_sq5220x()

void change_power_monitor_config_for_sq5220x ( void  )

◆ check_pwr_monitor_type()

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

◆ e1s_access()

bool e1s_access ( uint8_t  sensor_num)

◆ edge_access()

bool edge_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  )

◆ pal_change_sensor_config_number()

void pal_change_sensor_config_number ( void  )

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

◆ retimer_access()

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

Variable Documentation

◆ is_pwr_mnt_first_read

bool is_pwr_mnt_first_read[] = { false, false, false, false, false }

◆ plat_expansion_A_sensor_config

sensor_cfg plat_expansion_A_sensor_config[]

◆ plat_expansion_B_sensor_config

sensor_cfg plat_expansion_B_sensor_config[]

◆ plat_sensor_config

sensor_cfg plat_sensor_config[]
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,
}
#define I2C_BUS3
Definition: plat_i2c.h:26
ina233_init_arg ina233_init_args[]
Definition: plat_hook.c:541
bool edge_access(uint8_t sensor_num)
Definition: plat_sensor_table.c:664
#define INA233_VOLT_OFFSET
Definition: plat_sensor_table.h:44
#define INA233_EXPA_MAIN_ADDR
Definition: plat_sensor_table.h:33
@ SENSOR_NUM_1OU_P12V_EDGE_VOLT
Definition: plat_sensor_table.h:65
@ SENSOR_NUM_1OU_P12V_EDGE_CURR
Definition: plat_sensor_table.h:79
@ SENSOR_NUM_1OU_P12V_EDGE_PWR
Definition: plat_sensor_table.h:84
#define INA233_PWR_OFFSET
Definition: plat_sensor_table.h:46
#define INA233_CURR_OFFSET
Definition: plat_sensor_table.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_ina233
Definition: sensor.h:134
#define SAMPLE_COUNT_DEFAULT
Definition: sensor.h:46

◆ SENSOR_CONFIG_SIZE

const int SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_sensor_config)