aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/common
diff options
context:
space:
mode:
authorJonathan Zhang <jonzhang@meta.com>2022-10-26 17:53:25 -0700
committerFelix Held <felix-coreboot@felixheld.de>2023-02-17 12:37:56 +0000
commit01acc036aec765065e1d4ab07695dab1fd4818e0 (patch)
tree73254529d0cf3f2b3a53febf9ad88223a8b2ecfe /src/soc/intel/common
parentede68ac6b910f63523619e4a2f8771a5dcbb7dce (diff)
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 <Tim.Chu@quantatw.com> Signed-off-by: Jonathan Zhang <jonzhang@meta.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/68878 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Diffstat (limited to 'src/soc/intel/common')
-rw-r--r--src/soc/intel/common/block/acpi/acpi_bert.c24
1 files changed, 18 insertions, 6 deletions
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;
+ }
+}