]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg: Add RISCV_EFI_BOOT_PROTOCOL related definitions
authorSunil V L <sunilvl@ventanamicro.com>
Fri, 27 Jan 2023 09:57:54 +0000 (15:27 +0530)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 16 Feb 2023 05:53:28 +0000 (05:53 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4076

RISC-V UEFI based platforms need to support RISCV_EFI_BOOT_PROTOCOL.
Add this protocol GUID definition and the header file required.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Daniel Schaefer <git@danielschaefer.me>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Andrei Warkentin <andrei.warkentin@intel.com>
Acked-by: Ray Ni <ray.ni@intel.com>
UefiCpuPkg/Include/Protocol/RiscVBootProtocol.h [new file with mode: 0644]
UefiCpuPkg/UefiCpuPkg.dec

diff --git a/UefiCpuPkg/Include/Protocol/RiscVBootProtocol.h b/UefiCpuPkg/Include/Protocol/RiscVBootProtocol.h
new file mode 100644 (file)
index 0000000..ed223b8
--- /dev/null
@@ -0,0 +1,34 @@
+/** @file\r
+  RISC-V Boot Protocol mandatory for RISC-V UEFI platforms.\r
+\r
+  @par Revision Reference:\r
+  The protocol specification can be found at\r
+  https://github.com/riscv-non-isa/riscv-uefi\r
+\r
+  Copyright (c) 2022, Ventana Micro Systems Inc. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#ifndef RISCV_BOOT_PROTOCOL_H_\r
+#define RISCV_BOOT_PROTOCOL_H_\r
+\r
+typedef struct _RISCV_EFI_BOOT_PROTOCOL RISCV_EFI_BOOT_PROTOCOL;\r
+\r
+#define RISCV_EFI_BOOT_PROTOCOL_REVISION  0x00010000\r
+#define RISCV_EFI_BOOT_PROTOCOL_LATEST_VERSION \\r
+        RISCV_EFI_BOOT_PROTOCOL_REVISION\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_BOOT_HARTID)(\r
+  IN RISCV_EFI_BOOT_PROTOCOL   *This,\r
+  OUT UINTN                    *BootHartId\r
+  );\r
+\r
+typedef struct _RISCV_EFI_BOOT_PROTOCOL {\r
+  UINT64                 Revision;\r
+  EFI_GET_BOOT_HARTID    GetBootHartId;\r
+} RISCV_EFI_BOOT_PROTOCOL;\r
+\r
+#endif\r
index cff239d5283e61fa085003be9d263a27f365acc8..903ad52da91be0b56bc09bcb7c4bc2e8c25b0502 100644 (file)
   ## Include/Protocol/SmMonitorInit.h\r
   gEfiSmMonitorInitProtocolGuid  = { 0x228f344d, 0xb3de, 0x43bb, { 0xa4, 0xd7, 0xea, 0x20, 0xb, 0x1b, 0x14, 0x82 }}\r
 \r
+[Protocols.RISCV64]\r
+  #\r
+  # Protocols defined for RISC-V systems\r
+  #\r
+  ## Include/Protocol/RiscVBootProtocol.h\r
+  gRiscVEfiBootProtocolGuid  = { 0xccd15fec, 0x6f73, 0x4eec, { 0x83, 0x95, 0x3e, 0x69, 0xe4, 0xb9, 0x40, 0xbf }}\r
+\r
 #\r
 # [Error.gUefiCpuPkgTokenSpaceGuid]\r
 #   0x80000001 | Invalid value provided.\r