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 AEGIS_FRU_LOG_SIZE sizeof(plat_err_log_mapping)
23
24uint16_t error_log_count(void);
25void init_load_eeprom_log(void);
26
27void plat_log_read(uint8_t *log_data, uint8_t cmd_size, uint16_t order);
28void error_log_event(uint16_t error_code, bool log_status);
29void plat_clear_log();
30uint8_t plat_log_get_num(void);
31
32typedef struct __attribute__((packed)) _plat_err_log_mapping {
33 uint16_t index;
34 uint16_t err_code;
35 uint64_t sys_time;
36 uint8_t error_data[20];
37 uint8_t cpld_dump[96];
39
63};
64
65typedef struct _err_sensor_mapping {
66 uint16_t err_code;
67 uint8_t err_num;
69
70#define LOG_ASSERT 1
71#define LOG_DEASSERT 0
72
74 // VR fault error number mapping to sensor number
75
76 // other error number start form here
80};
81
92};
93
96
97#endif
void error_log_event(uint8_t sensor_num, bool val_normal)
Definition: plat_log.c:152
void init_load_eeprom_log(void)
Definition: plat_log.c:206
uint16_t error_log_count(void)
Definition: plat_log.c:86
struct _err_sensor_mapping err_sensor_mapping
LOG_ERROR_CODE
Definition: plat_log.h:40
@ PUMP_2_SPEED_RECOVER
Definition: plat_log.h:58
@ LEAK_CHASSIS_2
Definition: plat_log.h:43
@ LEAK_MAN_HOT
Definition: plat_log.h:47
@ LEAK_CHASSIS_0
Definition: plat_log.h:41
@ PUMP_1_SPEED_RECOVER
Definition: plat_log.h:57
@ PUMP_2_SPEED_ABNORMAL
Definition: plat_log.h:55
@ HIGH_PRESS_DETECTED
Definition: plat_log.h:60
@ LOW_WATER_LEVEL
Definition: plat_log.h:53
@ PUMP_1_SPEED_ABNORMAL
Definition: plat_log.h:54
@ LEAK_MAN_FLOOR_GPO
Definition: plat_log.h:50
@ FLOW_RATE_SENSOR_TRIGGERED
Definition: plat_log.h:61
@ LEAK_MAN_PAN_GPO
Definition: plat_log.h:49
@ EMERGENCY_BUTTON_TRIGGERED
Definition: plat_log.h:62
@ LEAK_CHASSIS_3
Definition: plat_log.h:44
@ LEAK_MAN_PAN_RELAY
Definition: plat_log.h:51
@ PUMP_3_SPEED_RECOVER
Definition: plat_log.h:59
@ LEAK_RPU_EXT
Definition: plat_log.h:46
@ LEAK_RPU_INT
Definition: plat_log.h:45
@ PUMP_3_SPEED_ABNORMAL
Definition: plat_log.h:56
@ LEAK_MAN_COLD
Definition: plat_log.h:48
@ LEAK_CHASSIS_1
Definition: plat_log.h:42
@ LEAK_MAN_FLOOR_RELAY
Definition: plat_log.h:52
err_type
Definition: plat_log.h:82
@ VR_FAULT_ASSERT
Definition: plat_log.h:83
@ VR_FAULT_DEASSERT
Definition: plat_log.h:84
@ ERROR_TYPE_MAX
Definition: plat_log.h:91
@ DC_ON_STATUS_FAULT_DEASSERT
Definition: plat_log.h:86
@ DC_OFF_STATUS_FAULT_ASSERT
Definition: plat_log.h:87
@ DC_OFF_STATUS_FAULT_DEASSERT
Definition: plat_log.h:88
@ ASIC_FAULT_DEASSERT
Definition: plat_log.h:90
@ ASIC_FAULT_ASSERT
Definition: plat_log.h:89
@ DC_ON_STATUS_FAULT_ASSERT
Definition: plat_log.h:85
plat_err_log_mapping
Definition: plat_log.h:38
err_number
Definition: plat_log.h:73
@ DC_OFF_STATUS_FAULT
Definition: plat_log.h:78
@ DC_ON_STATUS_FAULT
Definition: plat_log.h:77
@ ASIC_FAULT
Definition: plat_log.h:79
const err_sensor_mapping minerva_ag_sensor_err_codes[]
void plat_clear_log()
Definition: plat_log.c:153
uint8_t plat_log_get_num(void)
Definition: plat_log.c:406
const err_sensor_mapping minerva_ag_sensor_normal_codes[]
void plat_log_read(uint8_t *log_data, uint8_t cmd_size, uint16_t order)
Definition: plat_log.c:114
Definition: pldm_smbios.h:61
Definition: plat_log.h:89
uint16_t err_code
Definition: plat_log.h:90
uint8_t err_num
Definition: plat_log.h:67