OpenBIC
OpenSource Bridge-IC
plat_sensor_table.c File Reference
#include <stdio.h>
#include <string.h>
#include "ast_adc.h"
#include "sensor.h"
#include "plat_hook.h"
#include "plat_i2c.h"
#include "plat_sensor_table.h"
#include "pmbus.h"
#include "util_sys.h"
#include "cci.h"
#include "plat_mctp.h"
#include "pm8702.h"
#include <logging/log.h>
#include "ina233.h"
Include dependency graph for plat_sensor_table.c:

Functions

 LOG_MODULE_REGISTER (plat_sensor_table)
 
int check_pwr_monitor_type (void)
 
int check_vr_type (void)
 
void pal_extend_sensor_config ()
 
uint8_t pal_get_extend_sensor_config ()
 
void load_sensor_config (void)
 

Variables

sensor_cfg plat_sensor_config []
 
sensor_cfg ina233_sensor_config_table []
 
sensor_cfg SGY_SQ5220x_sensor_config_table []
 
sensor_cfg VR_RNS_sensor_config_table []
 
sensor_cfg VR_INF_sensor_config_table []
 
const int SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_sensor_config)
 

Function Documentation

◆ check_pwr_monitor_type()

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

◆ check_vr_type()

int check_vr_type ( void  )
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  )

Variable Documentation

◆ ina233_sensor_config_table

sensor_cfg ina233_sensor_config_table[]
Initial value:
= {
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &ina233_init_args[0] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &ina233_init_args[1] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &ina233_init_args[0] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &ina233_init_args[1] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &ina233_init_args[0] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &ina233_init_args[1] },
}
#define I2C_BUS1
Definition: plat_i2c.h:24
ina233_init_arg ina233_init_args[]
Definition: plat_hook.c:541
@ SENSOR_INIT_STATUS
Definition: sensor.h:240
@ ENABLE_SENSOR_POLLING
Definition: sensor.h:196
#define POLL_TIME_DEFAULT
Definition: sensor.h:48
@ sensor_dev_ina233
Definition: sensor.h:134
#define SAMPLE_COUNT_DEFAULT
Definition: sensor.h:46
#define SENSOR_NUM_VOL_STBY12V
Definition: plat_sensor_table.h:76
#define SMBUS_PWR_CMD
Definition: plat_sensor_table.h:54
#define SMBUS_CUR_CMD
Definition: plat_sensor_table.h:52
#define SMBUS_VOL_CMD
Definition: plat_sensor_table.h:51
bool stby_access(uint8_t sensor_number)
Definition: sensor.c:1111
#define INA233_3V3_ADDR
Definition: plat_sensor_table.h:25
#define INA233_12V_ADDR
Definition: plat_sensor_table.h:24
#define SENSOR_NUM_CUR_STBY3V3
Definition: plat_sensor_table.h:80
#define SENSOR_NUM_VOL_STBY3V3
Definition: plat_sensor_table.h:65
#define SENSOR_NUM_PWR_STBY12V
Definition: plat_sensor_table.h:89
#define SENSOR_NUM_PWR_STBY3V3
Definition: plat_sensor_table.h:90
#define SENSOR_NUM_CUR_STBY12V
Definition: plat_sensor_table.h:79

◆ plat_sensor_config

sensor_cfg plat_sensor_config[]

◆ SENSOR_CONFIG_SIZE

const int SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_sensor_config)

◆ SGY_SQ5220x_sensor_config_table

sensor_cfg SGY_SQ5220x_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,
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &SQ5220x_init_args[0] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &SQ5220x_init_args[1] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &SQ5220x_init_args[0] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &SQ5220x_init_args[1] },
}
@ sensor_dev_ina230
Definition: sensor.h:137
@ INA230_PWR_OFFSET
Definition: sensor.h:85
@ INA230_CUR_OFFSET
Definition: sensor.h:86
@ INA230_BUS_VOL_OFFSET
Definition: sensor.h:84
ina230_init_arg SQ5220x_init_args[]
Definition: plat_hook.c:89

◆ VR_INF_sensor_config_table

sensor_cfg VR_INF_sensor_config_table[]

◆ VR_RNS_sensor_config_table

sensor_cfg VR_RNS_sensor_config_table[]