diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2021-05-28 17:59:09 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-06-08 18:24:00 +0000 |
commit | f0c52768f38da98c3abecd294ec4904e48170315 (patch) | |
tree | 6d7edf431e8c0d159a3ced1b8605968ad0b930da /src/soc/amd/common/block | |
parent | a389b3cb4d45d8dec770109f50054fca4c708a28 (diff) |
soc/amd: factor out acpi_soc_get_bert_region to amd/common
This also adds BERT table 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 table being generated on Cezanne, since
bert_generate_ssdt will always return false there.
TEST=BERT ACPI table generation still works on AMD/Mandolin
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I69b4a9a7432041e1f4902436fa4e6dee5332dbd2
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55056
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Diffstat (limited to 'src/soc/amd/common/block')
-rw-r--r-- | src/soc/amd/common/block/acpi/Makefile.inc | 1 | ||||
-rw-r--r-- | src/soc/amd/common/block/acpi/bert.c | 25 |
2 files changed, 26 insertions, 0 deletions
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 <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_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; +} |