OpenBIC
OpenSource Bridge-IC
plat_sensor_table.c File Reference
#include "plat_sensor_table.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <logging/log.h>
#include "libutil.h"
#include "ast_adc.h"
#include "sensor.h"
#include "hal_gpio.h"
#include "plat_i2c.h"
#include "plat_gpio.h"
#include "plat_hook.h"
#include "plat_class.h"
#include "pmbus.h"
#include "sq52205.h"
#include "power_status.h"
#include "emc1412.h"
#include "ltc2991.h"
#include "i2c-mux-pca984x.h"
#include "plat_ipmi.h"
#include "plat_dev.h"
#include "cci.h"
#include "plat_mctp.h"
Include dependency graph for plat_sensor_table.c:

Macros

#define E1S_13_14_MUX_BUS   I2C_BUS4
 
#define E1S_0_SENSOR_CFG_INDEX   0
 
#define E1S_1_SENSOR_CFG_INDEX   1
 
#define CARD_13_E1S_0_MUX_CFG_INDEX   4
 
#define CARD_13_E1S_1_MUX_CFG_INDEX   5
 
#define CARD_14_E1S_0_MUX_CFG_INDEX   6
 
#define CARD_14_E1S_1_MUX_CFG_INDEX   7
 
#define PCIE_CARD_INIT_CFG_OFFSET_0   0
 
#define PCIE_CARD_INIT_CFG_OFFSET_1   1
 
#define DELAYED_INIT_SENSOR_RETRY_MAX   5
 
#define COMMON_SENSOR_MONITOR_INDEX   0
 

Functions

 LOG_MODULE_REGISTER (plat_sensor_table)
 
void pal_extend_sensor_config ()
 
void load_sensor_config (void)
 
uint8_t pal_get_extend_sensor_config ()
 
uint8_t pal_get_monitor_sensor_count ()
 
void plat_fill_monitor_sensor_table ()
 
sensor_cfgget_common_sensor_cfg_info (uint8_t sensor_num)
 
sensor_cfgget_cxl_sensor_cfg_info (uint8_t cxl_id, uint8_t *cfg_count)
 
bool is_dc_access (uint8_t sensor_num)
 
bool is_e1s_access (uint8_t sensor_num)
 
bool is_cxl_access (uint8_t cxl_id)
 
struct k_mutex * get_i2c_mux_mutex (uint8_t i2c_bus)
 
bool get_pcie_card_mux_config (uint8_t cxl_id, uint8_t sensor_num, mux_config *card_mux_cfg, mux_config *cxl_mux_cfg)
 
bool is_time_to_poll_card_sensor (uint8_t pcie_card_id)
 

Variables

struct k_mutex i2c_2_pca9548a_mutex
 
struct k_mutex i2c_3_pca9546a_mutex
 
struct k_mutex i2c_4_pca9548a_mutex
 
struct k_mutex i2c_8_pca9548a_mutex
 
sensor_cfg plat_sensor_config []
 
sensor_cfg plat_mc_sq52205_sensor_config []
 
sensor_cfg plat_mc_ina233_sensor_config []
 
sensor_cfg plat_hsc_mp5990_sensor_config []
 
sensor_cfg plat_cxl1_sensor_config []
 
sensor_cfg plat_cxl2_sensor_config []
 
sensor_cfg plat_cxl3_sensor_config []
 
sensor_cfg plat_cxl4_sensor_config []
 
sensor_cfg plat_cxl5_sensor_config []
 
sensor_cfg plat_cxl6_sensor_config []
 
sensor_cfg plat_cxl7_sensor_config []
 
sensor_cfg plat_cxl8_sensor_config []
 
sensor_cfg evt2_extend_sensor_config []
 
const int SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_sensor_config)
 
const int MC_SQ52205_SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_mc_sq52205_sensor_config)
 
const int MC_INA233_SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_mc_ina233_sensor_config)
 
const int CXL_SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_cxl1_sensor_config)
 
const int HSC_SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_hsc_mp5990_sensor_config)
 
const int EVT2_EXTEND_SENSOR_CONFIG_SIZE = ARRAY_SIZE(evt2_extend_sensor_config)
 
sensor_monitor_table_info plat_monitor_table []
 
sensor_poll_delay_cfg sensor_poll_delay_cfgs []
 
bool pcie_card_init_status []
 

Macro Definition Documentation

◆ CARD_13_E1S_0_MUX_CFG_INDEX

#define CARD_13_E1S_0_MUX_CFG_INDEX   4

◆ CARD_13_E1S_1_MUX_CFG_INDEX

#define CARD_13_E1S_1_MUX_CFG_INDEX   5

◆ CARD_14_E1S_0_MUX_CFG_INDEX

#define CARD_14_E1S_0_MUX_CFG_INDEX   6

◆ CARD_14_E1S_1_MUX_CFG_INDEX

#define CARD_14_E1S_1_MUX_CFG_INDEX   7

◆ COMMON_SENSOR_MONITOR_INDEX

#define COMMON_SENSOR_MONITOR_INDEX   0

◆ DELAYED_INIT_SENSOR_RETRY_MAX

#define DELAYED_INIT_SENSOR_RETRY_MAX   5

◆ E1S_0_SENSOR_CFG_INDEX

#define E1S_0_SENSOR_CFG_INDEX   0

◆ E1S_13_14_MUX_BUS

#define E1S_13_14_MUX_BUS   I2C_BUS4

◆ E1S_1_SENSOR_CFG_INDEX

#define E1S_1_SENSOR_CFG_INDEX   1

◆ PCIE_CARD_INIT_CFG_OFFSET_0

#define PCIE_CARD_INIT_CFG_OFFSET_0   0

◆ PCIE_CARD_INIT_CFG_OFFSET_1

#define PCIE_CARD_INIT_CFG_OFFSET_1   1

Function Documentation

◆ get_common_sensor_cfg_info()

sensor_cfg * get_common_sensor_cfg_info ( uint8_t  sensor_num)
Here is the call graph for this function:

◆ get_cxl_sensor_cfg_info()

sensor_cfg * get_cxl_sensor_cfg_info ( uint8_t  cxl_id,
uint8_t *  cfg_count 
)

◆ get_i2c_mux_mutex()

struct k_mutex * get_i2c_mux_mutex ( uint8_t  i2c_bus)

◆ get_pcie_card_mux_config()

bool get_pcie_card_mux_config ( uint8_t  cxl_id,
uint8_t  sensor_num,
mux_config card_mux_cfg,
mux_config cxl_mux_cfg 
)
Here is the call graph for this function:

◆ is_cxl_access()

bool is_cxl_access ( uint8_t  cxl_id)

◆ is_dc_access()

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

◆ is_e1s_access()

bool is_e1s_access ( uint8_t  sensor_num)

◆ is_time_to_poll_card_sensor()

bool is_time_to_poll_card_sensor ( uint8_t  pcie_card_id)
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  )
Here is the call graph for this function:

◆ pal_get_extend_sensor_config()

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

◆ pal_get_monitor_sensor_count()

uint8_t pal_get_monitor_sensor_count ( )

◆ plat_fill_monitor_sensor_table()

void plat_fill_monitor_sensor_table ( )

Variable Documentation

◆ CXL_SENSOR_CONFIG_SIZE

const int CXL_SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_cxl1_sensor_config)

◆ evt2_extend_sensor_config

sensor_cfg evt2_extend_sensor_config[]
Initial value:
= {
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, NULL },
}
#define I2C_BUS1
Definition: plat_i2c.h:24
#define TMP75_TEMP_OFFSET
Definition: plat_sensor_table.h:70
#define TMP75_OUT_ADDR
Definition: plat_sensor_table.h:28
#define SENSOR_NUM_TEMP_TMP75_OUT
Definition: plat_sensor_table.h:41
@ SENSOR_INIT_STATUS
Definition: sensor.h:240
@ ENABLE_SENSOR_POLLING
Definition: sensor.h:196
#define POLL_TIME_DEFAULT
Definition: sensor.h:48
@ sensor_dev_tmp75
Definition: sensor.h:118
#define SAMPLE_COUNT_DEFAULT
Definition: sensor.h:46
bool stby_access(uint8_t sensor_number)
Definition: sensor.c:1111

◆ EVT2_EXTEND_SENSOR_CONFIG_SIZE

const int EVT2_EXTEND_SENSOR_CONFIG_SIZE = ARRAY_SIZE(evt2_extend_sensor_config)

◆ HSC_SENSOR_CONFIG_SIZE

const int HSC_SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_hsc_mp5990_sensor_config)

◆ i2c_2_pca9548a_mutex

struct k_mutex i2c_2_pca9548a_mutex

◆ i2c_3_pca9546a_mutex

struct k_mutex i2c_3_pca9546a_mutex

◆ i2c_4_pca9548a_mutex

struct k_mutex i2c_4_pca9548a_mutex

◆ i2c_8_pca9548a_mutex

struct k_mutex i2c_8_pca9548a_mutex

◆ MC_INA233_SENSOR_CONFIG_SIZE

const int MC_INA233_SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_mc_ina233_sensor_config)

◆ MC_SQ52205_SENSOR_CONFIG_SIZE

const int MC_SQ52205_SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_mc_sq52205_sensor_config)

◆ pcie_card_init_status

bool pcie_card_init_status[]
Initial value:
= { false, false, false, false, false, false, false,
false, false, false, false, false, false, false }

◆ plat_cxl1_sensor_config

sensor_cfg plat_cxl1_sensor_config[]

◆ plat_cxl2_sensor_config

sensor_cfg plat_cxl2_sensor_config[]

◆ plat_cxl3_sensor_config

sensor_cfg plat_cxl3_sensor_config[]

◆ plat_cxl4_sensor_config

sensor_cfg plat_cxl4_sensor_config[]

◆ plat_cxl5_sensor_config

sensor_cfg plat_cxl5_sensor_config[]

◆ plat_cxl6_sensor_config

sensor_cfg plat_cxl6_sensor_config[]

◆ plat_cxl7_sensor_config

sensor_cfg plat_cxl7_sensor_config[]

◆ plat_cxl8_sensor_config

sensor_cfg plat_cxl8_sensor_config[]

◆ plat_hsc_mp5990_sensor_config

sensor_cfg plat_hsc_mp5990_sensor_config[]
Initial value:
= {
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] },
}
#define I2C_BUS6
Definition: plat_i2c.h:29
mp5990_init_arg mp5990_init_args[]
Definition: plat_hook.c:46
#define SENSOR_NUM_CUR_P12V_AUX
Definition: plat_sensor_table.h:67
#define SENSOR_NUM_VOL_P12V_AUX
Definition: plat_sensor_table.h:48
#define MPS_MP5990_ADDR
Definition: plat_sensor_table.h:31
#define SENSOR_NUM_PWR_P12V_AUX
Definition: plat_sensor_table.h:83
#define SENSOR_NUM_TEMP_PU4
Definition: plat_sensor_table.h:42
@ PMBUS_READ_IOUT
Definition: pmbus.h:118
@ PMBUS_READ_VOUT
Definition: pmbus.h:117
@ PMBUS_READ_TEMPERATURE_1
Definition: pmbus.h:119
@ PMBUS_READ_PIN
Definition: pmbus.h:129
@ sensor_dev_mp5990
Definition: sensor.h:125

◆ plat_mc_ina233_sensor_config

sensor_cfg plat_mc_ina233_sensor_config[]

◆ plat_mc_sq52205_sensor_config

sensor_cfg plat_mc_sq52205_sensor_config[]

◆ plat_monitor_table

sensor_monitor_table_info plat_monitor_table[]
Initial value:
= {
(void *)&plat_monitor_table_arg[0], "CXL 1 sensor table" },
(void *)&plat_monitor_table_arg[1], "CXL 2 sensor table" },
(void *)&plat_monitor_table_arg[2], "CXL 3 sensor table" },
(void *)&plat_monitor_table_arg[3], "CXL 4 sensor table" },
(void *)&plat_monitor_table_arg[4], "CXL 5 sensor table" },
(void *)&plat_monitor_table_arg[5], "CXL 6 sensor table" },
(void *)&plat_monitor_table_arg[6], "CXL 7 sensor table" },
(void *)&plat_monitor_table_arg[7], "CXL 8 sensor table" },
}
uint8_t plat_monitor_table_arg[]
Definition: plat_hook.c:700
@ CXL_CARD_5
Definition: plat_class.h:72
@ CXL_CARD_7
Definition: plat_class.h:74
@ CXL_CARD_2
Definition: plat_class.h:69
@ CXL_CARD_1
Definition: plat_class.h:68
@ CXL_CARD_8
Definition: plat_class.h:75
@ CXL_CARD_4
Definition: plat_class.h:71
@ CXL_CARD_6
Definition: plat_class.h:73
@ CXL_CARD_3
Definition: plat_class.h:70
bool pre_cxl_switch_mux(uint8_t sensor_num, void *arg)
Definition: plat_hook.c:1127
bool post_cxl_switch_mux(uint8_t sensor_num, void *arg)
Definition: plat_hook.c:1167
sensor_cfg plat_cxl5_sensor_config[]
Definition: plat_sensor_table.c:1124
sensor_cfg plat_cxl3_sensor_config[]
Definition: plat_sensor_table.c:818
sensor_cfg plat_cxl7_sensor_config[]
Definition: plat_sensor_table.c:1430
bool is_cxl_access(uint8_t cxl_id)
Definition: plat_sensor_table.c:1994
sensor_cfg plat_cxl8_sensor_config[]
Definition: plat_sensor_table.c:1583
sensor_cfg plat_cxl4_sensor_config[]
Definition: plat_sensor_table.c:971
sensor_cfg plat_cxl1_sensor_config[]
Definition: plat_sensor_table.c:512
sensor_cfg plat_cxl2_sensor_config[]
Definition: plat_sensor_table.c:665
const int CXL_SENSOR_CONFIG_SIZE
Definition: plat_sensor_table.c:1745
sensor_cfg plat_cxl6_sensor_config[]
Definition: plat_sensor_table.c:1277

◆ plat_sensor_config

sensor_cfg plat_sensor_config[]

◆ SENSOR_CONFIG_SIZE

const int SENSOR_CONFIG_SIZE = ARRAY_SIZE(plat_sensor_config)

◆ sensor_poll_delay_cfgs

sensor_poll_delay_cfg sensor_poll_delay_cfgs[]
Initial value:
= {
}
@ CARD_10_INDEX
Definition: plat_class.h:59
@ CARD_13_INDEX
Definition: plat_class.h:62
@ CARD_8_INDEX
Definition: plat_class.h:57
@ CARD_12_INDEX
Definition: plat_class.h:61
@ CARD_14_INDEX
Definition: plat_class.h:63
@ CARD_5_INDEX
Definition: plat_class.h:54
@ CARD_6_INDEX
Definition: plat_class.h:55
@ CARD_4_INDEX
Definition: plat_class.h:53
@ CARD_11_INDEX
Definition: plat_class.h:60
@ CARD_2_INDEX
Definition: plat_class.h:51
@ CARD_3_INDEX
Definition: plat_class.h:52
@ CARD_1_INDEX
Definition: plat_class.h:50
@ CARD_9_INDEX
Definition: plat_class.h:58
@ CARD_7_INDEX
Definition: plat_class.h:56
#define PCIE_CARD_POWER_GOOD_TIME_DEFAULT
Definition: plat_sensor_table.h:168