[Concept,00/20] efi: App and devicetree improvements

Message ID 20250828020732.981415-1-sjg@u-boot.org
Headers
Series efi: App and devicetree improvements |

Message

Simon Glass Aug. 28, 2025, 2:07 a.m. UTC
  From: Simon Glass <sjg@chromium.org>


This series improves U-Boot's EFI app support and adds new functionality
for managing devicetree reserved-memory regions.

The main focus is on enhancing memory management when running as an EFI
application. A new mechanism is introduced to sync EFI reserved-memory
regions (such as runtime services and ACPI tables) with the devicetree's
/reserved-memory nodes. This ensures that Linux doesn't inadvertently use
memory regions that EFI firmware has reserved.

The main improvements are:

- New 'fdt reserved' command to display devicetree reserved-memory regions
- New 'efi memsync' command to synchronize EFI memory map with devicetree
- Enhance EFI application support with better memory region handling
- Improve EFI debugging commands and device path handling
- Better integrate EFI boot services and devicetree setup

There are a few other minor thigns:
- Enhance efidebug commands with media device and driver information
- Expose EFI device-paths in a few places in bootstd
- Improve bootflow device reporting
- ARM-specific fixes for exception level handling

This series addresses many of the issues found in booting Linux on
Qualcomm X-Elite laptops using the EFI app.


Simon Glass (20):
  efi: Set the efi_media device name when binding
  efi: app: Avoid switching exception levels on ARM
  efi: app: Avoid freeing memory on exit
  efi: Add a way to show media devices
  efi: Add all messaging types for device paths
  efi: Convert a device-path to a uclass and name
  efi: Add a uclass column to efidebug media command
  efi: Implement efidebug show drivers in the app
  boot: Correct filename in bootmeth_common_read_file()
  boot: Show the device path for EFI bootflows
  boot: Show the underlying bootflow device in the app
  efi: Use abuf when reading EFI variables
  efi: Add a command to help with shim
  efi: Add an efi subcommand to show the loaded image
  fdt: Add a function to show the reserved-memory nodes
  fdt: Add a command to show reserved-memory regions
  efi: Provide a way to sync EFI reserved-memory to fdt
  fdt: Provide a command to sync the reserve-memory node
  efi: app: Add a simple-framebuffer node if enabled
  efi: app: Sync EFI reserved-memory to the devicetree

 boot/bootmeth-uclass.c        |   2 +-
 boot/fdt_support.c            |  54 ++++++++
 cmd/Kconfig                   |   9 ++
 cmd/Makefile                  |   1 +
 cmd/bootflow.c                |  38 +++++-
 cmd/efi.c                     |  37 ++++-
 cmd/efidebug.c                |  73 +++++++---
 cmd/fdt.c                     |   7 +-
 cmd/nvedit_efi.c              |  62 ++++++---
 cmd/shim.c                    |  65 +++++++++
 doc/usage/cmd/efi.rst         |  50 +++++++
 doc/usage/cmd/efidebug.rst    |  24 +++-
 doc/usage/cmd/fdt.rst         |  26 ++++
 doc/usage/cmd/shim.rst        | 101 ++++++++++++++
 doc/usage/index.rst           |   1 +
 include/efi.h                 |  51 +++++++
 include/efi_api.h             |  20 ++-
 include/efi_device_path.h     |  25 ++++
 include/fdt_support.h         |   7 +
 include/shim.h                |  13 ++
 lib/efi/device_path.c         | 125 +++++++++++++++++
 lib/efi_client/app_run.c      |  21 ++-
 lib/efi_client/efi.c          | 249 +++++++++++++++++++++++++++++++++-
 lib/efi_client/efi_app.c      |  12 +-
 lib/efi_client/efi_app_init.c |  21 ++-
 test/cmd/fdt.c                |  40 ++++++
 26 files changed, 1072 insertions(+), 62 deletions(-)
 create mode 100644 cmd/shim.c
 create mode 100644 doc/usage/cmd/shim.rst
 create mode 100644 include/shim.h