diff options
author | Sunil V L <sunilvl@ventanamicro.com> | 2022-01-28 18:18:44 +0300 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-01-29 12:23:40 +0300 |
commit | 1ccf87165e38cb32f2444d8fd4b3e4d8ea13928e (patch) | |
tree | 5d71747769a48b09f22cf17fa21d4fdd4c1c640b /include | |
parent | 9e63786e2b4b35587da2050c180111e9bd1e3a23 (diff) | |
download | u-boot-1ccf87165e38cb32f2444d8fd4b3e4d8ea13928e.tar.xz |
efi_loader: Enable RISCV_EFI_BOOT_PROTOCOL support
This adds support for new RISCV_EFI_BOOT_PROTOCOL to
communicate the boot hart ID to bootloader/kernel on RISC-V
UEFI platforms.
The specification of the protocol is hosted at:
https://github.com/riscv-non-isa/riscv-uefi
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/efi_api.h | 4 | ||||
-rw-r--r-- | include/efi_loader.h | 2 | ||||
-rw-r--r-- | include/efi_riscv.h | 24 |
3 files changed, 30 insertions, 0 deletions
diff --git a/include/efi_api.h b/include/efi_api.h index 8d5d835bd0..f123d0557c 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -438,6 +438,10 @@ struct efi_runtime_services { EFI_GUID(0x607f766c, 0x7455, 0x42be, 0x93, \ 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f) +#define RISCV_EFI_BOOT_PROTOCOL_GUID \ + EFI_GUID(0xccd15fec, 0x6f73, 0x4eec, 0x83, \ + 0x95, 0x3e, 0x69, 0xe4, 0xb9, 0x40, 0xbf) + /** * struct efi_configuration_table - EFI Configuration Table * diff --git a/include/efi_loader.h b/include/efi_loader.h index 701efcd2b6..1fa75b40fe 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -527,6 +527,8 @@ efi_status_t efi_disk_register(void); efi_status_t efi_rng_register(void); /* Called by efi_init_obj_list() to install EFI_TCG2_PROTOCOL */ efi_status_t efi_tcg2_register(void); +/* Called by efi_init_obj_list() to install RISCV_EFI_BOOT_PROTOCOL */ +efi_status_t efi_riscv_register(void); /* Called by efi_init_obj_list() to do initial measurement */ efi_status_t efi_tcg2_do_initial_measurement(void); /* measure the pe-coff image, extend PCR and add Event Log */ diff --git a/include/efi_riscv.h b/include/efi_riscv.h new file mode 100644 index 0000000000..4bd39c4366 --- /dev/null +++ b/include/efi_riscv.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * RISCV_EFI_BOOT_PROTOCOL + * + * Copyright (c) 2022 Ventana Micro Systems Inc + */ + +#include <efi_api.h> + +#define RISCV_EFI_BOOT_PROTOCOL_REVISION 0x00010000 + +/** + * struct riscv_efi_boot_protocol - RISCV_EFI_BOOT_PROTOCOL + * @revision: Version of the protocol implemented + * @get_boot_hartid: Get the boot hart ID + */ +struct riscv_efi_boot_protocol { + u64 revision; + + efi_status_t (EFIAPI * get_boot_hartid) (struct riscv_efi_boot_protocol *this, + efi_uintn_t *boot_hartid); +}; + +extern struct riscv_efi_boot_protocol riscv_efi_boot_prot; |