[U-Boot] [PATCH v10 00/10] efi: Enable sandbox support for EFI loader

Simon Glass sjg at chromium.org
Sat Sep 15 06:50:51 UTC 2018


A limitation of the EFI loader at present is that it does not build with
sandbox. This makes it hard to write tests, since sandbox is used for most
testing in U-Boot.

This series enables the EFI loader feature. It allows sandbox to build and
run a trivial function which calls the EFI API to output a message.

Also included in v8 is support for running the full EFI self tests. These
run OK with some tweaks to a few parts of the code.

With v9, various EFI patches have been applied which change things. This
series includes a partial review of one, which makes 'bootefi test' work.
But there are still problems with 'bootefi selftest':

As of v10 two selftests fail. I fixed another one in this series. I think
have removed all paches not essential to getting things running. The
refactoring patches will be sent separately once these are sorted out.

$ sandbox/u-boot -D -c "bootefi selftest"
...
Executing 'real time clock'
/home/sjg/c/src/third_party/u-boot/files/lib/efi_selftest/efi_selftest_rtc.c(46):
ERROR: Could not read real time clock
/home/sjg/c/src/third_party/u-boot/files/lib/efi_selftest/efi_selftest.c(109):
ERROR: Executing 'real time clock' failed

Setting up 'simple network protocol'
/home/sjg/c/src/third_party/u-boot/files/lib/efi_selftest/efi_selftest_snp.c(209):
ERROR: Failed to locate simple network protocol
/home/sjg/c/src/third_party/u-boot/files/lib/efi_selftest/efi_selftest.c(84):
ERROR: Setting up 'simple network protocol' failed

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

Changes in v10:
- Try to use compiler pre-defines to get the right settings for sandbox
- Explain the padding of the returned pointer in the commit message
- Add new patch to correct the operation of efi_file_write()
- Drop patches not essential to getting things working

Changes in v9:
- Fix 'thi' typo
- Drop fdt_end variable in efi_install_fdt()

Changes in v8:
- Rebase to master, bringing in all EFI changes
- Drop 'efi: sandbox: Add relocation constants'
- Drop 'efi: Adjust memory handling to support sandbox'
- Drop 'sandbox: smbios: Update to support sandbox'
- Expand series substantially to support bootefi selftest
- Rebase to master

Changes in v7:
- Drop an unnecessary comment
- Update patch subject s/builder/build/

Changes in v6:
- Warn about building sandbox EFI support on something other than __x86_64__

Changes in v4:
- Rebase to master
- Update SPDX tags

Changes in v3:
- Init the 'rows' and 'cols' vars to avoid a compiler error (gcc 4.8.4)
- Rebase to master

Changes in v2:
- Rebase to master

Alexander Graf (1):
  efi_loader: Pass address to fs_read()

Simon Glass (9):
  efi: sandbox: Add distroboot support
  efi: sandbox: Enable EFI loader build for sandbox
  sandbox: Align RAM buffer to the machine page size
  sandbox: Add support for calling abort()
  sandbox: Enhance map_to_sysmem() to handle foreign pointers
  efi: Relocate FDT to 127MB instead of 128MB
  efi: sandbox: Tidy up copy_fdt() to work with sandbox
  efi: Correct the operation of efi_file_write()
  efi: sandbox: Enable selftest command

 arch/sandbox/cpu/cpu.c           | 141 +++++++++++++++++++++++++++++--
 arch/sandbox/cpu/os.c            |  12 ++-
 arch/sandbox/cpu/state.c         |   8 ++
 arch/sandbox/include/asm/state.h |  21 +++++
 cmd/bootefi.c                    |  83 +++++++++++-------
 configs/sandbox_defconfig        |   1 +
 include/config_distro_bootcmd.h  |  16 ++--
 include/os.h                     |   4 +
 lib/efi_loader/Kconfig           |   2 +-
 lib/efi_loader/efi_file.c        |   5 +-
 10 files changed, 241 insertions(+), 52 deletions(-)

-- 
2.19.0.397.gdd90340f6a-goog



More information about the U-Boot mailing list