diff options
author | Simon Glass <sjg@chromium.org> | 2023-07-16 06:39:16 +0300 |
---|---|---|
committer | Bin Meng <bmeng@tinylab.org> | 2023-07-17 12:23:15 +0300 |
commit | 92ccaf7d97b0fafd3f1b2095ac998c9bd30d8d87 (patch) | |
tree | 9dd084e7d6e5de89d5560895e1d23fc6adfc1aa0 /board/sandbox | |
parent | f52a7f05371e581d703bba6a724783aeb0ce5ac4 (diff) | |
download | u-boot-92ccaf7d97b0fafd3f1b2095ac998c9bd30d8d87.tar.xz |
sandbox: Install ACPI tables on startup
With x86 we set up the ACPI tables on startup so they can be examined. Do
the same with sandbox, so it is consistent.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'board/sandbox')
-rw-r--r-- | board/sandbox/sandbox.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c index 54c119daee..9d58860451 100644 --- a/board/sandbox/sandbox.c +++ b/board/sandbox/sandbox.c @@ -15,7 +15,9 @@ #include <init.h> #include <led.h> #include <malloc.h> +#include <mapmem.h> #include <os.h> +#include <acpi/acpi_table.h> #include <asm/global_data.h> #include <asm/test.h> #include <asm/u-boot-sandbox.h> @@ -154,6 +156,8 @@ int extension_board_scan(struct list_head *extension_list) int board_late_init(void) { struct udevice *dev; + ulong addr, end; + void *ptr; int ret; ret = uclass_first_device_err(UCLASS_CROS_EC, &dev); @@ -166,6 +170,18 @@ int board_late_init(void) panic("Cannot init cros-ec device"); return -1; } + + if (IS_ENABLED(CONFIG_GENERATE_ACPI_TABLE)) { + /* Reserve 64K for ACPI tables, aligned to a 4K boundary */ + ptr = memalign(SZ_4K, SZ_64K); + addr = map_to_sysmem(ptr); + + /* Generate ACPI tables */ + end = write_acpi_tables(addr); + gd->arch.table_start = addr; + gd->arch.table_end = addr; + } + return 0; } #endif |