From 01acc036aec765065e1d4ab07695dab1fd4818e0 Mon Sep 17 00:00:00 2001 From: Jonathan Zhang Date: Wed, 26 Oct 2022 17:53:25 -0700 Subject: soc/intel/cmn/block/acpi: enable BERT table without crashlog Besides crashlog, there's also other errors such as MCA error, which should be recorded in BERT table. With current code, BERT table is not generated if crashlog is not enabled. Add if statement for SOC_INTEL_CRASHLOG so that MCA error can be recorded in BERT table when crashlog is not supported. For some server mainboard, crashlog is supported through BMC instead of host firmware. Also check if BERT region is generated when crashlog is not enabled. Change-Id: I323ca889eef2b246fc4e062582d2d11b4213316f Signed-off-by: Tim Chu Signed-off-by: Jonathan Zhang Reviewed-on: https://review.coreboot.org/c/coreboot/+/68878 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: David Hendricks --- src/soc/intel/common/block/acpi/acpi_bert.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/soc/intel/common') diff --git a/src/soc/intel/common/block/acpi/acpi_bert.c b/src/soc/intel/common/block/acpi/acpi_bert.c index 779466c8ad..7743ccc72f 100644 --- a/src/soc/intel/common/block/acpi/acpi_bert.c +++ b/src/soc/intel/common/block/acpi/acpi_bert.c @@ -9,11 +9,6 @@ static bool boot_error_src_present(void) { - if (!CONFIG(SOC_INTEL_CRASHLOG)) { - printk(BIOS_DEBUG, "Crashlog disabled.\n"); - return false; - } - if (!discover_crashlog()) { printk(BIOS_SPEW, "Crashlog discovery result: crashlog not found\n"); return false; @@ -27,7 +22,7 @@ static bool boot_error_src_present(void) return (crashlog_size > 0); } -enum cb_err acpi_soc_get_bert_region(void **region, size_t *length) +static enum cb_err record_crashlog_into_bert(void **region, size_t *length) { acpi_generic_error_status_t *status = NULL; size_t cpu_record_size, pmc_record_size; @@ -97,3 +92,20 @@ enum cb_err acpi_soc_get_bert_region(void **region, size_t *length) return CB_SUCCESS; } + +enum cb_err acpi_soc_get_bert_region(void **region, size_t *length) +{ + if (CONFIG(SOC_INTEL_CRASHLOG)) { + return record_crashlog_into_bert(region, length); + } else { + /* Check if MCA error has been added into BERT. */ + if (bert_should_generate_acpi_table()) { + bert_errors_region(region, length); + if (!*region) { + printk(BIOS_ERR, "Can't find BERT storage area\n"); + return CB_ERR; + } + } + return CB_SUCCESS; + } +} -- cgit v1.2.3