OpenBIC
OpenSource Bridge-IC
plat_log.c File Reference
#include <kernel.h>
#include <stdlib.h>
#include <logging/log.h>
#include <libutil.h>
#include "plat_sensor_table.h"
#include "fru.h"
#include "plat_fru.h"
#include "plat_i2c.h"
#include "plat_log.h"
#include "plat_event.h"
#include "plat_hook.h"
#include "plat_class.h"
Include dependency graph for plat_log.c:

Classes

struct  _vr_ubc_device_table_
 
struct  _vr_error_callback_info_
 

Macros

#define LOG_MAX_INDEX   0x0FFF
 
#define LOG_MAX_NUM   100
 
#define AEGIS_FRU_LOG_START   0x0000
 
#define AEGIS_CPLD_REGISTER_START_OFFSET   0x00
 
#define AEGIS_CPLD_REGISTER_MAX_OFFSET   0x3C
 
#define EEPROM_MAX_WRITE_TIME   5
 
#define AEGIS_CPLD_ADDR   (0x4C >> 1)
 
#define I2C_BUS_CPLD   I2C_BUS5
 
#define AEGIS_CPLD_VR_VENDOR_TYPE_REG   0x1C
 

Typedefs

typedef struct _vr_ubc_device_table_ vr_ubc_device_table
 
typedef struct _vr_error_callback_info_ vr_error_callback_info
 

Enumerations

enum  VR_UBC_INDEX_E {
  UBC_1 = 1 , UBC_2 , VR_1 , VR_2 ,
  VR_3 , VR_4 , VR_5 , VR_6 ,
  VR_7 , VR_8 , VR_9 , VR_10 ,
  VR_11 , VR_MAX
}
 

Functions

 LOG_MODULE_REGISTER (plat_log)
 
void plat_log_read (uint8_t *log_data, uint8_t cmd_size, uint16_t order)
 
void plat_clear_log ()
 
bool plat_dump_cpld (uint8_t offset, uint8_t length, uint8_t *data)
 
bool get_vr_status_word (uint8_t bus, uint8_t addr, uint8_t *vr_status_word)
 
bool vr_fault_get_error_data (uint8_t sensor_id, uint8_t device_id, uint8_t *data)
 
bool get_error_data (uint16_t error_code, uint8_t *data)
 
void error_log_event (uint16_t error_code, bool log_status)
 
uint8_t plat_log_get_num (void)
 
void find_last_log_position ()
 
void init_load_eeprom_log (void)
 

Variables

vr_ubc_device_table vr_device_table []
 
vr_error_callback_info vr_error_callback_info_table []
 

Macro Definition Documentation

◆ AEGIS_CPLD_ADDR

#define AEGIS_CPLD_ADDR   (0x4C >> 1)

◆ AEGIS_CPLD_REGISTER_MAX_OFFSET

#define AEGIS_CPLD_REGISTER_MAX_OFFSET   0x3C

◆ AEGIS_CPLD_REGISTER_START_OFFSET

#define AEGIS_CPLD_REGISTER_START_OFFSET   0x00

◆ AEGIS_CPLD_VR_VENDOR_TYPE_REG

#define AEGIS_CPLD_VR_VENDOR_TYPE_REG   0x1C

◆ AEGIS_FRU_LOG_START

#define AEGIS_FRU_LOG_START   0x0000

◆ EEPROM_MAX_WRITE_TIME

#define EEPROM_MAX_WRITE_TIME   5

◆ I2C_BUS_CPLD

#define I2C_BUS_CPLD   I2C_BUS5

◆ LOG_MAX_INDEX

#define LOG_MAX_INDEX   0x0FFF

◆ LOG_MAX_NUM

#define LOG_MAX_NUM   100

Typedef Documentation

◆ vr_error_callback_info

◆ vr_ubc_device_table

Enumeration Type Documentation

◆ VR_UBC_INDEX_E

Enumerator
UBC_1 
UBC_2 
VR_1 
VR_2 
VR_3 
VR_4 
VR_5 
VR_6 
VR_7 
VR_8 
VR_9 
VR_10 
VR_11 
VR_MAX 

Function Documentation

◆ error_log_event()

void error_log_event ( uint16_t  error_code,
bool  log_status 
)

◆ find_last_log_position()

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

◆ get_error_data()

bool get_error_data ( uint16_t  error_code,
uint8_t *  data 
)
Here is the call graph for this function:

◆ get_vr_status_word()

bool get_vr_status_word ( uint8_t  bus,
uint8_t  addr,
uint8_t *  vr_status_word 
)
Here is the call graph for this function:

◆ init_load_eeprom_log()

void init_load_eeprom_log ( void  )

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_log  )

◆ plat_clear_log()

void plat_clear_log ( )

◆ plat_dump_cpld()

bool plat_dump_cpld ( uint8_t  offset,
uint8_t  length,
uint8_t *  data 
)
Here is the call graph for this function:

◆ plat_log_get_num()

uint8_t plat_log_get_num ( void  )

◆ plat_log_read()

void plat_log_read ( uint8_t *  log_data,
uint8_t  cmd_size,
uint16_t  order 
)

◆ vr_fault_get_error_data()

bool vr_fault_get_error_data ( uint8_t  sensor_id,
uint8_t  device_id,
uint8_t *  data 
)
Here is the call graph for this function:

Variable Documentation

◆ vr_device_table

vr_ubc_device_table vr_device_table[]
Initial value:
= {
}
@ VR_1
Definition: plat_log.c:51
@ VR_8
Definition: plat_log.c:58
@ VR_7
Definition: plat_log.c:57
@ VR_11
Definition: plat_log.c:61
@ VR_6
Definition: plat_log.c:56
@ VR_9
Definition: plat_log.c:59
@ VR_5
Definition: plat_log.c:55
@ VR_3
Definition: plat_log.c:53
@ UBC_2
Definition: plat_log.c:50
@ VR_2
Definition: plat_log.c:52
@ VR_4
Definition: plat_log.c:54
@ UBC_1
Definition: plat_log.c:49
@ VR_10
Definition: plat_log.c:60
#define SENSOR_NUM_CPU_P0V8_VDDA_PCIE_TEMP_C
Definition: plat_pldm_sensor.h:210
#define SENSOR_NUM_CPU_P0V9_TRVDD_ZONEA_TEMP_C
Definition: plat_pldm_sensor.h:183
#define SENSOR_NUM_CPU_P0V75_VDDPHY_HBM0_2_4_TEMP_C
Definition: plat_pldm_sensor.h:178
#define SENSOR_NUM_CPU_P0V9_TRVDD_ZONEB_TEMP_C
Definition: plat_pldm_sensor.h:192
#define SENSOR_NUM_CPU_P1V8_VPP_HBM0_2_4_TEMP_C
Definition: plat_pldm_sensor.h:160
#define SENSOR_NUM_CPU_P1V1_VDDC_HBM1_3_5_TEMP_C
Definition: plat_pldm_sensor.h:201
#define SENSOR_NUM_CPU_P0V75_MAX_PHY_N_TEMP_C
Definition: plat_pldm_sensor.h:142
#define SENSOR_NUM_CPU_P0V75_TRVDD_ZONEA_TEMP_C
Definition: plat_pldm_sensor.h:156
#define SENSOR_NUM_OSFP_P3V3_TEMP_C
Definition: plat_pldm_sensor.h:128
#define SENSOR_NUM_UBC_2_TEMP_C
Definition: plat_pldm_sensor.h:113
#define SENSOR_NUM_UBC_1_TEMP_C
Definition: plat_pldm_sensor.h:107
#define SENSOR_NUM_CPU_P0V75_MAX_PHY_S_TEMP_C
Definition: plat_pldm_sensor.h:151
#define SENSOR_NUM_CPU_P0V4_VDDQL_HBM1_3_5_TEMP_C
Definition: plat_pldm_sensor.h:196
#define SENSOR_NUM_CPU_P0V75_PVDD_CH_N_TEMP_C
Definition: plat_pldm_sensor.h:138
#define SENSOR_NUM_CPU_P1V1_VDDC_HBM0_2_4_TEMP_C
Definition: plat_pldm_sensor.h:174
#define SENSOR_NUM_CPU_P0V75_TRVDD_ZONEB_TEMP_C
Definition: plat_pldm_sensor.h:165
#define SENSOR_NUM_CPU_P0V4_VDDQL_HBM0_2_4_TEMP_C
Definition: plat_pldm_sensor.h:169
#define SENSOR_NUM_CPU_P1V2_VDDHTX_PCIE_TEMP_C
Definition: plat_pldm_sensor.h:214
#define SENSOR_NUM_CPU_P1V8_VPP_HBM1_3_5_TEMP_C
Definition: plat_pldm_sensor.h:187
#define SENSOR_NUM_CPU_P0V75_VDDPHY_HBM1_3_5_TEMP_C
Definition: plat_pldm_sensor.h:205
#define SENSOR_NUM_CPU_P0V85_PVDD_TEMP_C
Definition: plat_pldm_sensor.h:133
#define SENSOR_NUM_CPU_P0V75_PVDD_CH_S_TEMP_C
Definition: plat_pldm_sensor.h:147

◆ vr_error_callback_info_table

vr_error_callback_info vr_error_callback_info_table[]
Initial value:
= {
{ VR_POWER_FAULT_1_REG, 0x7E, { 0x00, VR_5, VR_6, UBC_2, UBC_1, VR_4, VR_3, 0x00 } },
{ VR_POWER_FAULT_2_REG, 0xDF, { VR_10, VR_7, VR_8, VR_5, VR_11, 0x00, VR_8, VR_9 } },
{ VR_POWER_FAULT_3_REG, 0xD7, { VR_4, VR_3, VR_10, 0x00, VR_7, 0x00, VR_9, VR_6 } },
{ VR_POWER_FAULT_4_REG, 0x80, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, VR_2 } },
{ VR_POWER_FAULT_5_REG, 0x48, { 0x00, 0x00, 0x00, VR_1, 0x00, 0x00, VR_11, 0x00 } },
{ VR_SMBUS_ALERT_2_REG, 0xF8, { 0x00, 0x00, 0x00, VR_11, VR_5, VR_6, UBC_1, UBC_2 } },
{ ASIC_OC_WARN_REG, 0x00, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ SYSTEM_ALERT_FAULT_REG, 0x00, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ VR_HOT_FAULT_2_REG, 0xC0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, VR_11, VR_1 } },
{ TEMPERATURE_IC_OVERT_FAULT_REG, 0x00, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
{ VR_POWER_INPUT_FAULT_2_REG, 0xC0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, VR_11, VR_1 } },
{ LEAK_DETCTION_REG, 0x00, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
}
#define VR_POWER_FAULT_5_REG
Definition: plat_event.h:39
#define VR_POWER_INPUT_FAULT_1_REG
Definition: plat_event.h:66
#define VR_POWER_FAULT_4_REG
Definition: plat_event.h:38
#define VR_POWER_FAULT_1_REG
Definition: plat_event.h:35
#define VR_POWER_INPUT_FAULT_2_REG
Definition: plat_event.h:67
#define VR_SMBUS_ALERT_2_REG
Definition: plat_event.h:59
#define VR_POWER_FAULT_2_REG
Definition: plat_event.h:36
#define VR_SMBUS_ALERT_1_REG
Definition: plat_event.h:58
#define SYSTEM_ALERT_FAULT_REG
Definition: plat_event.h:62
#define VR_HOT_FAULT_1_REG
Definition: plat_event.h:63
#define ASIC_OC_WARN_REG
Definition: plat_event.h:61
#define VR_POWER_FAULT_3_REG
Definition: plat_event.h:37
#define VR_HOT_FAULT_2_REG
Definition: plat_event.h:64
#define LEAK_DETCTION_REG
Definition: plat_event.h:68
#define TEMPERATURE_IC_OVERT_FAULT_REG
Definition: plat_event.h:65