From 2e7e2d978bb2cc29b8b0335d46b3ed90ed36bbcc Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Thu, 3 Mar 2022 22:28:27 +0100 Subject: coreboot_tables.c: Expose the ACPI RSDP The ACPI RSDP can only be found in: - legacy BIOS region - via UEFI service On some systems like ARM that legacy BIOS region is not an option, so to avoid needing UEFI it makes sense to expose the RSDP via a coreboot table entry. This also adds the respective unit test. Change-Id: I591312a2c48f0cbbb03b2787e4b365e9c932afff Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/62573 Reviewed-by: Lance Zhao Reviewed-by: Angel Pons Reviewed-by: Nico Huber Reviewed-by: Tim Wawrzynczak Tested-by: build bot (Jenkins) --- tests/lib/coreboot_table-test.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/lib/coreboot_table-test.c b/tests/lib/coreboot_table-test.c index f9d963de2d..a50dd15d08 100644 --- a/tests/lib/coreboot_table-test.c +++ b/tests/lib/coreboot_table-test.c @@ -210,6 +210,12 @@ void arch_write_tables(uintptr_t coreboot_table) { } +static const uintptr_t ebda_base = 0xf0000; +uintptr_t get_coreboot_rsdp(void) +{ + return ebda_base; +} + struct resource mock_bootmem_ranges[] = { {.base = 0x1000, .size = 0x2000, .flags = LB_MEM_RAM}, {.base = 0x0000, .size = 0x4000, .flags = LB_MEM_RAM}, @@ -476,6 +482,12 @@ static void test_write_tables(void **state) assert_int_equal(ram_code(), board_config->ram_code); assert_int_equal(sku_id(), board_config->sku_id); break; + case LB_TAG_ACPI_RSDP: + assert_int_equal(sizeof(struct lb_acpi_rsdp), record->size); + + const struct lb_acpi_rsdp *acpi_rsdp = (struct lb_acpi_rsdp *)record; + assert_int_equal(ebda_base, unpack_lb64(acpi_rsdp->rsdp_pointer)); + break; default: fail_msg("Unexpected tag found in record. Tag ID: 0x%x", record->tag); } -- cgit v1.2.3