From eafcc8e5b1122f30e265f77271a18a9124e4dc9e Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Mon, 23 May 2022 16:09:51 +0200 Subject: arch/x86/acpi_bert_storage.c: Use a common implementation All targets now use cbmem for the BERT region, so the implementation can be common. This also drops the obsolete comment about the need to have bert in a reserved region (cbmem gets fixed to be in a reserved region). Change-Id: I6f33d9e05a02492a1c91fb7af94aadaa9acd2931 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/64602 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Raul Rangel Reviewed-by: Felix Held --- src/arch/x86/acpi_bert_storage.c | 17 +++++++++-------- src/arch/x86/include/arch/bert_storage.h | 3 --- 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'src/arch/x86') diff --git a/src/arch/x86/acpi_bert_storage.c b/src/arch/x86/acpi_bert_storage.c index 7b6b63bcca..62c044137d 100644 --- a/src/arch/x86/acpi_bert_storage.c +++ b/src/arch/x86/acpi_bert_storage.c @@ -567,15 +567,16 @@ cper_ia32x64_context_t *cper_new_ia32x64_context_msr( return ctx; } -/* The region must be in memory marked as reserved. If not implemented, - * skip generating the information in the region. - */ -__weak void bert_reserved_region(void **start, size_t *size) +static void bert_reserved_region(void **start, size_t *size) { - printk(BIOS_ERR, "%s not implemented. BERT region generation disabled\n", - __func__); - *start = NULL; - *size = 0; + if (!CONFIG(ACPI_BERT)) { + *start = NULL; + *size = 0; + } else { + *start = cbmem_add(CBMEM_ID_ACPI_BERT, CONFIG_ACPI_BERT_SIZE); + *size = CONFIG_ACPI_BERT_SIZE; + } + printk(BIOS_INFO, "Reserved BERT region base: %p, size: 0x%zx\n", *start, *size); } static void bert_storage_setup(void *unused) diff --git a/src/arch/x86/include/arch/bert_storage.h b/src/arch/x86/include/arch/bert_storage.h index ea4ec3d2ba..ab44c9c32c 100644 --- a/src/arch/x86/include/arch/bert_storage.h +++ b/src/arch/x86/include/arch/bert_storage.h @@ -44,9 +44,6 @@ #define CRASHLOG_RECORD_TYPE 0x2 #define CRASHLOG_FW_ERR_REV 0x2 -/* Get implementation-specific reserved area for generating BERT info */ -void bert_reserved_region(void **start, size_t *size); - /* Get the region where BERT error structures have been constructed for * generating the ACPI table */ -- cgit v1.2.3