Skip to contentSkip to conversation

efi: gbl: Introduce Android GBL protocol definitions

PATCH New Dmitrii Merkurev 1 participant 3 messages Nov 24

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover efi: gbl: Introduce Android GBL protocol definitions

Android Generic Bootloader (GBL) [1] is a UEFI application from AOSP that handles the Android boot flow (A/B slots, AVB and fastboot). It runs on top of platform firmware and calls into it for board-specific operations via GBL UEFI protocols. EDK2 EmbeddedPkg already carries these headers (commit dfaa76349d4a, "EmbeddedPkg: Introduce GBL protocols").

This series adds the protocol definitions to U-Boot without implementations:

- Patch 1 adds the headers under include/efi_gbl/.
- Patch 2 registers the GBL GUIDs for 'efidebug dh', '%pUs' and 'env print -e', adds a unit test, and adds documentation.

Protocol implementations depend heavily on board and SoC details, so this series only introduces the shared definitions. Board-specific or common implementations can build on them independently.

[1] https://source.android.com/docs/core/architecture/bootloader/generic-bootloader

Dmitrii Merkurev (2):
efi: gbl: Add Android GBL EFI protocol definitions
efi: gbl: Add GBL GUID names and protocol documentation

 MAINTAINERS                          |   7 ++
 doc/android/index.rst                |   3 +
 doc/develop/uefi/gbl.rst             |  97 +++++++++++++++
 doc/develop/uefi/index.rst           |   1 +
 include/efi_gbl/avb.h                | 172 +++++++++++++++++++++++++++
 include/efi_gbl/avf.h                |  41 +++++++
 include/efi_gbl/boot_control.h       | 104 ++++++++++++++++
 include/efi_gbl/boot_memory.h        |  62 ++++++++++
 include/efi_gbl/common.h             |  57 +++++++++
 include/efi_gbl/debug.h              |  44 +++++++
 include/efi_gbl/fastboot.h           |  88 ++++++++++++++
 include/efi_gbl/fastboot_transport.h |  56 +++++++++
 include/efi_gbl/os_configuration.h   | 103 ++++++++++++++++
 lib/uuid.c                           |  47 ++++++++
 test/lib/uuid.c                      | 122 +++++++++++++++++++
 15 files changed, 1004 insertions(+)
 create mode 100644 doc/develop/uefi/gbl.rst
 create mode 100644 include/efi_gbl/avb.h
 create mode 100644 include/efi_gbl/avf.h
 create mode 100644 include/efi_gbl/boot_control.h
 create mode 100644 include/efi_gbl/boot_memory.h
 create mode 100644 include/efi_gbl/common.h
 create mode 100644 include/efi_gbl/debug.h
 create mode 100644 include/efi_gbl/fastboot.h
 create mode 100644 include/efi_gbl/fastboot_transport.h
 create mode 100644 include/efi_gbl/os_configuration.h

base-commit: b7ed8d19d83d08d34b24b15c3dced7fd6c284939

Signature · 1 line
2.56.1.831.g720f3f5937-goog
#1 lore raw

PATCH 1/2 efi: gbl: Add Android GBL EFI protocol definitions

Android Generic Bootloader (GBL) is a UEFI application that handles the Android boot flow and calls into platform firmware for board-specific operations via GBL UEFI protocols.

Add the protocol definitions under include/efi_gbl/:

- common.h: revision helpers, vendor GUID and ResetData constants
- avb.h: Android Verified Boot (1.0)
- avf.h: Android Virtualization Framework (1.0)
- boot_control.h: A/B slots and boot mode (1.0)
- boot_memory.h: boot and partition buffers (1.0)
- debug.h: fatal error reporting (1.0)
- fastboot.h: vendor fastboot variables and commands (1.0)
- fastboot_transport.h: fastboot transport (1.0)
- os_configuration.h: bootconfig, kernel command line and device tree selection (1.1)

Also add an ANDROID GBL entry to MAINTAINERS, and add include/efi*/ to EFI LOADER so get_maintainer.pl matches headers in subdirectories.

---
 MAINTAINERS                          |   6 +
 include/efi_gbl/avb.h                | 172 +++++++++++++++++++++++++++
 include/efi_gbl/avf.h                |  41 +++++++
 include/efi_gbl/boot_control.h       | 104 ++++++++++++++++
 include/efi_gbl/boot_memory.h        |  62 ++++++++++
 include/efi_gbl/common.h             |  57 +++++++++
 include/efi_gbl/debug.h              |  44 +++++++
 include/efi_gbl/fastboot.h           |  88 ++++++++++++++
 include/efi_gbl/fastboot_transport.h |  56 +++++++++
 include/efi_gbl/os_configuration.h   | 103 ++++++++++++++++
 10 files changed, 733 insertions(+)
 create mode 100644 include/efi_gbl/avb.h
 create mode 100644 include/efi_gbl/avf.h
 create mode 100644 include/efi_gbl/boot_control.h
 create mode 100644 include/efi_gbl/boot_memory.h
 create mode 100644 include/efi_gbl/common.h
 create mode 100644 include/efi_gbl/debug.h
 create mode 100644 include/efi_gbl/fastboot.h
 create mode 100644 include/efi_gbl/fastboot_transport.h
 create mode 100644 include/efi_gbl/os_configuration.h
MAINTAINERS +6 -0
index 2819335a76a..4ca3d064cd8 100644
@@ -121,6 +121,11 @@ F:	include/avb_verify.h
 F:	lib/libavb/
 F:	test/py/tests/test_android/test_avb.py
 
+ANDROID GBL
+M:	Dmitrii Merkurev <[email protected]>
+S:	Maintained
+F:	include/efi_gbl/
+
 ARC
 M:	Alexey Brodkin <[email protected]>
 M:	Eugeniy Paltsev <[email protected]>
@@ -977,6 +982,7 @@ F:	include/charset.h
 F:	include/cp1250.h
 F:	include/cp437.h
 F:	include/efi*
+F:	include/efi*/
 F:	include/pe.h
 F:	include/asm-generic/pe.h
 F:	include/mm_communication.h
include/efi_gbl/avb.h new file +172 -0

172 lines not on this page · raw message

include/efi_gbl/avf.h new file +41 -0

41 lines not on this page · raw message

include/efi_gbl/boot_control.h new file +104 -0

104 lines not on this page · raw message

include/efi_gbl/boot_memory.h new file +62 -0

62 lines not on this page · raw message

include/efi_gbl/common.h new file +57 -0

57 lines not on this page · raw message

include/efi_gbl/debug.h new file +44 -0

44 lines not on this page · raw message

include/efi_gbl/fastboot.h new file +88 -0

88 lines not on this page · raw message

include/efi_gbl/fastboot_transport.h new file +56 -0

56 lines not on this page · raw message

include/efi_gbl/os_configuration.h new file +103 -0

103 lines not on this page · raw message

Signature · 1 line
2.56.1.831.g720f3f5937-goog
#2 lore raw

PATCH 2/2 efi: gbl: Add GBL GUID names and protocol documentation

In reply to Dmitrii Merkurev

Add the GBL protocol GUIDs and GBL_EFI_VENDOR_GUID to list_guid[] so 'efidebug dh', '%pUs' and 'env print -e' print them by name, and 'env set -e -guid' accepts GBL_EFI_VENDOR_GUID when CONFIG_PARTITION_TYPE_GUID is enabled. Add a unit test in test/lib/uuid.c to cover them.

Add doc/develop/uefi/gbl.rst with a short overview and the kernel-doc output for include/efi_gbl/, linked from the UEFI and Android doc indexes.

---
 MAINTAINERS                |   1 +
 doc/android/index.rst      |   3 +
 doc/develop/uefi/gbl.rst   |  97 +++++++++++++++++++++++++++++
 doc/develop/uefi/index.rst |   1 +
 lib/uuid.c                 |  47 ++++++++++++++
 test/lib/uuid.c            | 122 +++++++++++++++++++++++++++++++++++++
 6 files changed, 271 insertions(+)
 create mode 100644 doc/develop/uefi/gbl.rst
MAINTAINERS +1 -0
index 4ca3d064cd8..efcb6f06eaf 100644
@@ -124,6 +124,7 @@ F:	test/py/tests/test_android/test_avb.py
 ANDROID GBL
 M:	Dmitrii Merkurev <[email protected]>
 S:	Maintained
+F:	doc/develop/uefi/gbl.rst
 F:	include/efi_gbl/
 
 ARC
doc/android/index.rst +3 -0
index 225d6f125a9..ac04f6944a6 100644
@@ -12,3 +12,6 @@ Android-specific doc
    boot-image
    fastboot-protocol
    fastboot
+
+See also :doc:`../develop/uefi/gbl` for the UEFI protocols used by the Android
+Generic Bootloader (GBL).
doc/develop/uefi/gbl.rst new file +97 -0

97 lines not on this page · raw message

doc/develop/uefi/index.rst +1 -0
index e26b1fbe05c..ddee5d40877 100644
@@ -14,3 +14,4 @@ can be run an UEFI payload.
    u-boot_on_efi.rst
    iscsi.rst
    fwu_updates.rst
+   gbl.rst
lib/uuid.c +47 -0

65 lines not on this page · raw message

test/lib/uuid.c +122 -0

131 lines not on this page · raw message

Signature · 1 line
2.56.1.831.g720f3f5937-goog