diff options
author | Francois Toguo <francois.toguo.fotso@intel.com> | 2021-01-21 09:55:19 -0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-02-04 10:21:02 +0000 |
commit | 522e0dbdaa46dde5363ad4c50a11938ae2f17a0d (patch) | |
tree | 7f4c2ddd84f8069b9f2fad2a9c0586ed3a959a5f /src/acpi/acpi.c | |
parent | 5f30ae3714d7535d3ce061b30e3292c6ac62cb6f (diff) |
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 <francois.toguo.fotso@intel.com>
Change-Id: I00e390d735d61beac2e89a726e39119d9b06b3df
Signed-off-by: Nikunj A. Dadhania <nikunj.dadhania@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/49799
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/acpi/acpi.c')
-rw-r--r-- | src/acpi/acpi.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index 05ada084ab..fc1368990e 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -1331,6 +1331,14 @@ unsigned long acpi_create_lpi_desc_ncst(acpi_lpi_desc_ncst_t *lpi_desc, uint16_t return lpi_desc->header.length; } +/* BERT helpers */ +bool __weak acpi_is_boot_error_src_present(void) +{ + return false; +} + +__weak void acpi_soc_fill_bert(acpi_bert_t *bert, void **region, size_t *length) {} + unsigned long __weak fw_cfg_acpi_tables(unsigned long start) { return 0; @@ -1352,6 +1360,7 @@ unsigned long write_acpi_tables(unsigned long start) acpi_tpm2_t *tpm2; acpi_madt_t *madt; acpi_lpit_t *lpit; + acpi_bert_t *bert; struct device *dev; unsigned long fw; size_t slic_size, dsdt_size; @@ -1573,6 +1582,20 @@ unsigned long write_acpi_tables(unsigned long start) current = acpi_align_current(current); + if (acpi_is_boot_error_src_present()) { + void *region; + size_t size; + printk(BIOS_DEBUG, "ACPI: * BERT\n"); + bert = (acpi_bert_t *) current; + acpi_soc_fill_bert(bert, ®ion, &size); + acpi_write_bert(bert, (uintptr_t)region, size); + if (bert->header.length >= sizeof(acpi_bert_t)) { + current += bert->header.length; + acpi_add_table(rsdp, bert); + } + current = acpi_align_current(current); + } + printk(BIOS_DEBUG, "current = %lx\n", current); for (dev = all_devices; dev; dev = dev->next) { |