From 522e0dbdaa46dde5363ad4c50a11938ae2f17a0d Mon Sep 17 00:00:00 2001 From: Francois Toguo Date: Thu, 21 Jan 2021 09:55:19 -0800 Subject: acpi: Add support for reporting CrashLog in BERT table Crash Data are collected and sent to the OS via the ACPI BERT. BUG=None TEST=Built, and BERT successfully generated in the crashLog flow. Signed-off-by: Francois Toguo Change-Id: I00e390d735d61beac2e89a726e39119d9b06b3df Signed-off-by: Nikunj A. Dadhania Reviewed-on: https://review.coreboot.org/c/coreboot/+/49799 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak --- src/include/acpi/acpi.h | 4 ++++ src/include/cper.h | 13 +++++++++++++ 2 files changed, 17 insertions(+) (limited to 'src/include') diff --git a/src/include/acpi/acpi.h b/src/include/acpi/acpi.h index fa24902331..058c0d0217 100644 --- a/src/include/acpi/acpi.h +++ b/src/include/acpi/acpi.h @@ -1075,6 +1075,10 @@ unsigned long acpi_create_hest_error_source(acpi_hest_t *hest, void acpi_create_lpit(acpi_lpit_t *lpit); unsigned long acpi_create_lpi_desc_ncst(acpi_lpi_desc_ncst_t *lpi_desc, uint16_t uid); +/* For crashlog. */ +bool acpi_is_boot_error_src_present(void); +void acpi_soc_fill_bert(acpi_bert_t *bert, void **region, size_t *length); + /* For ACPI S3 support. */ void __noreturn acpi_resume(void *wake_vec); void mainboard_suspend_resume(void); diff --git a/src/include/cper.h b/src/include/cper.h index b6d182e8ea..020ac41c77 100644 --- a/src/include/cper.h +++ b/src/include/cper.h @@ -370,6 +370,19 @@ typedef struct cper_ia32x64_ctx_x64state { u16 tr; } cper_ia32x64_ctx_x64state_t; +#define FW_ERR_RECORD_ID_CRASHLOG_GUID \ + GUID_INIT(0x8f87f311, 0xc998, 0x4d9e, \ + 0xa0, 0xc4, 0x60, 0x65, 0x51, 0x8c, 0x4f, 0x6d) + +/* Firmware Error Record Reference, UEFI v2.8 sec N.2.10 */ +typedef struct cper_fw_err_rec_section { + u8 record_type; + u8 revision; + u8 reserved[6]; + u64 record_id; + guid_t record_guid; +} cper_fw_err_rec_section_t; + static inline cper_timestamp_t cper_timestamp(int precise) { cper_timestamp_t ts; -- cgit v1.2.3