From 37bf44073bf2a51f25d82856d51ae16bc8fd8f76 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 4 May 2023 16:54:58 -0600 Subject: acpi: Move the table-finding functions into the libary This is useful for other features. Move the function into library code so it can be used outside just the 'acpi' command. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Tested-by: Bin Meng --- include/acpi/acpi_table.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/acpi/acpi_table.h b/include/acpi/acpi_table.h index 4030d25c66a..7ed0443c821 100644 --- a/include/acpi/acpi_table.h +++ b/include/acpi/acpi_table.h @@ -923,6 +923,14 @@ int acpi_fill_csrt(struct acpi_ctx *ctx); */ ulong write_acpi_tables(ulong start); +/** + * acpi_find_table() - Look up an ACPI table + * + * @sig: Signature of table (4 characters, upper case) + * Return: pointer to table header, or NULL if not found + */ +struct acpi_table_header *acpi_find_table(const char *sig); + #endif /* !__ACPI__*/ #include -- cgit v1.2.3 From 368fd5646604e6759c3beefdfed61c7a1bb0ab33 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 4 May 2023 16:54:59 -0600 Subject: x86: coreboot: Collect the address of the ACPI tables At present any ACPI tables created by prior-stage firmware are ignored. It is useful to be able to view these in U-Boot. Pick this up from the sysinfo tables and display it with the cbsysinfo command. This allows the 'acpi list' command to work when booting from coreboot. Adjust the global_data condition so that acpi_start is available even if table-generation is disabled. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Tested-by: Bin Meng --- include/asm-generic/global_data.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index 65bf8df1e56..a1e1b9d6400 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -457,7 +457,7 @@ struct global_data { */ fdt_addr_t translation_offset; #endif -#ifdef CONFIG_GENERATE_ACPI_TABLE +#ifdef CONFIG_ACPI /** * @acpi_ctx: ACPI context pointer */ @@ -536,7 +536,7 @@ static_assert(sizeof(struct global_data) == GD_SIZE); #define gd_dm_priv_base() NULL #endif -#ifdef CONFIG_GENERATE_ACPI_TABLE +#ifdef CONFIG_ACPI #define gd_acpi_ctx() gd->acpi_ctx #define gd_acpi_start() gd->acpi_start #define gd_set_acpi_start(addr) gd->acpi_start = addr -- cgit v1.2.3 From 55171aedda88d12666e2a1bbc661dea1bec65337 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 4 May 2023 16:50:45 -0600 Subject: dm: Emit the arch_cpu_init_dm() even only before relocation The original function was only called once, before relocation. The new one is called again after relocation. This was not the intent of the original call. Fix this by renaming and updating the calling logic. With this, chromebook_link64 makes it through SPL. Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events") Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/event.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/event.h b/include/event.h index e4580b68350..fe41080fa63 100644 --- a/include/event.h +++ b/include/event.h @@ -22,7 +22,7 @@ enum event_t { EVT_TEST, /* Events related to driver model */ - EVT_DM_POST_INIT, + EVT_DM_POST_INIT_F, EVT_DM_PRE_PROBE, EVT_DM_POST_PROBE, EVT_DM_PRE_REMOVE, -- cgit v1.2.3