This directory was created when U-Boot gained the ability to run as an EFI app in 2015. Since then the EFI-loader feature has been added.
The code in lib/efi is not actually used by the loader, so the name is confusing. Rename the directory to efi_client to indicate that it includes files just for U-Boot being a client of EFI, i.e. the EFI app and stub. Signed-off-by: Simon Glass <s...@chromium.org> --- MAINTAINERS | 2 +- Makefile | 4 ++-- doc/develop/uefi/u-boot_on_efi.rst | 8 ++++---- lib/Makefile | 2 +- lib/{efi => efi_client}/Kconfig | 0 lib/{efi => efi_client}/Makefile | 0 lib/{efi => efi_client}/efi.c | 0 lib/{efi => efi_client}/efi_app.c | 0 lib/{efi => efi_client}/efi_app_init.c | 0 lib/{efi => efi_client}/efi_dtb.S | 0 lib/{efi => efi_client}/efi_info.c | 0 lib/{efi => efi_client}/efi_stub_arm64.c | 0 lib/{efi => efi_client}/efi_stub_x86.c | 0 lib/{efi => efi_client}/efi_vars.c | 0 lib/{efi => efi_client}/sdram.c | 0 lib/efi_loader/Kconfig | 2 +- 16 files changed, 9 insertions(+), 9 deletions(-) rename lib/{efi => efi_client}/Kconfig (100%) rename lib/{efi => efi_client}/Makefile (100%) rename lib/{efi => efi_client}/efi.c (100%) rename lib/{efi => efi_client}/efi_app.c (100%) rename lib/{efi => efi_client}/efi_app_init.c (100%) rename lib/{efi => efi_client}/efi_dtb.S (100%) rename lib/{efi => efi_client}/efi_info.c (100%) rename lib/{efi => efi_client}/efi_stub_arm64.c (100%) rename lib/{efi => efi_client}/efi_stub_x86.c (100%) rename lib/{efi => efi_client}/efi_vars.c (100%) rename lib/{efi => efi_client}/sdram.c (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 3dae1c618ba..ec8cafac13c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1073,7 +1073,7 @@ F: configs/efi-x86_app* F: doc/develop/uefi/u-boot_on_efi.rst F: drivers/block/efi-media-uclass.c F: drivers/block/sb_efi_media.c -F: lib/efi/ +F: lib/efi_client/ F: scripts/build-efi F: test/dm/efi_media.c diff --git a/Makefile b/Makefile index 24b8076f468..5cde0955cfc 100644 --- a/Makefile +++ b/Makefile @@ -1687,8 +1687,8 @@ EFI_STUB_ARCH := $(if $(CONFIG_ARM64),arm64,$(if $(CONFIG_X86_64),x86,$(ARCH))) quiet_cmd_u-boot_payload ?= LD $@ cmd_u-boot_payload ?= $(LD) $(LDFLAGS_EFI_PAYLOAD) -o $@ \ -T u-boot-payload.lds $(if $(CONFIG_X86),arch/x86/cpu/call32.o,) \ - lib/efi/efi.o lib/efi/efi_stub_$(EFI_STUB_ARCH).o u-boot.bin.o \ - $(addprefix arch/$(ARCH)/lib/,$(EFISTUB)) + lib/efi_client/efi.o lib/efi_client/efi_stub_$(EFI_STUB_ARCH).o \ + u-boot.bin.o $(addprefix arch/$(ARCH)/lib/,$(EFISTUB)) quiet_cmd_u-boot_payload_arm64.efi ?= OBJCOPY $@ cmd_u-boot_payload_arm64.efi ?= $(OBJCOPY) -O binary u-boot-payload $@ diff --git a/doc/develop/uefi/u-boot_on_efi.rst b/doc/develop/uefi/u-boot_on_efi.rst index e9f8e9c297c..ba3b3f501f1 100644 --- a/doc/develop/uefi/u-boot_on_efi.rst +++ b/doc/develop/uefi/u-boot_on_efi.rst @@ -113,7 +113,7 @@ implemented completely differently. EFI Application ~~~~~~~~~~~~~~~ For the application the whole of U-Boot is built as a shared library. The -efi_main() function is in lib/efi/efi_app.c. It sets up some basic EFI +efi_main() function is in lib/efi_client/efi_app.c. It sets up some basic EFI functions with efi_init(), sets up U-Boot global_data, allocates memory for U-Boot's malloc(), etc. and enters the normal init sequence (board_init_f() and board_init_r()). @@ -149,7 +149,7 @@ image (including device tree) into a small EFI stub application responsible for booting it. The stub application is built as a normal EFI application except that it has a lot of data attached to it. -The stub application is implemented in lib/efi/efi_stub.c. The efi_main() +The stub application is implemented in lib/efi_client/efi_stub.c. The efi_main() function is called by EFI. It is responsible for copying U-Boot from its original location into memory, disabling EFI boot services and starting U-Boot. U-Boot then starts as normal, relocates, starts all drivers, etc. @@ -192,7 +192,7 @@ careful to build the correct one so that your UEFI firmware can start it. Most UEFI images are 64-bit at present. The payload stub can be build as either 32- or 64-bits. Only a small amount -of code is built this way (see the extra- line in lib/efi/Makefile). +of code is built this way (see the extra- line in lib/efi_client/Makefile). Everything else is built as a normal U-Boot, so is always 32-bit on x86 at present. @@ -353,7 +353,7 @@ This work could be extended in a number of ways: Where is the code? ------------------ -lib/efi +lib/efi_client payload stub, application, support code. Mostly arch-neutral arch/x86/cpu/efi diff --git a/lib/Makefile b/lib/Makefile index 30b1933b8ef..95f11903d57 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -5,7 +5,7 @@ ifndef CONFIG_XPL_BUILD -obj-$(CONFIG_EFI) += efi/ +obj-$(CONFIG_EFI) += efi_client/ obj-$(CONFIG_EFI_LOADER) += efi_driver/ obj-$(CONFIG_EFI_LOADER) += efi_loader/ obj-$(CONFIG_CMD_BOOTEFI_SELFTEST) += efi_selftest/ diff --git a/lib/efi/Kconfig b/lib/efi_client/Kconfig similarity index 100% rename from lib/efi/Kconfig rename to lib/efi_client/Kconfig diff --git a/lib/efi/Makefile b/lib/efi_client/Makefile similarity index 100% rename from lib/efi/Makefile rename to lib/efi_client/Makefile diff --git a/lib/efi/efi.c b/lib/efi_client/efi.c similarity index 100% rename from lib/efi/efi.c rename to lib/efi_client/efi.c diff --git a/lib/efi/efi_app.c b/lib/efi_client/efi_app.c similarity index 100% rename from lib/efi/efi_app.c rename to lib/efi_client/efi_app.c diff --git a/lib/efi/efi_app_init.c b/lib/efi_client/efi_app_init.c similarity index 100% rename from lib/efi/efi_app_init.c rename to lib/efi_client/efi_app_init.c diff --git a/lib/efi/efi_dtb.S b/lib/efi_client/efi_dtb.S similarity index 100% rename from lib/efi/efi_dtb.S rename to lib/efi_client/efi_dtb.S diff --git a/lib/efi/efi_info.c b/lib/efi_client/efi_info.c similarity index 100% rename from lib/efi/efi_info.c rename to lib/efi_client/efi_info.c diff --git a/lib/efi/efi_stub_arm64.c b/lib/efi_client/efi_stub_arm64.c similarity index 100% rename from lib/efi/efi_stub_arm64.c rename to lib/efi_client/efi_stub_arm64.c diff --git a/lib/efi/efi_stub_x86.c b/lib/efi_client/efi_stub_x86.c similarity index 100% rename from lib/efi/efi_stub_x86.c rename to lib/efi_client/efi_stub_x86.c diff --git a/lib/efi/efi_vars.c b/lib/efi_client/efi_vars.c similarity index 100% rename from lib/efi/efi_vars.c rename to lib/efi_client/efi_vars.c diff --git a/lib/efi/sdram.c b/lib/efi_client/sdram.c similarity index 100% rename from lib/efi/sdram.c rename to lib/efi_client/sdram.c diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 01447ae9f7a..9c67cf55283 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -608,6 +608,6 @@ config BOOTEFI_TESTAPP_COMPILE endif -source "lib/efi/Kconfig" +source "lib/efi_client/Kconfig" endmenu -- 2.43.0