OpenBIC
OpenSource Bridge-IC
plat_thermal.c File Reference
#include "plat_event.h"
#include <logging/log.h>
#include "plat_thermal.h"
#include "tmp431.h"
#include "emc1413.h"
#include "sensor.h"
#include "plat_log.h"
#include "plat_user_setting.h"
#include "plat_util.h"
#include "plat_i2c.h"
#include "plat_pldm_sensor.h"
#include "plat_led.h"
#include "plat_cpld.h"
Include dependency graph for plat_thermal.c:

Classes

struct  temp_mapping_sensor_t
 

Macros

#define TMP_HIGH_LIMIT_STATUS_REG   0x35
 

Typedefs

typedef struct temp_mapping_sensor_t temp_mapping_sensor_t
 

Functions

 LOG_MODULE_REGISTER (plat_thermal)
 
 K_KERNEL_STACK_MEMBER (check_thermal_thread_stack, 1024)
 
uint8_t get_thermal_status_val_for_log (uint8_t sensor_num)
 
uint8_t get_thermal_limit_status_val_for_log (uint8_t sensor_num)
 
bool plat_clear_temp_status (uint8_t rail)
 
bool plat_get_temp_status (uint8_t rail, uint8_t *temp_status)
 
void check_thermal_handler (void *arg1, void *arg2, void *arg3)
 
void init_thermal_polling (void)
 

Variables

struct k_thread check_thermal_thread
 
k_tid_t thermal_tid
 
bool handler_flag = true
 
const char * temperature_name_table []
 
temp_mapping_sensor_t temp_alert_index_table []
 
temp_mapping_sensor temp_index_table []
 

Macro Definition Documentation

◆ TMP_HIGH_LIMIT_STATUS_REG

#define TMP_HIGH_LIMIT_STATUS_REG   0x35

Typedef Documentation

◆ temp_mapping_sensor_t

Function Documentation

◆ check_thermal_handler()

void check_thermal_handler ( void *  arg1,
void *  arg2,
void *  arg3 
)
Here is the call graph for this function:

◆ get_thermal_limit_status_val_for_log()

uint8_t get_thermal_limit_status_val_for_log ( uint8_t  sensor_num)

◆ get_thermal_status_val_for_log()

uint8_t get_thermal_status_val_for_log ( uint8_t  sensor_num)

◆ init_thermal_polling()

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

◆ K_KERNEL_STACK_MEMBER()

K_KERNEL_STACK_MEMBER ( check_thermal_thread_stack  ,
1024   
)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_thermal  )

◆ plat_clear_temp_status()

bool plat_clear_temp_status ( uint8_t  rail)
Here is the call graph for this function:

◆ plat_get_temp_status()

bool plat_get_temp_status ( uint8_t  rail,
uint8_t *  temp_status 
)
Here is the call graph for this function:

Variable Documentation

◆ check_thermal_thread

struct k_thread check_thermal_thread

◆ handler_flag

bool handler_flag = true

◆ temp_alert_index_table

temp_mapping_sensor_t temp_alert_index_table[]
Initial value:
= {
"SB_EL_ASIC_NUWA0_SENSOR0_TEMP", 0, false },
"SB_EL_ASIC_NUWA0_SENSOR1_TEMP", 0, false },
{ TEMP_INDEX_ASIC_OWL_W, SENSOR_NUM_ASIC_OWL_W_TEMP_C, "SB_EL_ASIC_OWL_W_TEMP", 0,
false },
{ TEMP_INDEX_ASIC_OWL_E, SENSOR_NUM_ASIC_OWL_E_TEMP_C, "SB_EL_ASIC_OWL_E_TEMP", 0,
false },
"SB_EL_ASIC_NUWA1_SENSOR0_TEMP", 0, false },
"SB_EL_ASIC_NUWA1_SENSOR1_TEMP", 0, false },
"SB_EL_ASIC_HAMSA_CRM_TEMP", 0, false },
"SB_EL_ASIC_HAMSA_LS_TEMP", 0, false },
}
@ SENSOR_NUM_ASIC_NUWA0_SENSOR1_TEMP_C
Definition: plat_pldm_sensor.h:153
@ SENSOR_NUM_ASIC_NUWA1_SENSOR0_TEMP_C
Definition: plat_pldm_sensor.h:156
@ SENSOR_NUM_ASIC_OWL_E_TEMP_C
Definition: plat_pldm_sensor.h:155
@ SENSOR_NUM_ASIC_HAMSA_LS_TEMP_C
Definition: plat_pldm_sensor.h:159
@ SENSOR_NUM_ASIC_NUWA1_SENSOR1_TEMP_C
Definition: plat_pldm_sensor.h:157
@ SENSOR_NUM_ASIC_HAMSA_CRM_TEMP_C
Definition: plat_pldm_sensor.h:158
@ SENSOR_NUM_ASIC_OWL_W_TEMP_C
Definition: plat_pldm_sensor.h:154
@ SENSOR_NUM_ASIC_NUWA0_SENSOR0_TEMP_C
Definition: plat_pldm_sensor.h:152
@ TEMP_INDEX_ASIC_NUWA0_SENSOR0
Definition: plat_user_setting.h:43
@ TEMP_INDEX_ASIC_HAMSA_CRM
Definition: plat_user_setting.h:49
@ TEMP_INDEX_ASIC_OWL_E
Definition: plat_user_setting.h:46
@ TEMP_INDEX_ASIC_HAMSA_LS
Definition: plat_user_setting.h:50
@ TEMP_INDEX_ASIC_OWL_W
Definition: plat_user_setting.h:45
@ TEMP_INDEX_ASIC_NUWA1_SENSOR1
Definition: plat_user_setting.h:48
@ TEMP_INDEX_ASIC_NUWA1_SENSOR0
Definition: plat_user_setting.h:47
@ TEMP_INDEX_ASIC_NUWA0_SENSOR1
Definition: plat_user_setting.h:44

◆ temp_index_table

temp_mapping_sensor temp_index_table[]
Initial value:
= {
{ TEMP_INDEX_TOP_INLET, SENSOR_NUM_TOP_INLET_TEMP_C, "SB_EL_TOP_INLET_TEMP" },
{ TEMP_INDEX_BOT_INLET, SENSOR_NUM_BOT_INLET_TEMP_C, "SB_EL_BOT_INLET_TEMP" },
{ TEMP_INDEX_BOT_OUTLET, SENSOR_NUM_BOT_OUTLET_TEMP_C, "SB_EL_BOT_OUTLET_TEMP" },
"SB_EL_ASIC_NUWA0_SENSOR0_TEMP" },
"SB_EL_ASIC_NUWA0_SENSOR1_TEMP" },
{ TEMP_INDEX_ASIC_OWL_W, SENSOR_NUM_ASIC_OWL_W_TEMP_C, "SB_EL_ASIC_OWL_W_TEMP" },
{ TEMP_INDEX_ASIC_OWL_E, SENSOR_NUM_ASIC_OWL_E_TEMP_C, "SB_EL_ASIC_OWL_E_TEMP" },
"SB_EL_ASIC_NUWA1_SENSOR0_TEMP" },
"SB_EL_ASIC_NUWA1_SENSOR1_TEMP" },
"SB_EL_ASIC_HAMSA_CRM_TEMP" },
}
@ TEMP_INDEX_BOT_OUTLET
Definition: plat_hook.h:93
@ TEMP_INDEX_BOT_INLET
Definition: plat_hook.h:92
@ TEMP_INDEX_TOP_INLET
Definition: plat_hook.h:90
@ SENSOR_NUM_TOP_INLET_TEMP_C
Definition: plat_pldm_sensor.h:149
@ SENSOR_NUM_BOT_INLET_TEMP_C
Definition: plat_pldm_sensor.h:150
@ SENSOR_NUM_BOT_OUTLET_TEMP_C
Definition: plat_pldm_sensor.h:151

◆ temperature_name_table

const char* temperature_name_table[]
Initial value:
= {
"ASIC_MEDHA0_SENSOR0", "ASIC_MEDHA0_SENSOR1", "ASIC_OWL_W", "ASIC_OWL_E",
"ASIC_MEDHA1_SENSOR0", "ASIC_MEDHA1_SENSOR1", "ASIC_HAMSA_CRM", "ASIC_HAMSA_LS",
}

◆ thermal_tid

k_tid_t thermal_tid