[PATCH v2 00/35] vbe: Verified Boot for Embedded initial support

Simon Glass sjg at chromium.org
Sat Jul 30 23:52:02 CEST 2022


This adds the concept of a VBE method to U-Boot, along with an
implementation of the 'VBE simple' method, basically a simple way of
updating firmware in MMC from userspace and monitoring it from U-Boot.

VBE simple is implemented in fwupd. U-Boot's role is to set up the
device tree with the required firmware-update properties and provide the
developer with information about the current VBE state. To that end this
series includes a new 'vbe' command that allows VBE methods to be listed
and examined.

As part of this work, support for doing FDT fixups via the event interface
is provided, along with the ability to write to the device tree via the
ofnode interface.

Another (significant) change is that bootmeths now have a 'global' flag,
to allow the implementation of EFI bootmgr (and VBE) to be cleaned up.
The 'system' bootdev is no-longer needed and these bootmeths are scanned
first.

Further work is needed to pull everything together, but this is a step
along the way.

Changes in v2:
- Add new patch with some documentation and links for VBE
- Add a reference to VBE documentation in the header file and commit
- Make VBE a global bootmeth
- Introduce the concept of global bootmeths (various patches)
- Correct the clang / LTO / event bug from v1

Simon Glass (35):
  vbe: Add some documentation
  video: Renname vbe.h to vesa.h
  video: Rename structs and functions to avoid VBE
  dm: core: Split out the declaration of ofnode
  dm: core: Add a note about how livetree updates work
  dm: core: Introduce support for multiple trees
  dm: core: Move ofnode-writing test to ofnode
  dm: core: Swap parameters of ofnode_write_prop()
  dm: core: Tidy up ofnode-writing test
  dm: core: Prepare for updating the device tree with ofnode
  dm: core: Allow writing to a flat tree with ofnode
  dm: core: Add support for writing u32 with ofnode
  dm: core: Support sandbox with read interface
  bootstd: Drop delays in the tests
  bootstd: Fix comment in bootmeth test
  bootstd: Detect empty bootmeth ordering
  bootstd: Provide a bootmeth method to obtain state info
  bootstd: Tidy up var naming in bootdev_setup_iter_order()
  bootstd: Allow bootmeths to be marked as global
  bootstd: Allow EFI bootmgr to support an invalid bootflow
  bootstd: Allow the bootdev to be optional in bootflows
  bootstd: Tidy comments in bootflow_scan_bootdev()
  bootstd: Support bootflows with global bootmeths
  dm: core: Call dm_scan_other() when setting up for tests
  bootstd: Allow scanning for global bootmeths separately
  bootstd: Always create the EFI bootmgr bootmeth
  bootstd: Drop the system bootdev
  event: Change EVENT_SPY to global
  event: Add an event for device tree fixups
  vbe: Add initial support for VBE
  vbe: Support VBE simple
  bootstd: Add vbe bootmeth into sandbox
  bootstd: Update documentation
  bootstd: Check building without global bootmeths
  vbe: Add a new vbe command

 arch/sandbox/dts/sandbox.dtsi         |  13 ++
 arch/sandbox/dts/test.dts             |  15 ++
 arch/sandbox/include/asm/test.h       |  11 +
 arch/x86/lib/bios.c                   |  12 +-
 arch/x86/lib/coreboot_table.c         |   2 +-
 arch/x86/lib/fsp/fsp_graphics.c       |   4 +-
 boot/Kconfig                          |  29 +++
 boot/Makefile                         |   5 +-
 boot/bootdev-uclass.c                 |  15 +-
 boot/bootflow.c                       |  63 +++++-
 boot/bootmeth-uclass.c                | 105 +++++++--
 boot/bootmeth_distro.c                |  14 ++
 boot/bootmeth_efi_mgr.c               |  35 ++-
 boot/bootstd-uclass.c                 |  13 +-
 boot/image-fdt.c                      |  11 +
 boot/system_bootdev.c                 |  66 ------
 boot/vbe.c                            | 119 ++++++++++
 boot/vbe_simple.c                     | 315 ++++++++++++++++++++++++++
 cmd/Kconfig                           |  10 +
 cmd/Makefile                          |   1 +
 cmd/bootflow.c                        |  12 +-
 cmd/bootmeth.c                        |   4 +-
 cmd/elf.c                             |   2 +-
 cmd/read.c                            |   3 +-
 cmd/vbe.c                             |  87 +++++++
 common/event.c                        |   3 +
 configs/sandbox_flattree_defconfig    |   2 +
 doc/develop/bootstd.rst               |  89 +++++---
 doc/develop/driver-model/livetree.rst |  60 ++++-
 doc/develop/index.rst                 |   1 +
 doc/develop/vbe.rst                   |  26 +++
 doc/usage/cmd/bootmeth.rst            |   9 +-
 drivers/bios_emulator/atibios.c       |  18 +-
 drivers/core/of_access.c              |  57 ++++-
 drivers/core/ofnode.c                 |  81 +++----
 drivers/pci/pci_rom.c                 |  14 +-
 drivers/video/broadwell_igd.c         |   4 +-
 drivers/video/coreboot.c              |   4 +-
 drivers/video/efi.c                   |   4 +-
 drivers/video/ivybridge_igd.c         |   4 +-
 drivers/video/vesa.c                  |   4 +-
 include/bios_emul.h                   |   6 +-
 include/bootflow.h                    |  20 +-
 include/bootmeth.h                    |  65 +++++-
 include/bootstd.h                     |   2 +
 include/dm/of_access.h                |  22 +-
 include/dm/ofnode.h                   | 122 +++++-----
 include/dm/ofnode_decl.h              |  85 +++++++
 include/event.h                       |  21 +-
 include/of_live.h                     |  16 ++
 include/test/test.h                   |   2 +
 include/vbe.h                         | 147 ++++--------
 include/vesa.h                        | 116 ++++++++++
 lib/efi_loader/Kconfig                |   1 +
 lib/elf.c                             |   2 +-
 lib/of_live.c                         |  14 +-
 test/boot/Makefile                    |   4 +
 test/boot/bootflow.c                  | 106 +++++++--
 test/boot/bootmeth.c                  |  55 ++++-
 test/boot/vbe_simple.c                | 115 ++++++++++
 test/dm/ofnode.c                      | 132 +++++++++++
 test/dm/test-fdt.c                    |  53 -----
 test/py/tests/test_event_dump.py      |   1 +
 test/test-main.c                      |   7 +-
 64 files changed, 1930 insertions(+), 530 deletions(-)
 delete mode 100644 boot/system_bootdev.c
 create mode 100644 boot/vbe.c
 create mode 100644 boot/vbe_simple.c
 create mode 100644 cmd/vbe.c
 create mode 100644 doc/develop/vbe.rst
 create mode 100644 include/dm/ofnode_decl.h
 create mode 100644 include/vesa.h
 create mode 100644 test/boot/vbe_simple.c

-- 
2.37.1.455.g008518b4e5-goog



More information about the U-Boot mailing list