summaryrefslogtreecommitdiff
path: root/src/soc/intel
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-05-28 16:11:43 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-06-08 18:22:01 +0000
commitfba479267b0294f3d6cf43bf751ffd3dc300cf25 (patch)
treedb3f73ad63514b14fff7af255edc26570b3dcf91 /src/soc/intel
parent24b1c54226d5a676547c5b0203dd5787fa5a1143 (diff)
acpi: rework BERT ACPI table generation logic
Check if the ACPI_BERT Kconfig option is selected and only then try to generate the BERT table. Also remove the acpi_is_boot_error_src_present weak function from the ACPI global compilation unit and use the return value of acpi_soc_get_bert_region to determine if there is a valid BERT region with logged errors. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I2a281f5f636010ba3b2e7e097e9cf53683022aea Reviewed-on: https://review.coreboot.org/c/coreboot/+/55054 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Diffstat (limited to 'src/soc/intel')
-rw-r--r--src/soc/intel/common/block/acpi/acpi_bert.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/src/soc/intel/common/block/acpi/acpi_bert.c b/src/soc/intel/common/block/acpi/acpi_bert.c
index 168f3294b6..d35c6c01aa 100644
--- a/src/soc/intel/common/block/acpi/acpi_bert.c
+++ b/src/soc/intel/common/block/acpi/acpi_bert.c
@@ -7,6 +7,25 @@
#include <intelblocks/acpi.h>
#include <intelblocks/crashlog.h>
+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;
+ }
+
+ collect_pmc_and_cpu_crashlog_from_srams();
+
+ /* Discovery tables sizes can be larger than the actual valid collected data */
+ u32 crashlog_size = cl_get_total_data_size();
+
+ return (crashlog_size > 0);
+}
enum cb_err acpi_soc_get_bert_region(void **region, size_t *length)
{
@@ -14,6 +33,10 @@ enum cb_err acpi_soc_get_bert_region(void **region, size_t *length)
size_t cpu_record_size, pmc_record_size;
void *cl_data = NULL;
+ if (!boot_error_src_present()) {
+ return CB_ERR;
+ }
+
if (!cl_get_total_data_size()) {
printk(BIOS_ERR, "Error: No crashlog record present\n");
return CB_ERR;
@@ -71,24 +94,3 @@ enum cb_err acpi_soc_get_bert_region(void **region, size_t *length)
return CB_SUCCESS;
}
-
-bool acpi_is_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;
- }
-
- collect_pmc_and_cpu_crashlog_from_srams();
-
- /* Discovery tables sizes can be larger than the actual valid collected data */
- u32 crashlog_size = cl_get_total_data_size();
-
- return (crashlog_size > 0);
-}