diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2021-05-28 16:01:57 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-06-07 18:25:57 +0000 |
commit | 29405483cedca2035d1d0229a2ec893e53a6dcc9 (patch) | |
tree | 685c76c525fe50823db4047315321273fc367b63 | |
parent | 8c8b4d26db910cb3e85a9940a1d9da828a725b22 (diff) | |
download | coreboot-29405483cedca2035d1d0229a2ec893e53a6dcc9.tar.gz coreboot-29405483cedca2035d1d0229a2ec893e53a6dcc9.tar.bz2 coreboot-29405483cedca2035d1d0229a2ec893e53a6dcc9.zip |
acpi: rename acpi_soc_fill_bert and add return value
The return value indicates if the function has found valid BERT data and
wrote them to the region and length parameters. This will be used in a
follow-up patch to remove the acpi_is_boot_error_src_present function
call in the common code.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Iaaa3eed51645e1b3bc904c6279d171e3a10d59be
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55053
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Lance Zhao
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | src/acpi/acpi.c | 7 | ||||
-rw-r--r-- | src/include/acpi/acpi.h | 2 | ||||
-rw-r--r-- | src/soc/intel/common/block/acpi/acpi_bert.c | 15 |
3 files changed, 14 insertions, 10 deletions
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index 185825bb5f86..2326169928b1 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -1565,7 +1565,10 @@ bool __weak acpi_is_boot_error_src_present(void) return false; } -__weak void acpi_soc_fill_bert(void **region, size_t *length) {} +__weak enum cb_err acpi_soc_get_bert_region(void **region, size_t *length) +{ + return CB_ERR; +} unsigned long __weak fw_cfg_acpi_tables(unsigned long start) { @@ -1815,7 +1818,7 @@ unsigned long write_acpi_tables(unsigned long start) size_t size; printk(BIOS_DEBUG, "ACPI: * BERT\n"); bert = (acpi_bert_t *) current; - acpi_soc_fill_bert(®ion, &size); + acpi_soc_get_bert_region(®ion, &size); acpi_write_bert(bert, (uintptr_t)region, size); if (bert->header.length >= sizeof(acpi_bert_t)) { current += bert->header.length; diff --git a/src/include/acpi/acpi.h b/src/include/acpi/acpi.h index dd00c405db82..7b0a7757bf91 100644 --- a/src/include/acpi/acpi.h +++ b/src/include/acpi/acpi.h @@ -1342,7 +1342,7 @@ unsigned long acpi_create_lpi_desc_ncst(acpi_lpi_desc_ncst_t *lpi_desc, uint16_t /* For crashlog. */ bool acpi_is_boot_error_src_present(void); -void acpi_soc_fill_bert(void **region, size_t *length); +enum cb_err acpi_soc_get_bert_region(void **region, size_t *length); /* For ACPI S3 support. */ void __noreturn acpi_resume(void *wake_vec); diff --git a/src/soc/intel/common/block/acpi/acpi_bert.c b/src/soc/intel/common/block/acpi/acpi_bert.c index f94026d9bcd1..168f3294b689 100644 --- a/src/soc/intel/common/block/acpi/acpi_bert.c +++ b/src/soc/intel/common/block/acpi/acpi_bert.c @@ -8,7 +8,7 @@ #include <intelblocks/crashlog.h> -void acpi_soc_fill_bert(void **region, size_t *length) +enum cb_err acpi_soc_get_bert_region(void **region, size_t *length) { acpi_generic_error_status_t *status = NULL; size_t cpu_record_size, pmc_record_size; @@ -16,19 +16,19 @@ void acpi_soc_fill_bert(void **region, size_t *length) if (!cl_get_total_data_size()) { printk(BIOS_ERR, "Error: No crashlog record present\n"); - return; + return CB_ERR; } status = bert_new_event(&CPER_SEC_FW_ERR_REC_REF_GUID); if (!status) { printk(BIOS_ERR, "Error: unable to allocate GSB\n"); - return; + return CB_ERR; } if (cl_get_total_data_size() > bert_storage_remaining()) { printk(BIOS_ERR, "Error: Crashlog entry would exceed " "available region\n"); - return; + return CB_ERR; } cpu_record_size = cl_get_cpu_record_size(); @@ -38,7 +38,7 @@ void acpi_soc_fill_bert(void **region, size_t *length) printk(BIOS_ERR, "Error: Crashlog CPU entry(size %lu) " "would exceed available region\n", cpu_record_size); - return; + return CB_ERR; } printk(BIOS_DEBUG, "cl_data %p, cpu_record_size %lu\n", cl_data, cpu_record_size); @@ -51,7 +51,7 @@ void acpi_soc_fill_bert(void **region, size_t *length) if (cpu_record_size && !bert_append_fw_err(status)) { printk(BIOS_ERR, "Error: Crashlog PMC entry would " "exceed available region\n"); - return; + return CB_ERR; } cl_data = new_cper_fw_error_crashlog(status, pmc_record_size); @@ -59,7 +59,7 @@ void acpi_soc_fill_bert(void **region, size_t *length) printk(BIOS_ERR, "Error: Crashlog PMC entry(size %lu) " "would exceed available region\n", pmc_record_size); - return; + return CB_ERR; } printk(BIOS_DEBUG, "cl_data %p, pmc_record_size %lu\n", cl_data, pmc_record_size); @@ -69,6 +69,7 @@ void acpi_soc_fill_bert(void **region, size_t *length) *length = status->raw_data_length; *region = (void *)status; + return CB_SUCCESS; } bool acpi_is_boot_error_src_present(void) |