@@ -13,13 +13,32 @@ config BR2_TARGET_OPENSBI
https://github.com/riscv/opensbi.git
if BR2_TARGET_OPENSBI
-config BR2_TARGET_OPENSBI_PLAT
- string "OpenSBI Platform"
- default ""
+
+choice
+ prompt "OpenSBI Platform"
help
Specifies the OpenSBI platform to build. If no platform is
specified only the OpenSBI platform independent static
library libsbi.a is built. If a platform is specified then
the platform specific static library libplatsbi.a and firmware
examples are built.
+
+config BR2_TARGET_OPENSBI_LIBRARY_ONLY
+ bool "Library Only"
+
+config BR2_TARGET_OPENSBI_QEMU_VIRT
+ bool "QEMU Virt"
+
+config BR2_TARGET_OPENSBI_QEMU_SIFIVE_U
+ bool "QEMU SiFive U"
+
+config BR2_TARGET_OPENSBI_CUSTOM_PLATFORM
+ bool "Custom Platform"
+
+endchoice
+
+config BR2_TARGET_OPENSBI_CUSTOM_PLATFORM_VALUE
+ string "OpenSBI Platform String"
+ depends on BR2_TARGET_OPENSBI_CUSTOM_PLATFORM
+
endif
@@ -14,7 +14,16 @@ OPENSBI_INSTALL_STAGING = YES
OPENSBI_MAKE_ENV = \
CROSS_COMPILE=$(TARGET_CROSS)
-OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_OPENSBI_PLAT))
+ifeq ($(BR2_TARGET_OPENSBI_LIBRARY_ONLY),y)
+OPENSBI_PLAT = ""
+else ifeq ($(BR2_TARGET_OPENSBI_QEMU_VIRT),y)
+OPENSBI_PLAT = "qemu/virt"
+else ifeq ($(BR2_TARGET_OPENSBI_QEMU_SIFIVE_U),y)
+OPENSBI_PLAT = "qemu/sifive_u"
+else ifeq ($(BR2_TARGET_OPENSBI_CUSTOM_PLATFORM),y)
+OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_OPENSBI_CUSTOM_PLATFORM_VALUE))
+endif
+
ifneq ($(OPENSBI_PLAT),)
OPENSBI_MAKE_ENV += PLATFORM=$(OPENSBI_PLAT)
endif
@@ -24,4 +24,4 @@ BR2_LINUX_KERNEL_IMAGE=y
# Bootloader
BR2_TARGET_OPENSBI=y
BR2_TARGET_OPENSBI_USE_PLAT=y
-BR2_TARGET_OPENSBI_PLAT="qemu/virt"
+BR2_TARGET_OPENSBI_QEMU_VIRT=y
@@ -23,4 +23,4 @@ BR2_LINUX_KERNEL_IMAGE=y
# Bootloader
BR2_TARGET_OPENSBI=y
BR2_TARGET_OPENSBI_USE_PLAT=y
-BR2_TARGET_OPENSBI_PLAT="qemu/virt"
+BR2_TARGET_OPENSBI_QEMU_VIRT=y
Instead of requiring users to look at the OpenSBI source code and determine the platform string let's use a choice option to allow them to specify the platform they would like to target. We still allow them to specify a custom string if they want to. Signed-off-by: Alistair Francis <alistair.francis@wdc.com> --- boot/opensbi/Config.in | 25 ++++++++++++++++++++++--- boot/opensbi/opensbi.mk | 11 ++++++++++- configs/qemu_riscv32_virt_defconfig | 2 +- configs/qemu_riscv64_virt_defconfig | 2 +- 4 files changed, 34 insertions(+), 6 deletions(-)