diff options
author | Marshall Dawson <marshalldawson3rd@gmail.com> | 2018-09-04 13:45:26 -0600 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2018-09-07 14:50:34 +0000 |
commit | 1d8d369dad880a9787bd97ff01ecb2434d328374 (patch) | |
tree | 91635c108286a5c60faf563095333c7190aa85ae /src/arch/x86/acpi.c | |
parent | 44705c6e5e5075f450d6acaa470a04b620deb13f (diff) |
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>
Reviewed-on: https://review.coreboot.org/28472
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/arch/x86/acpi.c')
-rw-r--r-- | src/arch/x86/acpi.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c index d334eb3e66..d75d889513 100644 --- a/src/arch/x86/acpi.c +++ b/src/arch/x86/acpi.c @@ -958,6 +958,27 @@ void acpi_write_hest(acpi_hest_t *hest, 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) { |