OpenBIC
OpenSource Bridge-IC
plat_log.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef PLAT_LOG_H
18#define PLAT_LOG_H
19
20#include "plat_pldm_sensor.h"
21
22#define CPLD_REGISTER_MAX_NUM 72
23#define CPLD_REGISTER_1ST_PART_START_OFFSET \
24 0x00 // first part of cpld register offset from 0x00 to 0x47
25#define CPLD_REGISTER_1ST_PART_NUM 72
26#define FRU_LOG_SIZE sizeof(plat_err_log_mapping)
27
28#define LOG_ASSERT 1
29#define LOG_DEASSERT 0
30
31
33 //pwr fault reg 1
42 //pwr fault reg 2
51 //pwr fault reg 3
60 //pwr fault reg 4
69 //pwr fault reg 5
79};
80
81uint16_t error_log_count(void);
82void init_load_eeprom_log(void);
83
84void plat_log_read(uint8_t *log_data, uint8_t cmd_size, uint16_t order);
85void error_log_event(uint16_t error_code, bool log_status);
86uint8_t plat_log_get_num(void);
87void plat_clear_log();
88void reset_error_log_event(uint8_t err_type);
89bool check_temp_status_bit(uint8_t bit_num);
90
91typedef struct __attribute__((packed)) _plat_err_log_mapping {
92 uint16_t index;
93 uint16_t err_code;
94 uint64_t sys_time;
95 uint8_t error_data[20];
96 uint8_t cpld_dump[CPLD_REGISTER_MAX_NUM];
97 uint8_t reserved[24];
99
108 MAX_TRIGGER_CAUSE = 0b1000, //trigger cause maxium 3 bit
109};
110
111#endif
void error_log_event(uint8_t sensor_num, bool val_normal)
Definition: plat_log.c:160
void init_load_eeprom_log(void)
Definition: plat_log.c:220
uint16_t error_log_count(void)
Definition: plat_log.c:94
plat_err_log_mapping
Definition: plat_log.h:60
LOG_ERROR_TRIGGER_CAUSE
Definition: plat_log.h:62
@ AC_ON_TRIGGER_CAUSE
Definition: plat_log.h:65
@ CPLD_UNEXPECTED_VAL_TRIGGER_CAUSE
Definition: plat_log.h:63
@ MAX_TRIGGER_CAUSE
Definition: plat_log.h:68
@ DC_ON_TRIGGER_CAUSE
Definition: plat_log.h:66
@ POWER_ON_SEQUENCE_TRIGGER_CAUSE
Definition: plat_log.h:64
void plat_clear_log()
Definition: plat_log.c:138
uint8_t plat_log_get_num(void)
Definition: plat_log.c:454
void reset_error_log_event(uint8_t err_type)
Definition: plat_log.c:440
void plat_log_read(uint8_t *log_data, uint8_t cmd_size, uint16_t order)
Definition: plat_log.c:99
uint32_t reserved
Definition: plat_ncsi.h:4
VR_ERR_LOG_DEVICE_INDEX_E
Definition: plat_log.h:32
@ PWRGD_P3V3_R_FAULT
Definition: plat_log.h:72
@ PWRGD_OWL_E_VDD_R_FAULT
Definition: plat_log.h:45
@ PWRGD_MEDHA1_VDD_FAULT
Definition: plat_log.h:43
@ PWRGD_HAMSA_VDD_R_FAULT
Definition: plat_log.h:47
@ PWRGD_OWL_E_TRVDD0P75_R_FAULT
Definition: plat_log.h:36
@ PWRGD_OWL_W_VDD_R_FAULT
Definition: plat_log.h:46
@ PWRGD_VPP_HBM1_HBM3_HBM5_HBM7_R_FAULT
Definition: plat_log.h:58
@ PWRGD_HAMSA_AVDD_PCIE_R_FAULT
Definition: plat_log.h:38
@ PWRGD_OWL_W_TRVDD0P9_R_FAULT
Definition: plat_log.h:35
@ PWRGD_MAX_M_VDD_R_FAULT
Definition: plat_log.h:49
@ PWRGD_HAMSA_VDDHRXTX_PCIE_R_FAULT
Definition: plat_log.h:39
@ PWRGD_OWL_E_TRVDD0P9_R_FAULT
Definition: plat_log.h:34
@ PWRGD_PVDD1P5_FAULT
Definition: plat_log.h:77
@ PWRGD_PLL_VDDA15_HBM4_HBM6_FAULT
Definition: plat_log.h:62
@ PWRGD_P1V8_R_FAULT
Definition: plat_log.h:73
@ PWRGD_P0V9_OWL_W_PVDD_FAULT
Definition: plat_log.h:66
@ PWRGD_VDDQL_HBM0_HBM2_HBM4_HBM6_R_FAULT
Definition: plat_log.h:52
@ PWRGD_P1V5_W_RVDD_FAULT
Definition: plat_log.h:68
@ VR_ERR_DEVICE_DONT_CARE
Definition: plat_log.h:78
@ PWRGD_P1V5_E_RVDD_FAULT
Definition: plat_log.h:67
@ PWRGD_VPP_HBM0_HBM2_HBM4_HBM6_R_FAULT
Definition: plat_log.h:54
@ PWRGD_P0V75_AVDD_HCSL_R_FAULT
Definition: plat_log.h:41
@ P12V_UBC_PWRGD_FAULT
Definition: plat_log.h:70
@ PWRGD_P5V_R_FAULT
Definition: plat_log.h:71
@ PWRGD_P0V9_OWL_E_PVDD_FAULT
Definition: plat_log.h:65
@ PWRGD_MAX_S_VDD_R_FAULT
Definition: plat_log.h:48
@ PWRGD_VDDQC_HBM1_HBM3_HBM5_HBM7_R_FAULT
Definition: plat_log.h:57
@ PWRGD_PLL_VDDA15_HBM1_HBM3_FAULT
Definition: plat_log.h:63
@ PWRGD_P1V5_PLL_VDDA_SOC_FAULT
Definition: plat_log.h:76
@ PWRGD_OWL_W_TRVDD0P75_R_FAULT
Definition: plat_log.h:37
@ PWRGD_VDDPHY_HBM1_HBM3_HBM5_HBM7_R_FAULT
Definition: plat_log.h:59
@ PWRGD_PLL_VDDA15_HBM0_HBM2_FAULT
Definition: plat_log.h:61
@ PWRGD_VDDPHY_HBM0_HBM2_HBM4_HBM6_R_FAULT
Definition: plat_log.h:55
@ PWRGD_P4V2_R_FAULT
Definition: plat_log.h:40
@ PWRGD_LDO_IN_1V2_R_FAULT
Definition: plat_log.h:74
@ PWRGD_VDDQC_HBM0_HBM2_HBM4_HBM6_R_FAULT
Definition: plat_log.h:53
@ PWRGD_VDDQL_HBM1_HBM3_HBM5_HBM7_R_FAULT
Definition: plat_log.h:56
@ PWRGD_MEDHA0_VDD_FAULT
Definition: plat_log.h:44
@ PWRGD_PLL_VDDA15_HBM5_HBM7_FAULT
Definition: plat_log.h:64
@ PWRGD_MAX_N_VDD_R_FAULT
Definition: plat_log.h:50
@ PWRGD_P1V5_PLL_VDDA_OWL_FAULT
Definition: plat_log.h:75
bool check_temp_status_bit(uint8_t bit_num)
Definition: plat_log.c:616
@ ASIC_THERMTRIP_TRIGGER_CAUSE
Definition: plat_log.h:106
@ TEMPERATURE_TRIGGER_CAUSE
Definition: plat_log.h:105
@ ASIC_ERROR_TRIGGER_CAUSE
Definition: plat_log.h:107
#define CPLD_REGISTER_MAX_NUM
Definition: plat_log.h:22
Definition: pldm_smbios.h:61