Attention is currently required from: Julius Werner.
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/76071?usp=email )
Change subject: NOTFORMERGE WIP arch/arm64: Hook up ACPI table generation ......................................................................
NOTFORMERGE WIP arch/arm64: Hook up ACPI table generation
Is Linux Happy, does this work? IDK, WIP...
Signed-off-by: Arthur Heymans arthur@aheymans.xyz Change-Id: I4f60c546ec262ffb4d447fe6476844cf5a1b756d --- M src/arch/arm64/Kconfig M src/arch/arm64/tables.c 2 files changed, 21 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/76071/1
diff --git a/src/arch/arm64/Kconfig b/src/arch/arm64/Kconfig index 588e8ce..98d05ef 100644 --- a/src/arch/arm64/Kconfig +++ b/src/arch/arm64/Kconfig @@ -58,4 +58,7 @@ linker workaround to avoid those cases if your toolchain supports it. Should be selected automatically by SoCs that are affected.
+config MAX_ACPI_TABLE_SIZE_KB + default 144 + endif # if ARCH_ARM64 diff --git a/src/arch/arm64/tables.c b/src/arch/arm64/tables.c index b97297c..0ac6b9d 100644 --- a/src/arch/arm64/tables.c +++ b/src/arch/arm64/tables.c @@ -1,12 +1,28 @@ /* SPDX-License-Identifier: GPL-2.0-only */
-#include <bootmem.h> -#include <boot/tables.h> +#include <acpi/acpi.h> +#include <assert.h> #include <boot/coreboot_tables.h> +#include <boot/tables.h> +#include <bootmem.h> +#include <cbmem.h> #include <symbols.h>
+static void write_acpi_table(void) +{ + const size_t max_acpi_size = CONFIG_MAX_ACPI_TABLE_SIZE_KB * KiB; + const uintptr_t acpi_start = (uintptr_t)cbmem_add(CBMEM_ID_ACPI, max_acpi_size); + assert(IS_ALIGNED(acpi_start, 16)); + const uintptr_t acpi_end = write_acpi_tables(acpi_start); + if (acpi_end - acpi_start > max_acpi_size) + printk(BIOS_ERR, "Increase ACPI size\n"); + printk(BIOS_DEBUG, "ACPI tables: %ld bytes.\n", acpi_end - acpi_start); +} + void arch_write_tables(uintptr_t coreboot_table) { + if (CONFIG(HAVE_ACPI_TABLES)) + write_acpi_table(); }
void bootmem_arch_add_ranges(void)