Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/55055 )
Change subject: soc/amd/stoneyridge: use common BERT SSDT generation ......................................................................
soc/amd/stoneyridge: use common BERT SSDT generation
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: I86d4f5ef74d4d40cb93ac4a3feaf28b99022ebd5 --- M src/soc/amd/stoneyridge/northbridge.c 1 file changed, 19 insertions(+), 21 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/55055/1
diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c index 1998e1b..fc6d39e 100644 --- a/src/soc/amd/stoneyridge/northbridge.c +++ b/src/soc/amd/stoneyridge/northbridge.c @@ -229,7 +229,6 @@ 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 @@ acpi_add_table(rsdp, (void *)current); current += hest->header.length;
- /* BERT */ - if (bert_generate_ssdt()) { - /* 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 @@ .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_generate_ssdt()) + 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