blob: 4fc18599cec26b2cea8d9746a745e8034ee0cf99 [file] [log] [blame]
Yecheng Zhao52b10d02024-04-04 09:34:15 -07001/*
2 * Copyright (c) 2024 The Fuchsia Authors
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7// EFI_ANDROID_BOOT_PROTOCOL is a UEFI protocol introduced by Google Generic
8// Bootloader for verified booting and Fastboot over USB.
9// See https://android.googlesource.com/platform/bootable/libbootloader/+/refs/heads/main/gbl/docs/EFI_ANDROID_BOOT_PROTOCOL.md
10// for protocol spec.
11
12#include <efi_api.h>
13
14#define EFI_ANDROID_BOOT_PROTOCOL_REVISION 0x00000000
15
16#define EFI_ANDROID_BOOT_PROTOCOL_GUID \
17 EFI_GUID(0x6281a893, 0xac23, 0x4ca7, 0xb2, 0x81, 0x34, 0x0e, 0xf8, \
18 0x16, 0x89, 0x55)
19
20typedef struct efi_android_boot_protocol {
21 uint64_t revision;
22 efi_status_t (*fastboot_usb_interface_start)(
23 struct efi_android_boot_protocol *self,
24 size_t *max_packet_size);
25 efi_status_t (*fastboot_usb_interface_stop)(
26 struct efi_android_boot_protocol *self);
27 efi_status_t (*fastboot_usb_receive)(
28 struct efi_android_boot_protocol *self, size_t *buffer_size,
29 void *buffer);
30 efi_status_t (*fastboot_usb_send)(struct efi_android_boot_protocol *self,
31 size_t *buffer_size,
32 const void *buffer);
33 struct efi_event *wait_for_send_completion;
34} efi_android_boot_protocol;