diff --git a/src/soc/amd/common/block/acpi/Makefile.inc b/src/soc/amd/common/block/acpi/Makefile.inc index 9f774d4770..30e01ddbcc 100644 --- a/src/soc/amd/common/block/acpi/Makefile.inc +++ b/src/soc/amd/common/block/acpi/Makefile.inc @@ -9,6 +9,7 @@ smm-y += acpi.c 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 0000000000..207ee09563 --- /dev/null +++ b/src/soc/amd/common/block/acpi/bert.c @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include + +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; +} diff --git a/src/soc/amd/picasso/agesa_acpi.c b/src/soc/amd/picasso/agesa_acpi.c index 11be89ced1..abac9c1804 100644 --- a/src/soc/amd/picasso/agesa_acpi.c +++ b/src/soc/amd/picasso/agesa_acpi.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -1017,22 +1016,3 @@ uintptr_t agesa_write_acpi_tables(const struct device *device, uintptr_t current 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_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; -} diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c index a16ade5fdc..a2e719b978 100644 --- a/src/soc/amd/stoneyridge/northbridge.c +++ b/src/soc/amd/stoneyridge/northbridge.c @@ -26,7 +26,6 @@ #include #include #include -#include #include "chip.h" @@ -326,25 +325,6 @@ 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