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_cpld.h"
#include "plat_hook.h"
#include "plat_class.h"
#include "plat_pldm_sensor.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 FRU_LOG_START   0x0000
 
#define EEPROM_MAX_WRITE_TIME   5
 
#define CPLD_VR_VENDOR_TYPE_REG   0x1C
 
#define ERROR_CODE_TYPE_SHIFT   13
 

Typedefs

typedef struct _vr_ubc_device_table_ vr_ubc_device_table
 
typedef struct _vr_error_callback_info_ vr_error_callback_info
 

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 vr_fault_get_error_data (uint8_t sensor_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)
 
void reset_error_log_event (uint8_t err_type)
 
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

◆ CPLD_VR_VENDOR_TYPE_REG

#define CPLD_VR_VENDOR_TYPE_REG   0x1C

◆ EEPROM_MAX_WRITE_TIME

#define EEPROM_MAX_WRITE_TIME   5

◆ ERROR_CODE_TYPE_SHIFT

#define ERROR_CODE_TYPE_SHIFT   13

◆ FRU_LOG_START

#define FRU_LOG_START   0x0000

◆ 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

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:

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

◆ reset_error_log_event()

void reset_error_log_event ( uint8_t  err_type)

◆ vr_fault_get_error_data()

bool vr_fault_get_error_data ( uint8_t  sensor_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_INDEX_E_2
Definition: plat_hook.h:29
@ VR_INDEX_E_10
Definition: plat_hook.h:37
@ VR_INDEX_E_11
Definition: plat_hook.h:38
@ VR_INDEX_E_4
Definition: plat_hook.h:31
@ VR_INDEX_E_9
Definition: plat_hook.h:36
@ VR_INDEX_E_3
Definition: plat_hook.h:30
@ VR_INDEX_E_12
Definition: plat_hook.h:39
@ VR_INDEX_E_6
Definition: plat_hook.h:33
@ VR_INDEX_E_8
Definition: plat_hook.h:35
@ VR_INDEX_E_1
Definition: plat_hook.h:28
@ VR_INDEX_E_7
Definition: plat_hook.h:34
@ VR_INDEX_E_5
Definition: plat_hook.h:32
#define SENSOR_NUM_ASIC_P0V75_VDDPHY_HBM0246_TEMP_C
Definition: plat_pldm_sensor.h:174
#define SENSOR_NUM_ASIC_P0V75_OWL_E_VDD_TEMP_C
Definition: plat_pldm_sensor.h:124
#define SENSOR_NUM_ASIC_P0V75_OWL_E_TRVDD_TEMP_C
Definition: plat_pldm_sensor.h:119
#define SENSOR_NUM_ASIC_P0V75_MAX_S_VDD_TEMP_C
Definition: plat_pldm_sensor.h:154
#define SENSOR_NUM_ASIC_P0V75_MAX_M_VDD_TEMP_C
Definition: plat_pldm_sensor.h:144
#define SENSOR_NUM_ASIC_P0V9_OWL_E_TRVDD_TEMP_C
Definition: plat_pldm_sensor.h:114
#define SENSOR_NUM_ASIC_P1V8_VPP_HBM0246_TEMP_C
Definition: plat_pldm_sensor.h:189
#define SENSOR_NUM_ASIC_P0V75_OWL_W_TRVDD_TEMP_C
Definition: plat_pldm_sensor.h:134
#define SENSOR_NUM_ASIC_P0V9_OWL_W_TRVDD_TEMP_C
Definition: plat_pldm_sensor.h:129
#define SENSOR_NUM_ASIC_P1V1_VDDQC_HBM1357_TEMP_C
Definition: plat_pldm_sensor.h:204
#define SENSOR_NUM_ASIC_P1V1_VDDQC_HBM0246_TEMP_C
Definition: plat_pldm_sensor.h:184
#define SENSOR_NUM_ASIC_P0V85_MEDHA0_VDD_TEMP_C
Definition: plat_pldm_sensor.h:104
#define SENSOR_NUM_ASIC_P0V85_MEDHA1_VDD_TEMP_C
Definition: plat_pldm_sensor.h:109
#define SENSOR_NUM_ASIC_P1V8_VPP_HBM1357_TEMP_C
Definition: plat_pldm_sensor.h:209
#define SENSOR_NUM_ASIC_P0V4_VDDQL_HBM0246_TEMP_C
Definition: plat_pldm_sensor.h:179
#define SENSOR_NUM_ASIC_P0V75_MAX_N_VDD_TEMP_C
Definition: plat_pldm_sensor.h:149
#define SENSOR_NUM_ASIC_P0V75_VDDPHY_HBM1357_TEMP_C
Definition: plat_pldm_sensor.h:194
#define SENSOR_NUM_ASIC_P0V75_OWL_W_VDD_TEMP_C
Definition: plat_pldm_sensor.h:139
#define SENSOR_NUM_ASIC_P0V85_HAMSA_VDD_TEMP_C
Definition: plat_pldm_sensor.h:169
#define SENSOR_NUM_ASIC_P1V2_HAMSA_VDDHRXTX_PCIE_TEMP_C
Definition: plat_pldm_sensor.h:164
#define SENSOR_NUM_ASIC_P0V4_VDDQL_HBM1357_TEMP_C
Definition: plat_pldm_sensor.h:199
#define SENSOR_NUM_ASIC_P0V8_HAMSA_AVDD_PCIE_TEMP_C
Definition: plat_pldm_sensor.h:159

◆ vr_error_callback_info_table

vr_error_callback_info vr_error_callback_info_table[]
Initial value:
= {
0xFC,
0x00, 0x00 } },
0xFF,
0xFF,
0,
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
0,
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
}
#define VR_POWER_FAULT_5_REG
Definition: plat_event.h:122
#define VR_POWER_FAULT_4_REG
Definition: plat_event.h:121
#define VR_POWER_FAULT_1_REG
Definition: plat_event.h:118
#define VR_POWER_FAULT_2_REG
Definition: plat_event.h:119
#define VR_POWER_FAULT_3_REG
Definition: plat_event.h:120