Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/55056 )
Change subject: soc/amd: factor out acpi_soc_get_bert_region to amd/common ......................................................................
soc/amd: factor out acpi_soc_get_bert_region to amd/common
This also adds BERT SSDT gerenation support for Cezanne, but since the functionality to populate the BERT memory region isn't implemented yet, this won't result in a BERT SSDT being generated on Cezanne, since bert_generate_ssdt will always return false there.
TEST=BERT SSDT generation still works on AMD/Mandolin
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: I69b4a9a7432041e1f4902436fa4e6dee5332dbd2 --- M src/soc/amd/common/block/acpi/Makefile.inc A src/soc/amd/common/block/acpi/bert.c M src/soc/amd/picasso/agesa_acpi.c M src/soc/amd/stoneyridge/northbridge.c 4 files changed, 26 insertions(+), 40 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/55056/1
diff --git a/src/soc/amd/common/block/acpi/Makefile.inc b/src/soc/amd/common/block/acpi/Makefile.inc index 9f774d4..30e01dd 100644 --- a/src/soc/amd/common/block/acpi/Makefile.inc +++ b/src/soc/amd/common/block/acpi/Makefile.inc @@ -9,6 +9,7 @@
ramstage-y += pm_state.c ramstage-y += tables.c +ramstage-$(CONFIG_ACPI_BERT) += bert.c ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI_ALIB) += alib.c ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI_GPIO) += gpio.c
diff --git a/src/soc/amd/common/block/acpi/bert.c b/src/soc/amd/common/block/acpi/bert.c new file mode 100644 index 0000000..9102715 --- /dev/null +++ b/src/soc/amd/common/block/acpi/bert.c @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <acpi/acpi.h> +#include <arch/bert_storage.h> +#include <console/console.h> +#include <types.h> + +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; +} diff --git a/src/soc/amd/picasso/agesa_acpi.c b/src/soc/amd/picasso/agesa_acpi.c index 3fd2550..abac9c1 100644 --- a/src/soc/amd/picasso/agesa_acpi.c +++ b/src/soc/amd/picasso/agesa_acpi.c @@ -3,7 +3,6 @@ #include <acpi/acpi.h> #include <acpi/acpi_crat.h> #include <acpi/acpi_ivrs.h> -#include <arch/bert_storage.h> #include <console/console.h> #include <cpu/amd/cpuid.h> #include <cpu/amd/msr.h> @@ -1017,22 +1016,3 @@
return current; } - -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; -} diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c index fc6d39e..a2e719b 100644 --- a/src/soc/amd/stoneyridge/northbridge.c +++ b/src/soc/amd/stoneyridge/northbridge.c @@ -26,7 +26,6 @@ #include <soc/iomap.h> #include <stdint.h> #include <string.h> -#include <arch/bert_storage.h>
#include "chip.h"
@@ -326,25 +325,6 @@ .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