Attention is currently required from: Jason Glenesk, Raul Rangel, Marshall Dawson. Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/54149 )
Change subject: [WIP] soc/amd/picasso/agesa_Acpi: add BERT support ......................................................................
[WIP] soc/amd/picasso/agesa_Acpi: add BERT support
TODO: Find out why Linux complains about an invalid error record. This might be due to the way I force the code into the MCA error state in the NOTFORMERGE follow-up patch I use for testing or the layout of the generated data structure is wrong.
TODO: investigate if we can just implement acpi_soc_fill_bert and acpi_is_boot_error_src_present instead of reimplementing the SSDT generation here. If it can be used, it should also be used on Stoneyridge where this is basically a copy from.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: I14577e80e722cb5ccf344a4520cf3adde669fc5e --- M src/soc/amd/picasso/agesa_acpi.c 1 file changed, 22 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/54149/1
diff --git a/src/soc/amd/picasso/agesa_acpi.c b/src/soc/amd/picasso/agesa_acpi.c index abac9c1..806ee6a 100644 --- a/src/soc/amd/picasso/agesa_acpi.c +++ b/src/soc/amd/picasso/agesa_acpi.c @@ -3,6 +3,7 @@ #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> @@ -994,6 +995,7 @@ { acpi_ivrs_t *ivrs; struct acpi_crat_header *crat; + acpi_bert_t *bert;
/* CRAT */ current = ALIGN(current, 8); @@ -1012,6 +1014,26 @@ current += ivrs->header.length; acpi_add_table(rsdp, ivrs);
+ /* BERT */ + if (CONFIG(ACPI_BERT) && bert_errors_present()) { + /* 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; + } + } + /* Add SRAT, MSCT, SLIT if needed in the future */
return current;