aboutsummaryrefslogtreecommitdiff
path: root/src/soc/amd/stoneyridge/northbridge.c
diff options
context:
space:
mode:
authorMarshall Dawson <marshalldawson3rd@gmail.com>2018-09-04 13:25:39 -0600
committerMartin Roth <martinroth@google.com>2018-09-07 14:52:53 +0000
commit653f760b133fcad4b6465a25867f0c6d9b24bdb0 (patch)
tree636d4a2b2f390c46fb252154558801364a6b3dd2 /src/soc/amd/stoneyridge/northbridge.c
parent64e1fcaaf9d424dd28a8da68292d340701a874b7 (diff)
amd/stoneyridge: Construct ACPI BERT table
Add a Boot Error Record Table to the ACPI information. Avoid a driver error message by skipping the table altogether when no errors are found, or support isn't built in. BUG=b:65446699 TEST=inspect BERT region, and dmesg, on full patch stack. Use test data plus a failing Grunt system. Change-Id: I6fe38eefacaad0bc73d0cb4ae44a339a45857128 Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com> Reviewed-on: https://review.coreboot.org/28478 Reviewed-by: Martin Roth <martinroth@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/amd/stoneyridge/northbridge.c')
-rw-r--r--src/soc/amd/stoneyridge/northbridge.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c
index c78ca7cb58..912daa05e2 100644
--- a/src/soc/amd/stoneyridge/northbridge.c
+++ b/src/soc/amd/stoneyridge/northbridge.c
@@ -33,6 +33,7 @@
#include <amdblocks/agesawrapper.h>
#include <amdblocks/agesawrapper_call.h>
#include <agesa_headers.h>
+#include <soc/cpu.h>
#include <soc/northbridge.h>
#include <soc/southbridge.h>
#include <soc/pci_devs.h>
@@ -40,6 +41,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include <arch/bert_storage.h>
static void set_io_addr_reg(struct device *dev, u32 nodeid, u32 linkn, u32 reg,
u32 io_min, u32 io_max)
@@ -228,6 +230,7 @@ static unsigned long agesa_write_acpi_tables(struct device *device,
acpi_header_t *alib;
acpi_header_t *ivrs;
acpi_hest_t *hest;
+ acpi_bert_t *bert;
/* HEST */
current = ALIGN(current, 8);
@@ -236,6 +239,26 @@ static unsigned long agesa_write_acpi_tables(struct device *device,
acpi_add_table(rsdp, (void *)current);
current += ((acpi_header_t *)current)->length;
+ /* BERT */
+ if (IS_ENABLED(CONFIG_ACPI_BERT) && bert_errors_present()) {
+ /* Skip the table if no errors are present. ACPI driver reports
+ * a table with a 0-length region:
+ * BERT: [Firmware Bug]: table invalid.
+ */
+ void *rgn;
+ size_t size;
+ bert_errors_region(&rgn, &size);
+ if (!rgn) {
+ printk(BIOS_ERR, "Error: Can't find BERT storage area\n");
+ } else {
+ current = ALIGN(current, 8);
+ bert = (acpi_bert_t *)current;
+ acpi_write_bert((void *)current, (uintptr_t)rgn, size);
+ acpi_add_table(rsdp, (void *)current);
+ current += ((acpi_header_t *)current)->length;
+ }
+ }
+
current = ALIGN(current, 8);
printk(BIOS_DEBUG, "ACPI: * IVRS at %lx\n", current);
ivrs = agesawrapper_getlateinitptr(PICK_IVRS);