Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/55024 )
Change subject: arch/x8/include/bert_storage: introduce and use bert_generate_ssdt ......................................................................
arch/x8/include/bert_storage: introduce and use bert_generate_ssdt
Since bert_errors_present() is only available when ACPI_BERT is selected the ACPI table generation code needs to check that before calling the function, so add bert_generate_ssdt that returns false when ACPI_BERT isn't selected or the return value of bert_errors_present() when ACPI_BERT is selected.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: Ia955f627c190ea38e05b5aaedc7cb2d030274e83 --- M src/arch/x86/include/arch/bert_storage.h M src/soc/amd/stoneyridge/northbridge.c 2 files changed, 6 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/55024/1
diff --git a/src/arch/x86/include/arch/bert_storage.h b/src/arch/x86/include/arch/bert_storage.h index 6378333..794fb83 100644 --- a/src/arch/x86/include/arch/bert_storage.h +++ b/src/arch/x86/include/arch/bert_storage.h @@ -56,6 +56,11 @@ size_t bert_storage_remaining(void); /* Find if errors were added, a BERT region is present, and ACPI table needed */ bool bert_errors_present(void); +/* The BERT SSDT should only be generated when BERT support is enabled and there's an error */ +static inline bool bert_generate_ssdt(void) +{ + return CONFIG(ACPI_BERT) && bert_errors_present(); +}
/* Get the number of entries associated with status */ static inline size_t bert_entry_count(acpi_generic_error_status_t *status) diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c index eb59cdc..1998e1b 100644 --- a/src/soc/amd/stoneyridge/northbridge.c +++ b/src/soc/amd/stoneyridge/northbridge.c @@ -239,7 +239,7 @@ current += hest->header.length;
/* BERT */ - if (CONFIG(ACPI_BERT) && bert_errors_present()) { + 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.