diff --git a/boot/edk2/Config.in b/boot/edk2/Config.in index bed503b168..4e6e7d122c 100644 --- a/boot/edk2/Config.in +++ b/boot/edk2/Config.in @@ -2,6 +2,7 @@ config BR2_TARGET_EDK2_ARCH_SUPPORTS bool default y if BR2_aarch64 default y if BR2_i386 + default y if BR2_RISCV_64 default y if BR2_x86_64 config BR2_TARGET_EDK2 @@ -20,6 +21,7 @@ if BR2_TARGET_EDK2 choice prompt "Platform" default BR2_TARGET_EDK2_PLATFORM_OVMF_I386 if BR2_i386 + default BR2_TARGET_EDK2_PLATFORM_OVMF_RISCV if BR2_RISCV_64 default BR2_TARGET_EDK2_PLATFORM_OVMF_X64 if BR2_x86_64 default BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU if BR2_aarch64 @@ -31,6 +33,14 @@ config BR2_TARGET_EDK2_PLATFORM_OVMF_I386 This platform will boot from flash address 0x0. It should therefore be used as the first bootloader. +config BR2_TARGET_EDK2_PLATFORM_OVMF_RISCV + bool "RISC-V" + depends on BR2_RISCV_64 + help + Platform configuration for RISC-V QEMU targeting the Virt + machine. This platform will only boot from flash address + 0x0. It should therefore be used as the first bootloader. + config BR2_TARGET_EDK2_PLATFORM_OVMF_X64 bool "x86-64" depends on BR2_x86_64 diff --git a/boot/edk2/edk2.mk b/boot/edk2/edk2.mk index 186854a14c..efdb4d02ce 100644 --- a/boot/edk2/edk2.mk +++ b/boot/edk2/edk2.mk @@ -136,6 +136,12 @@ define EDK2_PRE_BUILD_QEMU_SBSA ln -srf $(BINARIES_DIR)/{bl1.bin,fip.bin} $(EDK2_BUILD_PACKAGES)/Platform/Qemu/Sbsa/ endef +else ifeq ($(BR2_TARGET_EDK2_PLATFORM_OVMF_RISCV),y) +EDK2_ARCH = RISCV64 +EDK2_PACKAGE_NAME = OvmfPkg/RiscVVirt +EDK2_PLATFORM_NAME = RiscVVirtQemu +EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME) + endif EDK2_BASETOOLS_OPTS = \