[gbl] Implement GBL EFI Boot Memory protocol

Implement GblEfiBootMemoryProtocol to provide kernel and FDT boot
buffers to GBL based on U-Boot environment variables ('loadaddr',
'loadsize', 'fdtaddr').

To ensure safety against dynamic memory allocations in GBL, reserve
the kernel and FDT memory ranges in the EFI memory map (as
EFI_BOOT_SERVICES_DATA) immediately upon protocol registration,
preventing UEFI page allocation overlap. Also validate that environment
variables have not changed when GBL queries get_boot_buffer.

TAG=agy
CONV=236c2e4e-69e4-48b6-a8ea-8986bc68bb04

Change-Id: Icb61b5618c0697a7fde25e44212cca4451f87c04
Reviewed-on: https://turquoise-internal-review.googlesource.com/c/third_party/u-boot/+/1370272
Commit-Queue: Sergii Parubochyi <sergiip@google.com>
Reviewed-by: David Pursell <dpursell@google.com>
GitOrigin-RevId: 51dd525ff405e606538780047562b3bf488ea55e
5 files changed
tree: fa4935789c10f4ae865d6dcd743ac367ad9fe732
  1. api/
  2. arch/
  3. bl2/
  4. bl30/
  5. bl31/
  6. bl31_1.3/
  7. board/
  8. common/
  9. configs/
  10. disk/
  11. doc/
  12. drivers/
  13. dts/
  14. examples/
  15. fip/
  16. fs/
  17. include/
  18. lib/
  19. Licenses/
  20. net/
  21. post/
  22. scripts/
  23. test/
  24. tools/
  25. vim3_aml_tools/
  26. .checkpatch.conf
  27. .clang-format
  28. .gitignore
  29. .mailmap
  30. amlogic_help.sh
  31. check_compile.sh
  32. config.mk
  33. fuchsia_build.py
  34. fuchsia_upload.py
  35. Kbuild
  36. Kconfig
  37. MAINTAINERS
  38. MAKEALL
  39. Makefile
  40. mk
  41. README
  42. README.md
  43. snapshot.commit
README.md

This is a version of u-boot, modified to support Fuchsia on the Khadas vim3

Building vim3 Bootloader for Fuchsia

To build the vim3 bootloader for Fuchsia:

CIPD access. All build tools are downloaded to cipd_deps.

Run the build script from repo root

./fuchsia_build.py

Options:

  • --clean-cipd option can be used to make sure CIPD checkout is clean. It will remove cipd_deps directory and download dependencies again.
  • --gbl-path <path> option specifies a path to a local GBL (gbl.efi) binary. If provided, CIPD GBL is not used; otherwise, the script downloads GBL from CIPD and uses gbl_aarch64_dev.efi.

You now have a build/u-boot.bin.unsigned that you can flash to a target using fastboot.

Releasing and Uploading

go/fuchsia-firmware-licensing-publishing