[PATCH v5 11/20] efi: x86: Correct the condition for installing ACPI tables

Heinrich Schuchardt xypron.glpk at gmx.de
Wed Nov 15 12:09:04 CET 2023


On 9/20/23 05:00, Simon Glass wrote:
> It is not always the case that U-Boot builds the ACPI tables itself. For
> example, when booting from coreboot, the ACPI tables are built by
> coreboot.
>
> Correct the Makefile condition so that U-Boot can pass on tables built
> by a previous firmware stage.
>
> Tidy up the installation-condition code while we are here.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> Reviewed-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
> Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
> ---
>
> (no changes since v2)
>
> Changes in v2:
> - Add new patch
>
>   lib/efi_loader/Makefile    |  2 +-
>   lib/efi_loader/efi_setup.c | 10 +++++-----
>   2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
> index 1a8c8d7cab5c..0eb748ff1a59 100644
> --- a/lib/efi_loader/Makefile
> +++ b/lib/efi_loader/Makefile
> @@ -78,7 +78,7 @@ obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
>   obj-$(CONFIG_VIDEO) += efi_gop.o
>   obj-$(CONFIG_BLK) += efi_disk.o
>   obj-$(CONFIG_NETDEVICES) += efi_net.o
> -obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o
> +obj-$(CONFIG_ACPI) += efi_acpi.o

This change merged as
53e8e6f98679 ("efi: x86: Correct the condition for installing ACPI tables")
looks wrong:

For QEMU with CONFIG_ACPI=y and CONFIG_GENERATE_ACPI=n I get

     EFI using ACPI tables at 0
     Error: Cannot initialize UEFI sub-system, r = 14

Device-trees are only suppressed in the bootefi command if
CONFIG_GENERATE_ACPI=y.

Currently CONFIG_ACPI=y only indicates that ACPI libraries are built. It
does not indicate that ACPI tables exist on the platform.

Best regards

Heinrich


>   obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += efi_smbios.o
>   obj-$(CONFIG_EFI_RNG_PROTOCOL) += efi_rng.o
>   obj-$(CONFIG_EFI_TCG2_PROTOCOL) += efi_tcg2.o
> diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
> index 58d4e1340233..ad719afd6328 100644
> --- a/lib/efi_loader/efi_setup.c
> +++ b/lib/efi_loader/efi_setup.c
> @@ -321,11 +321,11 @@ efi_status_t efi_init_obj_list(void)
>   	if (ret != EFI_SUCCESS)
>   		goto out;
>   #endif
> -#ifdef CONFIG_GENERATE_ACPI_TABLE
> -	ret = efi_acpi_register();
> -	if (ret != EFI_SUCCESS)
> -		goto out;
> -#endif
> +	if (IS_ENABLED(CONFIG_ACPI)) {
> +		ret = efi_acpi_register();
> +		if (ret != EFI_SUCCESS)
> +			goto out;
> +	}
>   #ifdef CONFIG_GENERATE_SMBIOS_TABLE
>   	ret = efi_smbios_register();
>   	if (ret != EFI_SUCCESS)



More information about the U-Boot mailing list