[PATCH v9 0/9] efi: Improvements to U-Boot running on top of UEFI

Simon Glass sjg at chromium.org
Tue Jan 4 11:51:09 CET 2022


At present U-Boot can be built as an EFI app, but it is really just for
testing, with very few features. Instead, the payload build is used for
booting on top of UEFI, where U-Boot takes over the machine immediately
and supplies its own drivers.

But the app could be made more useful.

This series provides access to EFI block devices and the video console
within U-Boot. It also restructures the app to make it possible to boot
a kernel, although further work is needed to implement this.

This can be thought of as making U-Boot perform a little like 'grub', in
that it runs purely based on UEFI-provided services.

Of course a lot more work is required, but this is a start.

Note: It would be very useful to include qemu tests of the app and stub
in CI.

This is available at u-boot-dm/efi-working

Changes in v9:
- Add a comment as to why printf() cannot be used
- Comment out storing the EFI memory map in the app and update commit message
- Drop changes previously applied

Changes in v8:
- Add new patch to tidy up header comments

Changes in v7:
- Rebase on -master instead of -next

Changes in v6:
- Fix typo in function comment

Changes in v5:
- Add new patch to avoid using the 64-bit link script for the EFI app
- Add new patch to build the 64-bit app properly
- Add new patch to round out the link script for 64-bit EFI
- Add new patch to set the correct link flags for the 64-bit EFI app
- Add new patch to tweak the code used for the 64-bit EFI app
- Add various patches to fix up the 64-bit app so that it boots

Changes in v2:
- Add a sentence about what the patch does
- Add new patch to support the efi command in the app

Simon Glass (9):
  efi: Move exit_boot_services into a function
  x86: efi: Update efi_get_next_mem_desc() to avoid needing a map
  efi: Support the efi command in the app
  x86: efi: Tweak the code used for the 64-bit EFI app
  x86: efi: Round out the link script for 64-bit EFI
  x86: efi: Don't use the 64-bit link script for the EFI app
  x86: efi: Set the correct link flags for the 64-bit EFI app
  efi: Build the 64-bit app properly
  efi: Tidy up some comments in efi header

 Makefile                        |  4 +-
 arch/x86/config.mk              | 15 +++++--
 arch/x86/cpu/config.mk          |  2 +-
 arch/x86/cpu/efi/payload.c      |  8 ++--
 arch/x86/cpu/x86_64/cpu.c       |  5 +++
 arch/x86/lib/Makefile           |  5 +--
 arch/x86/lib/elf_x86_64_efi.lds |  5 ++-
 arch/x86/lib/relocate.c         |  2 +
 cmd/Makefile                    |  2 +-
 cmd/efi.c                       | 78 +++++++++++++++++++++------------
 include/efi.h                   | 64 +++++++++++++++++++++++----
 lib/efi/efi.c                   | 72 ++++++++++++++++++++++++++++++
 lib/efi/efi_app.c               | 42 ++++++++++++++++++
 lib/efi/efi_stub.c              | 66 +++++-----------------------
 14 files changed, 263 insertions(+), 107 deletions(-)

-- 
2.34.1.448.ga2b2bfdf31-goog



More information about the U-Boot mailing list