efi: Create a new CONFIG_EFI

Create a Kconfig which indicates that EFI functionality is in use,
either as a client (EFI app / stub) or provider (EFI loader). This will
make it easier to share code between these two parts of U-Boot

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-05-28 10:03:16 -06:00
committed by Heinrich Schuchardt
parent 0029f2447b
commit 81ce639e61
4 changed files with 19 additions and 3 deletions

View File

@@ -45,9 +45,9 @@ First choose a board that has EFI support and obtain an EFI implementation
for that board. It will be either 32-bit or 64-bit. Alternatively, you can
opt for using QEMU [1] and the OVMF [2], as detailed below.
To build U-Boot as an EFI application, enable CONFIG_EFI_CLIENT and CONFIG_EFI_APP.
The efi-x86_app32 and efi-x86_app64 configs are set up for this. Just build
U-Boot as normal, e.g.::
To build U-Boot as an EFI application, enable CONFIG_EFI_CLIENT and
CONFIG_EFI_APP. The efi-x86_app32 and efi-x86_app64 configs are set up for
this. Just build U-Boot as normal, e.g.::
make efi-x86_app32_defconfig
make

12
lib/efi/Kconfig Normal file
View File

@@ -0,0 +1,12 @@
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright 2025 Simon Glass <sjg@chromium.org>
#
config EFI
bool
help
Indicates that EFI functionality is enabled, either via EFI_CLIENT or
EFI_LOADER
This is used to provide libraries shared by both.

View File

@@ -5,6 +5,7 @@ config EFI_CLIENT
bool "Support running U-Boot from EFI"
depends on X86
imply X86_TSC_READ_BASE
select EFI
help
U-Boot can be started from EFI on certain platforms. This allows
EFI to perform most of the system init and then jump to U-Boot for

View File

@@ -16,6 +16,7 @@ config EFI_LOADER
depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT
depends on !EFI_APP
default y if !ARM || SYS_CPU = armv7 || SYS_CPU = armv8
select EFI
select CHARSET
# We need to send DM events, dynamically, in the EFI block driver
select DM_EVENT
@@ -597,4 +598,6 @@ endif
source "lib/efi_client/Kconfig"
source "lib/efi/Kconfig"
endmenu