blob: f20a4546b30263b40cefa71e9553ddb163942740 [file] [log] [blame]
Felix Heldf0c52762021-05-28 17:59:09 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#include <acpi/acpi.h>
4#include <arch/bert_storage.h>
5#include <console/console.h>
6#include <types.h>
7
8enum cb_err acpi_soc_get_bert_region(void **region, size_t *length)
9{
10 /*
11 * Skip the table if no errors are present. ACPI driver reports
12 * a table with a 0-length region:
13 * BERT: [Firmware Bug]: table invalid.
14 */
15 if (!bert_should_generate_acpi_table())
16 return CB_ERR;
17
18 bert_errors_region(region, length);
Felix Held5d084dd2021-06-15 19:29:37 +020019 if (!*region) {
Julius Wernere9665952022-01-21 17:06:20 -080020 printk(BIOS_ERR, "Can't find BERT storage area\n");
Felix Heldf0c52762021-05-28 17:59:09 +020021 return CB_ERR;
22 }
23
24 return CB_SUCCESS;
25}