edk2/EmbeddedPkg/Include/Protocol/GblEfiOsConfiguration.h
Dmitrii Merkurev dfaa76349d EmbeddedPkg: Introduce GBL protocols
GBL (Generic Bootloader) is Google's UEFI-based bootloader for Android.
It runs as an EFI application and delegates board- and platform-specific
operations to the underlying firmware through GBL-defined EFI protocols.

This patch adds only the header definitions (GUIDs, revisions and
interfaces) for those protocols, covering Android Verified Boot, AVF,
A/B boot-control, boot-memory, debug, Fastboot (and its transport) and
OS configuration.

For details, see:
https://cs.android.com/android/kernel/superproject/+/common-android-mainline:bootable/libbootloader/gbl/README.md

Co-authored-by: David Pursell <dpursell@google.com>
Co-authored-by: Dov Shlachter <dovs@google.com>
Co-authored-by: Jakob Vukalović <jakobvukalovic@google.com>
Co-authored-by: Kelvin Zhang <zhangkelvin@google.com>
Co-authored-by: Ram Muthiah <rammuthiah@google.com>
Co-authored-by: Sergii Parubochyi <sergiip@google.com>
Co-authored-by: Yecheng Zhao <zyecheng@google.com>
Co-authored-by: Yi-Yo Chiang <yochiang@google.com>
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2026-06-12 09:38:53 +00:00

93 lines
2.8 KiB
C

/** @file
GBL EFI OS Configuration Protocol.
Lets firmware fix up kernel bootconfig, and choose device-tree components at
boot time.
Related docs:
https://android.googlesource.com/platform/bootable/libbootloader/+/refs/heads/gbl-mainline/gbl/docs/gbl_efi_os_configuration_protocol.md
Copyright (c) 2025, The Android Open Source Project.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#pragma once
#include <Uefi/UefiBaseType.h>
//
// {dda0d135-aa5b-42ff-85ac-e3ad6efb4619}
//
#define GBL_EFI_OS_CONFIGURATION_PROTOCOL_GUID \
{ 0xdda0d135, 0xaa5b, 0x42ff, { 0x85, 0xac, 0xe3, 0xad, 0x6e, 0xfb, 0x46, 0x19 } }
#define GBL_EFI_OS_CONFIGURATION_PROTOCOL_REVISION 0x00010000
typedef struct _GBL_EFI_OS_CONFIGURATION_PROTOCOL GBL_EFI_OS_CONFIGURATION_PROTOCOL;
typedef enum {
GblEfiDeviceTreeTypeDeviceTree,
GblEfiDeviceTreeTypeOverlay,
GblEfiDeviceTreeTypePvmDaOverlay
} GBL_EFI_DEVICE_TREE_TYPE;
typedef enum {
GblEfiDeviceTreeSourceBoot,
GblEfiDeviceTreeSourceVendorBoot,
GblEfiDeviceTreeSourceDtbo,
GblEfiDeviceTreeSourceDtb
} GBL_EFI_DEVICE_TREE_SOURCE;
typedef struct {
UINT32 Source; // GBL_EFI_DEVICE_TREE_SOURCE
UINT32 Type; // GBL_EFI_DEVICE_TREE_TYPE
UINT32 Id;
UINT32 Rev;
UINTN CustomSize;
CONST UINT8 *Custom;
} GBL_EFI_DEVICE_TREE_METADATA;
typedef struct {
GBL_EFI_DEVICE_TREE_METADATA Metadata;
CONST VOID *DeviceTree; // 8-byte aligned, never NULL
BOOLEAN Selected;
} GBL_EFI_VERIFIED_DEVICE_TREE;
typedef
EFI_STATUS
(EFIAPI *GBL_EFI_FIXUP_BOOTCONFIG)(
IN GBL_EFI_OS_CONFIGURATION_PROTOCOL *This,
IN UINTN BootConfigSize,
IN CONST CHAR8 *BootConfig,
IN OUT UINTN *FixupBufferSize,
OUT CHAR8 *Fixup
);
typedef
EFI_STATUS
(EFIAPI *GBL_EFI_SELECT_DEVICE_TREES)(
IN GBL_EFI_OS_CONFIGURATION_PROTOCOL *This,
IN UINTN NumDeviceTrees,
IN OUT GBL_EFI_VERIFIED_DEVICE_TREE *DeviceTrees
);
typedef
EFI_STATUS
(EFIAPI *GBL_EFI_SELECT_FIT_CONFIGURATION)(
IN GBL_EFI_OS_CONFIGURATION_PROTOCOL *This,
IN UINTN FitSize,
IN CONST UINT8 *Fit,
IN UINTN MetadataSize,
IN CONST UINT8 *Metadata,
OUT UINTN *SelectedConfigurationOffset
);
struct _GBL_EFI_OS_CONFIGURATION_PROTOCOL {
UINT64 Revision;
GBL_EFI_FIXUP_BOOTCONFIG FixupBootConfig;
GBL_EFI_SELECT_DEVICE_TREES SelectDeviceTrees;
GBL_EFI_SELECT_FIT_CONFIGURATION SelectFitConfiguration;
};
extern EFI_GUID gGblEfiOsConfigurationProtocolGuid;