OpenBIC
OpenSource Bridge-IC
plat_sensor_table.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <logging/log.h>
#include "plat_sensor_table.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 "power_status.h"
#include "pmbus.h"
#include "tmp431.h"
#include "libutil.h"
#include "util_sys.h"
Include dependency graph for plat_sensor_table.c:

Functions

 LOG_MODULE_DECLARE (sensor)
 
void load_sensor_config (void)
 
uint8_t pal_get_extend_sensor_config ()
 
void check_outlet_temp_type (uint8_t index)
 
void pal_extend_sensor_config ()
 
uint8_t get_hsc_pwr_reading (int *reading)
 

Variables

struct k_mutex vr_page_mutex
 
sensor_cfg plat_sensor_config []
 
sensor_cfg ltc4282_sensor_config_table []
 
sensor_cfg mp5990_sensor_config_table []
 
sensor_cfg isl69254_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:

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

LOG_MODULE_DECLARE ( sensor  )

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

Variable Documentation

◆ isl69254_sensor_config_table

sensor_cfg isl69254_sensor_config_table[]

◆ ltc4282_sensor_config_table

sensor_cfg ltc4282_sensor_config_table[]
Initial value:
= {
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, NULL },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, NULL },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &ltc4282_init_args[0] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &ltc4282_init_args[0] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &ltc4282_init_args[0] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &ltc4282_init_args[0] },
}
#define I2C_BUS5
Definition: plat_i2c.h:28
@ ENABLE_SENSOR_POLLING
Definition: sensor.h:197
@ SENSOR_INIT_STATUS
Definition: sensor.h:241
#define POLL_TIME_DEFAULT
Definition: sensor.h:48
@ sensor_dev_tmp431
Definition: sensor.h:132
@ 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_ENERGY_OFFSET
Definition: sensor.h:56
#define SAMPLE_COUNT_DEFAULT
Definition: sensor.h:46
@ TMP431_LOCAL_TEMPERATRUE
Definition: tmp431.h:26
@ TMP431_REMOTE_TEMPERATRUE
Definition: tmp431.h:27
ltc4282_init_arg ltc4282_init_args[]
Definition: plat_hook.c:42
#define SENSOR_NUM_HSC_COUT
Definition: plat_sensor_table.h:102
#define TMP431_ADDR
Definition: plat_sensor_table.h:29
#define SENSOR_NUM_T_MB2
Definition: plat_sensor_table.h:53
#define SENSOR_NUM_HSC_VIN
Definition: plat_sensor_table.h:101
#define SENSOR_NUM_HSC_PIN
Definition: plat_sensor_table.h:104
#define SENSOR_NUM_HSC_TEMP
Definition: plat_sensor_table.h:100
#define SENSOR_NUM_HSC_EIN
Definition: plat_sensor_table.h:103
#define LTC4282_ADDR
Definition: plat_sensor_table.h:48
bool stby_access(uint8_t sensor_number)
Definition: sensor.c:1119

◆ mp5990_sensor_config_table

sensor_cfg mp5990_sensor_config_table[]
Initial value:
= {
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, NULL },
ENABLE_SENSOR_POLLING, 0, SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL,
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &mp5990_init_args[0] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &mp5990_init_args[0] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &mp5990_init_args[0] },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, &mp5990_init_args[0] },
}
#define TMP75_TEMP_OFFSET
Definition: plat_sensor_table.h:70
#define TMP75_OUT_ADDR
Definition: plat_sensor_table.h:28
mp5990_init_arg mp5990_init_args[]
Definition: plat_hook.c:46
#define MPS_MP5990_ADDR
Definition: plat_sensor_table.h:31
@ PMBUS_READ_IOUT
Definition: pmbus.h:118
@ PMBUS_READ_TEMPERATURE_1
Definition: pmbus.h:119
@ PMBUS_READ_PIN
Definition: pmbus.h:129
@ PMBUS_READ_EIN
Definition: pmbus.h:113
@ PMBUS_READ_VIN
Definition: pmbus.h:114
@ sensor_dev_mp5990
Definition: sensor.h:125
@ sensor_dev_tmp75
Definition: sensor.h:118

◆ plat_sensor_config

sensor_cfg plat_sensor_config[]

◆ SENSOR_CONFIG_SIZE

const int SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_sensor_config)

◆ vr_page_mutex

struct k_mutex vr_page_mutex