OpenBIC
OpenSource Bridge-IC
plat_sensor_table.c File Reference
#include "plat_sensor_table.h"
#include <stdio.h>
#include <string.h>
#include "plat_i2c.h"
#include "ast_adc.h"
#include "plat_hook.h"
#include "plat_class.h"
#include "plat_modbus.h"
#include "plat_util.h"
#include "modbus_server.h"
#include "plat_isr.h"
#include "plat_threshold.h"
#include <logging/log.h>
Include dependency graph for plat_sensor_table.c:

Macros

#define I2C_MAX_RETRY   3
 
#define SIZEOF_NCT7363_INIT_ARGS   18
 
#define HSC_CONFIG_FB   0x00
 
#define HSC_CONFIG_BPB   0x01
 
#define HSC_CONFIG_BB   0x02
 
#define HSC_CONFIG_PB   0x03
 
#define ADM1272_MFR_ID   0x494441
 
#define XDP710_MFR_ID   0x034946
 
#define XDP710_FB_ADDR_DVT   (0x2A >> 1)
 
#define XDP710_BPB_ADDR_DVT   (0x28 >> 1)
 
#define XDP710_PB_ADDR   (0x2C >> 1)
 
#define XDP710_BB_ADDR   (0x2E >> 1)
 
#define TMP461_MFR_ID_OFFSET   0xFE
 
#define NCT214_MFR_ID_OFFSET   0xFE
 
#define TMP461_MFR_ID   0x55
 
#define NCT214_MFR_ID   0x41
 
#define E50SN12051_MFR_ID   0x0644
 
#define BMR4922302_803_MFR_ID   0x0c46
 

Functions

 LOG_MODULE_REGISTER (plat_sensor_table)
 
 K_KERNEL_STACK_MEMBER (quick_sensor_poll_stack, 1024)
 
void quick_sensor_poll_handler (void *arug0, void *arug1, void *arug2)
 
void quick_sensor_poll_init ()
 
bool post_quick_sensor_read (sensor_cfg *cfg, void *args, int *reading)
 
void load_hsc_sensor_config ()
 
void load_sb_temp_sensor_with_main_and_2nd_config ()
 
void load_sb_temp_sensor_config ()
 
void load_plat_def_sensor_config ()
 
void load_sensor_config (void)
 
uint16_t get_sensor_reading_to_modbus_val (uint8_t sensor_num, int8_t exp, int8_t scale)
 
uint8_t get_sensor_reading_to_real_val (uint8_t sensor_num, float *val)
 
bool switch_sensor_mux (sensor_cfg *cfg)
 
uint8_t plat_def_sensor_init (sensor_cfg *cfg)
 

Variables

struct k_thread quick_sensor_poll
 
k_tid_t quick_sensor_tid
 
uint8_t quick_sensor []
 
sensor_cfg plat_sensor_config []
 
sensor_cfg hsc_sensor_config_table []
 
sensor_cfg tmp461_config_table []
 
sensor_cfg nct214_config_table []
 
sensor_cfg plat_def_sensor_config []
 
const int SENSOR_CONFIG_SIZE
 

Macro Definition Documentation

◆ ADM1272_MFR_ID

#define ADM1272_MFR_ID   0x494441

◆ BMR4922302_803_MFR_ID

#define BMR4922302_803_MFR_ID   0x0c46

◆ E50SN12051_MFR_ID

#define E50SN12051_MFR_ID   0x0644

◆ HSC_CONFIG_BB

#define HSC_CONFIG_BB   0x02

◆ HSC_CONFIG_BPB

#define HSC_CONFIG_BPB   0x01

◆ HSC_CONFIG_FB

#define HSC_CONFIG_FB   0x00

◆ HSC_CONFIG_PB

#define HSC_CONFIG_PB   0x03

◆ I2C_MAX_RETRY

#define I2C_MAX_RETRY   3

◆ NCT214_MFR_ID

#define NCT214_MFR_ID   0x41

◆ NCT214_MFR_ID_OFFSET

#define NCT214_MFR_ID_OFFSET   0xFE

◆ SIZEOF_NCT7363_INIT_ARGS

#define SIZEOF_NCT7363_INIT_ARGS   18

◆ TMP461_MFR_ID

#define TMP461_MFR_ID   0x55

◆ TMP461_MFR_ID_OFFSET

#define TMP461_MFR_ID_OFFSET   0xFE

◆ XDP710_BB_ADDR

#define XDP710_BB_ADDR   (0x2E >> 1)

◆ XDP710_BPB_ADDR_DVT

#define XDP710_BPB_ADDR_DVT   (0x28 >> 1)

◆ XDP710_FB_ADDR_DVT

#define XDP710_FB_ADDR_DVT   (0x2A >> 1)

◆ XDP710_MFR_ID

#define XDP710_MFR_ID   0x034946

◆ XDP710_PB_ADDR

#define XDP710_PB_ADDR   (0x2C >> 1)

Function Documentation

◆ get_sensor_reading_to_modbus_val()

uint16_t get_sensor_reading_to_modbus_val ( uint8_t  sensor_num,
int8_t  exp,
int8_t  scale 
)
Here is the call graph for this function:

◆ get_sensor_reading_to_real_val()

uint8_t get_sensor_reading_to_real_val ( uint8_t  sensor_num,
float *  val 
)
Here is the call graph for this function:

◆ K_KERNEL_STACK_MEMBER()

K_KERNEL_STACK_MEMBER ( quick_sensor_poll_stack  ,
1024   
)

◆ load_hsc_sensor_config()

void load_hsc_sensor_config ( )

◆ load_plat_def_sensor_config()

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

◆ load_sb_temp_sensor_config()

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

◆ load_sb_temp_sensor_with_main_and_2nd_config()

void load_sb_temp_sensor_with_main_and_2nd_config ( )

◆ load_sensor_config()

void load_sensor_config ( void  )

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_sensor_table  )

◆ plat_def_sensor_init()

uint8_t plat_def_sensor_init ( sensor_cfg cfg)

◆ post_quick_sensor_read()

bool post_quick_sensor_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)
Here is the call graph for this function:

◆ quick_sensor_poll_handler()

void quick_sensor_poll_handler ( void *  arug0,
void *  arug1,
void *  arug2 
)
Here is the call graph for this function:

◆ quick_sensor_poll_init()

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

◆ switch_sensor_mux()

bool switch_sensor_mux ( sensor_cfg cfg)

Variable Documentation

◆ hsc_sensor_config_table

sensor_cfg hsc_sensor_config_table[]

◆ nct214_config_table

sensor_cfg nct214_config_table[]
Initial value:
= {
}
bool pre_PCA9546A_read(sensor_cfg *cfg, void *args)
Definition: plat_hook.c:933
bool post_PCA9546A_read(sensor_cfg *cfg, void *args, int *reading)
Definition: plat_hook.c:960
mux_config bus_9_PCA9546A_configs[]
Definition: plat_hook.c:896
nct214_init_arg nct214_init_args[]
Definition: plat_hook.c:767
#define I2C_BUS9
Definition: plat_i2c.h:32
#define SB_NCT214_4_ADDR
Definition: plat_sensor_table.h:60
#define SB_NCT214_3_ADDR
Definition: plat_sensor_table.h:59
#define SENSOR_NUM_SB_HEX_AIR_INLET_4_TEMP_C
Definition: plat_sensor_table.h:209
#define SENSOR_NUM_SB_HEX_AIR_INLET_1_TEMP_C
Definition: plat_sensor_table.h:206
#define SENSOR_NUM_SB_HEX_AIR_INLET_2_TEMP_C
Definition: plat_sensor_table.h:207
#define SB_NCT214_1_ADDR
Definition: plat_sensor_table.h:57
#define SENSOR_NUM_SB_HEX_AIR_INLET_3_TEMP_C
Definition: plat_sensor_table.h:208
#define SB_NCT214_2_ADDR
Definition: plat_sensor_table.h:58
@ NCT214_REMOTE_TEMPERATRUE
Definition: nct214.h:33
@ ENABLE_SENSOR_POLLING
Definition: sensor.h:197
@ SENSOR_INIT_STATUS
Definition: sensor.h:241
#define POLL_TIME_DEFAULT
Definition: sensor.h:48
@ sensor_dev_nct214
Definition: sensor.h:172
#define SAMPLE_COUNT_DEFAULT
Definition: sensor.h:46
bool stby_access(uint8_t sensor_number)
Definition: sensor.c:1119

◆ plat_def_sensor_config

sensor_cfg plat_def_sensor_config[]
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, NULL },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, NULL },
NULL },
SENSOR_INIT_STATUS, NULL, NULL, NULL, NULL, NULL },
NULL },
NULL },
}
#define SENSOR_NUM_COOLING_CAPACITY
Definition: plat_sensor_table.h:255
#define SENSOR_NUM_RPU_PWR_W
Definition: plat_sensor_table.h:248
#define SENSOR_NUM_FAN_PRSNT
Definition: plat_sensor_table.h:253
@ PLAT_DEF_SENSOR_TOTAL_PWR
Definition: plat_sensor_table.h:28
@ PLAT_DEF_SENSOR_FAN_PRSNT
Definition: plat_sensor_table.h:31
@ PLAT_DEF_SENSOR_COOLING_CAPACITY
Definition: plat_sensor_table.h:33
@ PLAT_DEF_SENSOR_SB_HEX_AIR_INLET_AVG_TEMP
Definition: plat_sensor_table.h:32
@ PLAT_DEF_SENSOR_RPU_PWR
Definition: plat_sensor_table.h:26
@ PLAT_DEF_SENSOR_HEX_EXTERNAL_Y_FILTER
Definition: plat_sensor_table.h:30
@ PLAT_DEF_SENSOR_HEX_CURR
Definition: plat_sensor_table.h:29
@ PLAT_DEF_SENSOR_HEX_PWR
Definition: plat_sensor_table.h:27
#define SENSOR_NUM_AALC_TOTAL_PWR_W
Definition: plat_sensor_table.h:250
#define SENSOR_NUM_HEX_PWR_W
Definition: plat_sensor_table.h:249
#define SENSOR_NUM_HEX_EXTERNAL_Y_FILTER
Definition: plat_sensor_table.h:252
#define SENSOR_NUM_SB_HEX_AIR_INLET_AVG_TEMP_C
Definition: plat_sensor_table.h:254
#define SENSOR_NUM_HEX_CURR_A
Definition: plat_sensor_table.h:251
@ sensor_dev_plat_def_sensor
Definition: sensor.h:179

◆ plat_sensor_config

sensor_cfg plat_sensor_config[]

◆ quick_sensor

uint8_t quick_sensor[]
Initial value:
#define SENSOR_NUM_BPB_RACK_COOLANT_LEAKAGE_VOLT_V
Definition: plat_sensor_table.h:235
#define SENSOR_NUM_BPB_CDU_COOLANT_LEAKAGE_VOLT_V
Definition: plat_sensor_table.h:234

◆ quick_sensor_poll

struct k_thread quick_sensor_poll

◆ quick_sensor_tid

k_tid_t quick_sensor_tid

◆ SENSOR_CONFIG_SIZE

const int SENSOR_CONFIG_SIZE
Initial value:
= ARRAY_SIZE(plat_sensor_config) +
ARRAY_SIZE(nct214_config_table) + ARRAY_SIZE(plat_def_sensor_config)
sensor_cfg plat_def_sensor_config[]
Definition: plat_sensor_table.c:825
sensor_cfg nct214_config_table[]
Definition: plat_sensor_table.c:806
sensor_cfg hsc_sensor_config_table[]
Definition: plat_sensor_table.c:482
sensor_cfg plat_sensor_config[]
Definition: plat_sensor_table.c:100

◆ tmp461_config_table

sensor_cfg tmp461_config_table[]
Initial value:
= {
}
#define SB_TMP461_1_ADDR
Definition: plat_sensor_table.h:53
#define SB_TMP461_3_ADDR
Definition: plat_sensor_table.h:55
#define SB_TMP461_2_ADDR
Definition: plat_sensor_table.h:54
#define SB_TMP461_4_ADDR
Definition: plat_sensor_table.h:56
@ sensor_dev_tmp461
Definition: sensor.h:159
@ TMP461_REMOTE_TEMPERATRUE
Definition: tmp461.h:28