@@ -122,6 +122,7 @@ F: package/kvazaar/
F: package/v4l2loopback/
N: Alistair Francis <alistair@alistair23.me>
+F: boot/opensbi/
F: package/xen/
N: Alvaro G. M <alvaro.gamez@hazent.com>
@@ -14,6 +14,7 @@ source "boot/lpc32xxcdl/Config.in"
source "boot/mv-ddr-marvell/Config.in"
source "boot/mxs-bootlets/Config.in"
source "boot/optee-os/Config.in"
+source "boot/opensbi/Config.in"
source "boot/riscv-pk/Config.in"
source "boot/s500-bootloader/Config.in"
source "boot/shim/Config.in"
new file mode 100644
@@ -0,0 +1,25 @@
+config BR2_TARGET_OPENSBI
+ bool "opensbi"
+ depends on BR2_riscv
+ help
+ OpenSBI aims to provide an open-source and extensible
+ implementation of the RISC-V SBI specification for a platform
+ specific firmware (M-mode) and a general purpose OS,
+ hypervisor or bootloader (S-mode or HS-mode). OpenSBI
+ implementation can be easily extended by RISC-V platform or
+ System-on-Chip vendors to fit a particular hadware
+ configuration.
+
+ https://github.com/riscv/opensbi.git
+
+if BR2_TARGET_OPENSBI
+config BR2_TARGET_OPENSBI_PLAT
+ string "OpenSBI Platform"
+ default ""
+ 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.
+endif
new file mode 100644
@@ -0,0 +1,32 @@
+################################################################################
+#
+# OpenSBI
+#
+################################################################################
+
+OPENSBI_VERSION = ca20ac0cd4c099006d4eea4d9ac7bd7b58e2ae0f
+OPENSBI_SITE = git://github.com/riscv/opensbi.git
+OPENSBI_LICENSE = BSD-2-Clause
+OPENSBI_LICENSE_FILES = COPYING.BSD
+OPENSBI_INSTALL_IMAGES = YES
+
+OPENSBI_MAKE_ENV = \
+ CROSS_COMPILE=$(TARGET_CROSS)
+
+OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_OPENSBI_PLAT))
+ifneq ($(OPENSBI_PLAT),)
+OPENSBI_MAKE_ENV += PLATFORM=$(OPENSBI_PLAT)
+endif
+
+define OPENSBI_BUILD_CMDS
+ $(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+ifneq ($(OPENSBI_PLAT),)
+define OPENSBI_INSTALL_IMAGES_CMDS
+ $(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_jump.bin $(BINARIES_DIR)/fw_jump.bin
+ $(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_jump.elf $(BINARIES_DIR)/fw_jump.elf
+endef
+endif
+
+$(eval $(generic-package))
OpenSBI is a much improved alternative to BBL (riscv-pk). Add OpenSBI support to buildroot. Signed-off-by: Alistair Francis <alistair.francis@wdc.com> --- DEVELOPERS | 1 + boot/Config.in | 1 + boot/opensbi/Config.in | 25 +++++++++++++++++++++++++ boot/opensbi/opensbi.mk | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 boot/opensbi/Config.in create mode 100644 boot/opensbi/opensbi.mk