arch/arm64: Hook up ACPI table generation
Linux v6.3.5 is able to detect and use ACPI tables on an out of tree target using hacked version of u-boot to pass ACPI through UEFI. Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Change-Id: I4f60c546ec262ffb4d447fe6476844cf5a1b756d Reviewed-on: https://review.coreboot.org/c/coreboot/+/76071 Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
This commit is contained in:
parent
fbb612f6d2
commit
f3aa88a51c
|
@ -81,3 +81,9 @@ config ACPI_GTDT
|
||||||
depends on HAVE_ACPI_TABLES
|
depends on HAVE_ACPI_TABLES
|
||||||
help
|
help
|
||||||
Selected by platforms that implement ARM generic timers
|
Selected by platforms that implement ARM generic timers
|
||||||
|
|
||||||
|
config MAX_ACPI_TABLE_SIZE_KB
|
||||||
|
int
|
||||||
|
default 144
|
||||||
|
help
|
||||||
|
Set the maximum size of all ACPI tables in KiB.
|
||||||
|
|
|
@ -1,12 +1,27 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <bootmem.h>
|
#include <acpi/acpi.h>
|
||||||
#include <boot/tables.h>
|
#include <assert.h>
|
||||||
#include <boot/coreboot_tables.h>
|
#include <boot/coreboot_tables.h>
|
||||||
|
#include <boot/tables.h>
|
||||||
|
#include <bootmem.h>
|
||||||
|
#include <cbmem.h>
|
||||||
#include <symbols.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);
|
||||||
|
assert(acpi_end < acpi_start + max_acpi_size);
|
||||||
|
printk(BIOS_DEBUG, "ACPI tables: %ld bytes.\n", acpi_end - acpi_start);
|
||||||
|
}
|
||||||
|
|
||||||
void arch_write_tables(uintptr_t coreboot_table)
|
void arch_write_tables(uintptr_t coreboot_table)
|
||||||
{
|
{
|
||||||
|
if (CONFIG(HAVE_ACPI_TABLES))
|
||||||
|
write_acpi_table();
|
||||||
}
|
}
|
||||||
|
|
||||||
void bootmem_arch_add_ranges(void)
|
void bootmem_arch_add_ranges(void)
|
||||||
|
|
|
@ -298,12 +298,6 @@ config MAX_PIRQ_LINKS
|
||||||
table specifies links greater than 4, pirq_route_irqs will not
|
table specifies links greater than 4, pirq_route_irqs will not
|
||||||
function properly, unless this variable is correctly set.
|
function properly, unless this variable is correctly set.
|
||||||
|
|
||||||
config MAX_ACPI_TABLE_SIZE_KB
|
|
||||||
int
|
|
||||||
default 144
|
|
||||||
help
|
|
||||||
Set the maximum size of all ACPI tables in KiB.
|
|
||||||
|
|
||||||
config MEMLAYOUT_LD_FILE
|
config MEMLAYOUT_LD_FILE
|
||||||
string
|
string
|
||||||
default "src/arch/x86/memlayout.ld"
|
default "src/arch/x86/memlayout.ld"
|
||||||
|
|
Loading…
Reference in New Issue