diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig index d78aa8fa30..b58907e230 100644 --- a/src/arch/x86/Kconfig +++ b/src/arch/x86/Kconfig @@ -459,4 +459,11 @@ config SOC_FILL_CPU_CACHE_INFO default n help SoC selects this if it implements soc_fill_cpu_cache_info. + +config SOC_BERT_SIZEOF_ERROR_SECTION + bool + default n + help + SoC selects this if it implements soc_bert_sizeof_error_section. + endif diff --git a/src/arch/x86/acpi_bert_storage.c b/src/arch/x86/acpi_bert_storage.c index 902ddb7da5..efa1d07849 100644 --- a/src/arch/x86/acpi_bert_storage.c +++ b/src/arch/x86/acpi_bert_storage.c @@ -192,6 +192,11 @@ static size_t sizeof_error_section(guid_t *guid) else if (!guidcmp(guid, &CPER_SEC_FW_ERR_REC_REF_GUID)) return sizeof(cper_fw_err_rec_section_t); /* else if ... sizeof(structures not yet defined) */ + else if (CONFIG(SOC_BERT_SIZEOF_ERROR_SECTION)) { + size_t size = soc_bert_sizeof_error_section(guid); + if (size) + return size; + } printk(BIOS_ERR, "Requested size of unrecognized CPER GUID\n"); return 0; @@ -535,9 +540,8 @@ acpi_generic_error_status_t *bert_new_event(guid_t *guid) r = bert_append_ia32x64(status); else if (!guidcmp(guid, &CPER_SEC_FW_ERR_REC_REF_GUID)) r = bert_append_fw_err(status); - /* else if other types not implemented */ else - r = NULL; + r = bert_append_error_datasection(status, guid); if (r) return status; diff --git a/src/arch/x86/include/arch/bert_storage.h b/src/arch/x86/include/arch/bert_storage.h index eb5db7f9cb..41c4f1c6e5 100644 --- a/src/arch/x86/include/arch/bert_storage.h +++ b/src/arch/x86/include/arch/bert_storage.h @@ -50,6 +50,9 @@ */ void bert_errors_region(void **start, size_t *size); +/* Returns the size for SoC specific GUIDs */ +size_t soc_bert_sizeof_error_section(guid_t *guid); + /* Get amount of available storage left for error info */ size_t bert_storage_remaining(void); /* Find if errors were added, a BERT region is present, and ACPI table needed */