Marshall Dawson has uploaded this change for review. ( https://review.coreboot.org/28472
Change subject: x86/acpi: Add BERT table ......................................................................
x86/acpi: Add BERT table
Create a structure for the Boot Error Record Table, and a generic table generator function.
BUG=b:65446699 TEST=inspect BERT region, and dmesg, on full patch stack. Use test data plus a failing Grunt system.
Change-Id: Ibeef4347678598f9f967797202a4ae6b25ee5538 Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/arch/x86/acpi.c M src/arch/x86/include/arch/acpi.h 2 files changed, 29 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/72/28472/1
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c index d334eb3..d75d889 100644 --- a/src/arch/x86/acpi.c +++ b/src/arch/x86/acpi.c @@ -958,6 +958,27 @@ header->checksum = acpi_checksum((void *)hest, header->length); }
+/* ACPI 3.0b */ +void acpi_write_bert(acpi_bert_t *bert, uintptr_t region, size_t length) +{ + acpi_header_t *header = &(bert->header); + + memset(bert, 0, sizeof(acpi_bert_t)); + + memcpy(header->signature, "BERT", 4); + memcpy(header->oem_id, OEM_ID, 6); + memcpy(header->oem_table_id, ACPI_TABLE_CREATOR, 8); + memcpy(header->asl_compiler_id, ASLC, 4); + header->length += sizeof(acpi_bert_t); + header->revision = get_acpi_table_revision(BERT); + + bert->error_region = region; + bert->region_length = length; + + /* Calculate checksums. */ + header->checksum = acpi_checksum((void *)bert, header->length); +} + #if IS_ENABLED(CONFIG_COMMON_FADT) void acpi_create_fadt(acpi_fadt_t *fadt, acpi_facs_t *facs, void *dsdt) { diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h index cf223e5..6991235 100644 --- a/src/arch/x86/include/arch/acpi.h +++ b/src/arch/x86/include/arch/acpi.h @@ -644,6 +644,13 @@ u32 error_threshold_win; } __packed acpi_hest_hen_t;
+/* BERT (Boot Error Record Table) */ +typedef struct acpi_bert { + struct acpi_table_header header; + u32 region_length; + u64 error_region; +} __packed acpi_bert_t; + /* Generic Error Data Entry. */ typedef struct acpi_hest_generic_data { guid_t section_type; @@ -751,6 +758,7 @@ unsigned long acpi_fill_mcfg(unsigned long current); unsigned long acpi_fill_ivrs_ioapic(acpi_ivrs_t *ivrs, unsigned long current); void acpi_create_ssdt_generator(acpi_header_t *ssdt, const char *oem_table_id); +void acpi_write_bert(acpi_bert_t *bert, uintptr_t region, size_t length); void acpi_create_fadt(acpi_fadt_t *fadt, acpi_facs_t *facs, void *dsdt); #if IS_ENABLED(CONFIG_COMMON_FADT) void acpi_fill_fadt(acpi_fadt_t *fadt);