diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2021-05-28 16:19:59 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-06-08 18:22:35 +0000 |
commit | d288d8c0b136d5fd8c652f427bbb58a0172b5d07 (patch) | |
tree | 17ff9a2dde9b5ec36a1174b464c9c4bb35071e76 | |
parent | 62eb0ed93e53997925967318e20e13fa0d08799a (diff) |
soc/amd/stoneyridge: use common BERT ACPI table generation
Implement acpi_soc_get_bert_region so that the common ACPI code will
generate a BERT ACPI table that points to the BERT memory region instead
of generating the BERT table in the SoC=specific code.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I86d4f5ef74d4d40cb93ac4a3feaf28b99022ebd5
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55055
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
-rw-r--r-- | src/soc/amd/stoneyridge/northbridge.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c index e1108de742..a16ade5fdc 100644 --- a/src/soc/amd/stoneyridge/northbridge.c +++ b/src/soc/amd/stoneyridge/northbridge.c @@ -229,7 +229,6 @@ static unsigned long agesa_write_acpi_tables(const struct device *device, acpi_header_t *alib; acpi_header_t *ivrs; acpi_hest_t *hest; - acpi_bert_t *bert; /* HEST */ current = ALIGN(current, 8); @@ -238,26 +237,6 @@ static unsigned long agesa_write_acpi_tables(const struct device *device, acpi_add_table(rsdp, (void *)current); current += hest->header.length; - /* BERT */ - if (bert_should_generate_acpi_table()) { - /* 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(bert, (uintptr_t)rgn, size); - acpi_add_table(rsdp, (void *)current); - current += bert->header.length; - } - } - current = ALIGN(current, 8); printk(BIOS_DEBUG, "ACPI: * IVRS at %lx\n", current); ivrs = agesawrapper_getlateinitptr(PICK_IVRS); @@ -347,6 +326,25 @@ static const struct pci_driver family15_northbridge __pci_driver = { .devices = pci_device_ids, }; +enum cb_err acpi_soc_get_bert_region(void **region, size_t *length) +{ + /* + * Skip the table if no errors are present. ACPI driver reports + * a table with a 0-length region: + * BERT: [Firmware Bug]: table invalid. + */ + if (!bert_should_generate_acpi_table()) + return CB_ERR; + + bert_errors_region(region, length); + if (!region) { + printk(BIOS_ERR, "Error: Can't find BERT storage area\n"); + return CB_ERR; + } + + return CB_SUCCESS; +} + /* * Enable VGA cycles. Set memory ranges of the FCH legacy devices (TPM, HPET, * BIOS RAM, Watchdog Timer, IOAPIC and ACPI) as non-posted. Set remaining |