kumquat-buildroot/boot/edk2/Config.in
Julien Olivain 1b2498fa91 boot/edk2: add support for RISC-V 64bit architecture
RISC-V 64bit qemu virt machine support has been added in edk2
version "stable202302". See [1].

Since edk2-stable202308, introduced in buildroot in commit 5c9f310
"boot/edk2: bump to version edk2-stable202308", it is now possible
to boot the edk2 UEFI shell in qemu.

This commit adds this early RISC-V support to edk2.

The RISC-V edk2 UEFI shell can be booted in Buildroot with the
following commands:

    # Build EDK2 images
    cat > .config <<EOF
    BR2_riscv=y
    BR2_RISCV_64=y
    BR2_PACKAGE_HOST_QEMU=y
    BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
    BR2_TARGET_EDK2=y
    EOF
    make olddefconfig
    make

    # edk2 image size should fit the 32MB of qemu pflash memories
    truncate -s 32M output/images/RISCV_VIRT_CODE.fd
    truncate -s 32M output/images/RISCV_VIRT_VARS.fd

    # Start qemu:
    output/host/usr/bin/qemu-system-riscv64 \
        -M virt,pflash0=pflash0,pflash1=pflash1,acpi=off \
        -nographic \
        -blockdev node-name=pflash0,driver=file,read-only=on,filename=output/images/RISCV_VIRT_CODE.fd \
        -blockdev node-name=pflash1,driver=file,filename=output/images/RISCV_VIRT_VARS.fd

Note: a Qemu version >= 8.0.0 is needed to properly start edk2. A qemu
version on the host system might not be sufficient. This is why the
Buildroot host-qemu is built in this config example.

[1] https://github.com/tianocore/edk2/releases/tag/edk2-stable202302

Signed-off-by: Julien Olivain <ju.o@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2023-12-23 14:36:39 +01:00

151 lines
5.0 KiB
Plaintext

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
bool "EDK2"
depends on BR2_TARGET_EDK2_ARCH_SUPPORTS
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5
select BR2_PACKAGE_EDK2_PLATFORMS
help
EDK II is a modern, feature-rich, cross-platform firmware
development environment for the UEFI and PI specifications.
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II
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
config BR2_TARGET_EDK2_PLATFORM_OVMF_I386
bool "i386"
depends on BR2_i386 || BR2_x86_64
help
Platform configuration for a generic i386 target.
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
help
Platform configuration for a generic x86-64 target.
This platform will boot from flash address 0x0.
It should therefore be used as the first bootloader.
config BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU
bool "ARM Virt Qemu (flash)"
depends on BR2_aarch64
help
Platform configuration for 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_ARM_VIRT_QEMU_KERNEL
bool "ARM Virt Qemu (kernel)"
depends on BR2_aarch64
help
Platform configuration for QEMU targeting the Virt machine.
This platform can boot from either flash address 0x0 or via
the Linux boot protocol. It can therefore be loaded by a
previous bootloader like ARM Trusted Firmware or OP-TEE.
config BR2_TARGET_EDK2_PLATFORM_ARM_SGI575
bool "ARM SGI-575"
depends on BR2_aarch64
help
Platform configuration for ARM SGI-575 on ARM's
Fixed Virtual Platform (FVP).
config BR2_TARGET_EDK2_PLATFORM_ARM_VEXPRESS_FVP_AARCH64
bool "ARM VExpress FVP Aarch64"
depends on BR2_aarch64
help
Platform configuration for ARM Versatile Express targeting
the Aarch64 Fixed Virtual Platform (FVP).
config BR2_TARGET_EDK2_PLATFORM_SOCIONEXT_DEVELOPERBOX
bool "Socionext DeveloperBox"
depends on BR2_aarch64
depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE
depends on !BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33
select BR2_PACKAGE_HOST_DTC
select BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP
help
Platform configuration for Socionext SynQuacer DeveloperBox
(SC2A11).
comment "Socionext DeveloperBox depends on ATF not using EDK2 as BL33"
depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33
config BR2_TARGET_EDK2_PLATFORM_SOLIDRUN_ARMADA80X0MCBIN
bool "SolidRun MacchiatoBin"
depends on BR2_aarch64
depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE
select BR2_PACKAGE_EDK2_NON_OSI
select BR2_PACKAGE_HOST_DTC
select BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP
help
Platform configuration for the SolidRun MacchiatoBin.
config BR2_TARGET_EDK2_PLATFORM_QEMU_SBSA
bool "QEMU SBSA"
depends on BR2_aarch64
depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE
depends on !BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33
help
Platform configuration for QEMU targeting the SBSA reference
machine.
comment "QEMU SBSA depends on ATF not using EDK2 as BL33"
depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33
endchoice
config BR2_TARGET_EDK2_OVMF_DEBUG_ON_SERIAL
bool "OVMF Debug on Serial"
depends on BR2_ENABLE_DEBUG
depends on BR2_TARGET_EDK2_PLATFORM_OVMF_I386 || \
BR2_TARGET_EDK2_PLATFORM_OVMF_X64
help
When EDK2 OVMF is built with debug, messages are printed to
IO port 0x402. Those messages are not shown in the normal
Qemu emulated serial port. Enabling this option will print
debug messages on the emulated serial port, potentially
mixing messages with UEFI serial console output.
See OVMF README:
https://github.com/tianocore/edk2/blob/master/OvmfPkg/README
config BR2_TARGET_EDK2_FD_NAME
string
default "OVMF" if BR2_TARGET_EDK2_PLATFORM_OVMF_I386
default "OVMF" if BR2_TARGET_EDK2_PLATFORM_OVMF_X64
default "QEMU_EFI" if BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU
default "QEMU_EFI" if BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU_KERNEL
default "BL33_AP_UEFI" if BR2_TARGET_EDK2_PLATFORM_ARM_SGI575
default "FVP_AARCH64_EFI" if BR2_TARGET_EDK2_PLATFORM_ARM_VEXPRESS_FVP_AARCH64
default "FVP_AARCH64_EFI" if BR2_TARGET_EDK2_PLATFORM_SOCIONEXT_DEVELOPERBOX
default "ARMADA_EFI" if BR2_TARGET_EDK2_PLATFORM_SOLIDRUN_ARMADA80X0MCBIN
endif
comment "EDK2 needs a toolchain w/ gcc >= 5"
depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_5