OpenBIC
OpenSource Bridge-IC
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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_CPLD_REGISTER_MAX_NUM 96
23#define AEGIS_CPLD_REGISTER_1ST_PART_START_OFFSET \
24 0x00 // first part of cpld register offset from 0x00 to 0x47
25#define AEGIS_CPLD_REGISTER_1ST_PART_NUM 72
26#define AEGIS_CPLD_REGISTER_2ND_PART_START_OFFSET 0x97
27#define AEGIS_CPLD_REGISTER_2ND_PART_NUM \
28 (AEGIS_CPLD_REGISTER_MAX_NUM - AEGIS_CPLD_REGISTER_1ST_PART_NUM)
29#define AEGIS_FRU_LOG_SIZE sizeof(plat_err_log_mapping)
30
31#define LOG_ASSERT 1
32#define LOG_DEASSERT 0
33
34uint16_t error_log_count(void);
35void init_load_eeprom_log(void);
36
37void plat_log_read(uint8_t *log_data, uint8_t cmd_size, uint16_t order);
38void error_log_event(uint16_t error_code, bool log_status);
39void plat_clear_log();
40uint8_t plat_log_get_num(void);
41void reset_error_log_event(uint8_t err_type);
42
43typedef struct __attribute__((packed)) _plat_err_log_mapping {
44 uint16_t index;
45 uint16_t err_code;
46 uint64_t sys_time;
47 uint8_t error_data[20];
48 uint8_t cpld_dump[AEGIS_CPLD_REGISTER_MAX_NUM];
50
56 MAX_TRIGGER_CAUSE = 0b1000, //trigger cause maxium 3 bit
57};
58
59#endif
void error_log_event(uint8_t sensor_num, bool val_normal)
Definition: plat_log.c:153
void init_load_eeprom_log(void)
Definition: plat_log.c:213
uint16_t error_log_count(void)
Definition: plat_log.c:87
plat_err_log_mapping
Definition: plat_log.h:49
LOG_ERROR_TRIGGER_CAUSE
Definition: plat_log.h:51
@ AC_ON_TRIGGER_CAUSE
Definition: plat_log.h:54
@ CPLD_UNEXPECTED_VAL_TRIGGER_CAUSE
Definition: plat_log.h:52
@ MAX_TRIGGER_CAUSE
Definition: plat_log.h:56
@ DC_ON_TRIGGER_CAUSE
Definition: plat_log.h:55
@ POWER_ON_SEQUENCE_TRIGGER_CAUSE
Definition: plat_log.h:53
void plat_clear_log()
Definition: plat_log.c:151
uint8_t plat_log_get_num(void)
Definition: plat_log.c:424
void reset_error_log_event(uint8_t err_type)
Definition: plat_log.c:410
void plat_log_read(uint8_t *log_data, uint8_t cmd_size, uint16_t order)
Definition: plat_log.c:112
#define AEGIS_CPLD_REGISTER_MAX_NUM
Definition: plat_log.h:22
Definition: pldm_smbios.h:61