Skip to contentSkip to conversation

arch: riscv: Add a RISC-V Platform option

PATCH New Alistair Francis 4 participants 14 messages Mar 15, 2019 – Mar 19, 2019 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 arch: riscv: Add a RISC-V Platform option

Add a RISC-V Platform option. At the moment only QEMU platforms are supported, but in the future this can be extended to include real hardware platforms (such as the Unleashed board).

My goal is that this platform will set default config options (such as the default defconfig for the kernel) based on the platform value.

---
 arch/Config.in.riscv | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/Config.in.riscv +16 -0
index 097719e846..c97fa5b703 100644
@@ -108,6 +108,22 @@ config BR2_RISCV_ABI_LP64D
 	depends on BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVD
 endchoice
 
+choice
+	prompt "Target Platform"
+	default BR2_RISCV_QEMU_VIRT
+	help
+	  The RISC-V Platform to target.
+
+config BR2_RISCV_QEMU_VIRT
+	bool "qemu/virt"
+
+config BR2_RISCV_QEMU_SIFIVE_U
+	bool "qemu/sifive_u"
+
+config BR2_RISCV_UNKNOWN
+	bool "unknown"
+endchoice
+
 config BR2_ARCH
 	default "riscv32" if !BR2_ARCH_IS_64
 	default "riscv64" if BR2_ARCH_IS_64
Signature · 1 line
2.21.0
#1 lore raw

PATCH 2/3 boot: riscv: Initial commit of OpenSBI

OpenSBI is a much improved alternative to BLL (riscv-pk). Add OpenSBI support to buildroot.

OpenSBI support uses the new RISC-V "Target Platform" config to build the specified platform.

---
 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
DEVELOPERS +1 -0
index 8a57cb2e23..a8978856ad 100644
@@ -1383,6 +1383,7 @@ F:	arch/arch.mk.riscv
 F:	arch/Config.in.riscv
 F:	board/qemu/riscv32-virt/
 F:	board/qemu/riscv64-virt/
+F:	boot/opensbi/
 F:	boot/riscv-pk/
 F:	configs/qemu_riscv32_virt_defconfig
 F:	configs/qemu_riscv64_virt_defconfig
boot/Config.in +1 -0
index 74481e7545..97bd3de6e9 100644
@@ -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"
boot/opensbi/Config.in new file +25 -0
new file mode 100644
index 0000000000..01ee342215
@@ -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_USE_PLAT
+	bool "Build OpenSBI for Platform"
+	depends on BR2_TARGET_OPENSBI
+
+config BR2_TARGET_OPENSBI_PLAT
+	string "OpenSBI Platform"
+	depends on BR2_TARGET_OPENSBI_USE_PLAT
+	default "qemu/virt" if BR2_RISCV_QEMU_VIRT
+	default "qemu/sifive_u" if BR2_RISCV_QEMU_SIFIVE_U
+	default ""
+endif
boot/opensbi/opensbi.mk new file +32 -0
new file mode 100644
index 0000000000..9da4e7f44e
@@ -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)
+
+ifeq ($(BR2_TARGET_OPENSBI_USE_PLAT),y)
+	OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_UBOOT_BOARD_DEFCONFIG))
+	OPENSBI_MAKE_ENV += PLATFORM=$(OPENSBI_PLAT)
+endif
+
+define OPENSBI_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+ifeq ($(BR2_TARGET_OPENSBI_USE_PLAT),y)
+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))
Signature · 1 line
2.21.0
#2 lore raw

PATCH 2/3 boot: riscv: Initial commit of OpenSBI

Hello,

DEVELOPERS F: arch/arch.mk.riscv · line 1386

Quoted 8 lines · On Fri, 15 Mar 2019 23:06:38 +0000 Alistair Francis <[email protected]>…

index 8a57cb2e23..a8978856ad 100644

DEVELOPERS +1 -0
@@ -1383,6 +1383,7 @@ F:	arch/arch.mk.riscv
 F:	arch/Config.in.riscv
 F:	board/qemu/riscv32-virt/
 F:	board/qemu/riscv64-virt/
+F:	boot/opensbi/

Why is this added under the name of Mark Corbin, and not yours? Is Mark fine with this? Why don't you add opensbi under your entry in the DEVELOPERS file?

boot/opensbi/Config.in line 2

Quoted 8 lines
boot/opensbi/Config.in new file +2 -0
new file mode 100644
index 0000000000..01ee342215
@@ -0,0 +1,25 @@
+config BR2_TARGET_OPENSBI
+	bool "OpenSBI"

All lower-case "opensbi".

Quoted 5 lines
boot/opensbi/Config.in new file +5 -0
+	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

boot/opensbi/Config.in line 17

Quoted 10 lines
boot/opensbi/Config.in new file +10 -0
+	  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_USE_PLAT
+	bool "Build OpenSBI for Platform"
+	depends on BR2_TARGET_OPENSBI

This "depends on" is not needed, you are already inside a if BR2_TARGET_OPENSBI...endif block.

But this option is not needed: you can simply decide whether you want to do a "platform" build depending on whether the BR2_TARGET_OPENSBI_PLAT option is empty or not.

boot/opensbi/Config.in line 23

Quoted 5 lines
boot/opensbi/Config.in new file +5 -0
+config BR2_TARGET_OPENSBI_PLAT
+	string "OpenSBI Platform"
+	depends on BR2_TARGET_OPENSBI_USE_PLAT
+	default "qemu/virt" if BR2_RISCV_QEMU_VIRT
+	default "qemu/sifive_u" if BR2_RISCV_QEMU_SIFIVE_U

Instead of this, you should simply make it a string option, and it's the responsibility of the user to fill it in with the right value. Example defconfigs can help users for well-known platforms. That's how we do things for Linux, U-Boot, and all other platform-specific components.

Quoted 13 lines
boot/opensbi/opensbi.mk new file +7 -0
new file mode 100644
index 0000000000..9da4e7f44e
@@ -0,0 +1,32 @@
+################################################################################
+#
+# OpenSBI
+#
+################################################################################
+
+OPENSBI_VERSION = ca20ac0cd4c099006d4eea4d9ac7bd7b58e2ae0f

boot/opensbi/opensbi.mk line 17

Quoted 10 lines
boot/opensbi/opensbi.mk new file +10 -0
+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)
+
+ifeq ($(BR2_TARGET_OPENSBI_USE_PLAT),y)
+	OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_UBOOT_BOARD_DEFCONFIG))

So you're re-using the name of the U-Boot defconfig ? Aren't you supposed to use BR2_TARGET_OPENSBI_PLAT here ?

boot/opensbi/opensbi.mk line 19

Quoted 2 lines
boot/opensbi/opensbi.mk new file +2 -0
+	OPENSBI_MAKE_ENV += PLATFORM=$(OPENSBI_PLAT)
+endif

I believe this block of code should instead be:

OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_OPENSBI_PLAT)) ifneq ($(OPENSBI_PLAT),)
OPENSBI_MAKE_ENV += PLATFORM=$(OPENSBI_PLAT) endif

boot/opensbi/opensbi.mk line 25

Quoted 5 lines
boot/opensbi/opensbi.mk new file +5 -0
+define OPENSBI_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+ifeq ($(BR2_TARGET_OPENSBI_USE_PLAT),y)

So when there's no platform defined, nothing gets installed ? This looks weird.

I'm not sure how much it makes sense for a build without a platform defined. Shouldn't we do like U-Boot/Linux and simply disallow building with an undefined platform/configuration ?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 2/3 boot: riscv: Initial commit of OpenSBI

Quoted 6 lines · Thomas Petazzoni

Hello,

On Fri, 15 Mar 2019 23:06:38 +0000 Alistair Francis <[email protected]> wrote:

Quoted 12 lines

DEVELOPERS F: arch/arch.mk.riscv · line 1386

Quoted 8 lines

index 8a57cb2e23..a8978856ad 100644

DEVELOPERS +1 -0
@@ -1383,6 +1383,7 @@ F:      arch/arch.mk.riscv
 F:   arch/Config.in.riscv
 F:   board/qemu/riscv32-virt/
 F:   board/qemu/riscv64-virt/
+F:   boot/opensbi/

Why is this added under the name of Mark Corbin, and not yours? Is Mark fine with this? Why don't you add opensbi under your entry in the DEVELOPERS file?

I was just keeping all the RISC-V ones together, but you are right. I'll add it to mine.

Quoted 12 lines

boot/opensbi/Config.in line 2

Quoted 10 lines
boot/opensbi/Config.in new file +2 -0
new file mode 100644
index 0000000000..01ee342215
@@ -0,0 +1,25 @@
+config BR2_TARGET_OPENSBI
+     bool "OpenSBI"

All lower-case "opensbi".

Fixed

Quoted 20 lines
Quoted 6 lines
boot/opensbi/Config.in new file +5 -0
+     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

boot/opensbi/Config.in line 17

Quoted 10 lines
boot/opensbi/Config.in new file +10 -0
+       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_USE_PLAT
+     bool "Build OpenSBI for Platform"
+     depends on BR2_TARGET_OPENSBI

This "depends on" is not needed, you are already inside a if BR2_TARGET_OPENSBI...endif block.

Quoted 3 lines

But this option is not needed: you can simply decide whether you want to do a "platform" build depending on whether the BR2_TARGET_OPENSBI_PLAT option is empty or not.

Ok, fixed.

Quoted 7 lines

boot/opensbi/Config.in line 23

Quoted 6 lines
boot/opensbi/Config.in new file +5 -0
+config BR2_TARGET_OPENSBI_PLAT
+     string "OpenSBI Platform"
+     depends on BR2_TARGET_OPENSBI_USE_PLAT
+     default "qemu/virt" if BR2_RISCV_QEMU_VIRT
+     default "qemu/sifive_u" if BR2_RISCV_QEMU_SIFIVE_U
Quoted 5 lines

Instead of this, you should simply make it a string option, and it's the responsibility of the user to fill it in with the right value. Example defconfigs can help users for well-known platforms. That's how we do things for Linux, U-Boot, and all other platform-specific components.

Fixed as well.

Quoted 19 lines
Quoted 19 lines
boot/opensbi/opensbi.mk new file +12 -0
new file mode 100644
index 0000000000..9da4e7f44e
@@ -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
+
Quoted 8 lines

boot/opensbi/opensbi.mk line 17

Quoted 5 lines
boot/opensbi/opensbi.mk new file +5 -0
+OPENSBI_MAKE_ENV = \
+     CROSS_COMPILE=$(TARGET_CROSS)
+
+ifeq ($(BR2_TARGET_OPENSBI_USE_PLAT),y)
+     OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_UBOOT_BOARD_DEFCONFIG))

So you're re-using the name of the U-Boot defconfig ? Aren't you supposed to use BR2_TARGET_OPENSBI_PLAT here ?

This was a typo.

Quoted 10 lines

boot/opensbi/opensbi.mk line 19

Quoted 3 lines
boot/opensbi/opensbi.mk new file +2 -0
+     OPENSBI_MAKE_ENV += PLATFORM=$(OPENSBI_PLAT)
+endif

I believe this block of code should instead be:

OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_OPENSBI_PLAT)) ifneq ($(OPENSBI_PLAT),)
OPENSBI_MAKE_ENV += PLATFORM=$(OPENSBI_PLAT) endif

Looks good to me, I'll use this.

Quoted 9 lines

boot/opensbi/opensbi.mk line 25

Quoted 6 lines
boot/opensbi/opensbi.mk new file +5 -0
+define OPENSBI_BUILD_CMDS
+     $(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+ifeq ($(BR2_TARGET_OPENSBI_USE_PLAT),y)

So when there's no platform defined, nothing gets installed ? This looks weird.

If no platform is defined then OpenSBI will just build a library that can be used by other projects. The idea here is to allow people to build that library. At the moment though nothing is using it.

Quoted 4 lines

I'm not sure how much it makes sense for a build without a platform defined. Shouldn't we do like U-Boot/Linux and simply disallow building with an undefined platform/configuration ?

I think it does make sense to allow building without a platform, but I can disable that if required.

Alistair

Quoted 8 lines

Thanks,

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#4 lore raw

PATCH 2/3 boot: riscv: Initial commit of OpenSBI

Hello,

Quoted 6 lines · On Mon, 18 Mar 2019 13:36:53 -0700 Alistair Francis <[email protected]>…
Quoted 2 lines

So when there's no platform defined, nothing gets installed ? This looks weird.

If no platform is defined then OpenSBI will just build a library that can be used by other projects. The idea here is to allow people to build that library. At the moment though nothing is using it.

OK, then you can probably keep the "build without platform" thing, but the Config.in help text of the string option used to define the platform should be improved to explain what happens when no platform is defined.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH 2/3 boot: riscv: Initial commit of OpenSBI

Quoted 9 lines · Thomas Petazzoni

Hello,

Quoted 3 lines · On Mon, 18 Mar 2019 13:36:53 -0700 Alistair Francis <[email protected]>…
Quoted 2 lines

So when there's no platform defined, nothing gets installed ? This looks weird.

Quoted 8 lines
Quoted 3 lines

If no platform is defined then OpenSBI will just build a library that can be used by other projects. The idea here is to allow people to build that library. At the moment though nothing is using it.

OK, then you can probably keep the "build without platform" thing, but the Config.in help text of the string option used to define the platform should be improved to explain what happens when no platform is defined.

Done! V2 sent.

Alistair

Quoted 8 lines

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#6 lore raw

PATCH 3/3 boot: riscv: Remove riscv-pk

In reply to Alistair Francis

Now that OpenSBI is supported remove BBL (riscv-pk).

---
 DEVELOPERS                |  1 -
 boot/Config.in            |  1 -
 boot/riscv-pk/Config.in   | 14 --------------
 boot/riscv-pk/riscv-pk.mk | 32 --------------------------------
 4 files changed, 48 deletions(-)
 delete mode 100644 boot/riscv-pk/Config.in
 delete mode 100644 boot/riscv-pk/riscv-pk.mk
DEVELOPERS +0 -1
index a8978856ad..246bb8b471 100644
@@ -1384,7 +1384,6 @@ F:	arch/Config.in.riscv
 F:	board/qemu/riscv32-virt/
 F:	board/qemu/riscv64-virt/
 F:	boot/opensbi/
-F:	boot/riscv-pk/
 F:	configs/qemu_riscv32_virt_defconfig
 F:	configs/qemu_riscv64_virt_defconfig
 
boot/Config.in +0 -1
index 97bd3de6e9..228868de8c 100644
@@ -15,7 +15,6 @@ 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"
 source "boot/syslinux/Config.in"
boot/riscv-pk/Config.in deleted +0 -14
deleted file mode 100644
index b4fe36590f..0000000000
@@ -1,14 +0,0 @@
-comment "riscv-pk needs a Linux kernel to be built"
-	depends on BR2_riscv
-	depends on !BR2_LINUX_KERNEL
-
-config BR2_TARGET_RISCV_PK
-	bool "riscv-pk"
-	depends on BR2_riscv
-	depends on BR2_LINUX_KERNEL
-	help
-	  The RISC-V Proxy Kernel (pk) package contains the Berkeley
-	  Boot Loader (BBL) which has been designed to boot a Linux
-	  kernel on a RISC-V processor.
-
-	  https://github.com/riscv/riscv-pk.git
boot/riscv-pk/riscv-pk.mk deleted +0 -32
deleted file mode 100644
index 0ab5879ee4..0000000000
@@ -1,32 +0,0 @@
-################################################################################
-#
-# riscv-pk
-#
-################################################################################
-
-RISCV_PK_VERSION = 706cc77c369fd3e4734b5a6aa813d421347f1814
-RISCV_PK_SITE = git://github.com/riscv/riscv-pk.git
-RISCV_PK_LICENSE = BSD-3-Clause
-RISCV_PK_LICENSE_FILES = LICENSE
-RISCV_PK_DEPENDENCIES = linux
-RISCV_PK_SUBDIR = build
-RISCV_PK_INSTALL_IMAGES = YES
-
-define RISCV_PK_CONFIGURE_CMDS
-	mkdir -p $(@D)/build
-	(cd $(@D)/build; \
-		$(TARGET_CONFIGURE_OPTS) ../configure \
-		--host=$(GNU_TARGET_NAME) \
-		--with-payload=$(BINARIES_DIR)/vmlinux \
-	)
-endef
-
-define RISCV_PK_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/build bbl
-endef
-
-define RISCV_PK_INSTALL_IMAGES_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/build/bbl $(BINARIES_DIR)/bbl
-endef
-
-$(eval $(generic-package))
Signature · 1 line
2.21.0
#7 lore raw

PATCH 3/3 boot: riscv: Remove riscv-pk

Hello,

Quoted 3 lines · On Fri, 15 Mar 2019 23:06:39 +0000 Alistair Francis <[email protected]>…

Now that OpenSBI is supported remove BBL (riscv-pk).

This commit is not enough: you do not update the qemu_riscv64_virt_defconfig and qemu_riscv32_virt_defconfig, which use riscv-pk. They should be converted to use opensbi instead, and of course be runtime tested under Qemu.

And of course, it'd be nice if Mark Corbin, who added riscv-pk, could give his opinion about the replacement of riscv-pk by opensbi.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#8 lore raw

PATCH 3/3 boot: riscv: Remove riscv-pk

Hello

Quoted 7 lines · Thomas Petazzoni

Hello,

Quoted 2 lines · On Fri, 15 Mar 2019 23:06:39 +0000 Alistair Francis <[email protected]>…

Now that OpenSBI is supported remove BBL (riscv-pk).

Quoted 8 lines
Quoted 1 line

This commit is not enough: you do not update the qemu_riscv64_virt_defconfig and qemu_riscv32_virt_defconfig, which use riscv-pk. They should be converted to use opensbi instead, and of course be runtime tested under Qemu.

And of course, it'd be nice if Mark Corbin, who added riscv-pk, could give his opinion about the replacement of riscv-pk by opensbi.

I don't think that removing support for riscv-pk at this stage is desirable. I imagine that the majority (if not all) RISC-V systems have been using riscv-pk (BBL) up until this point, including the HiFive Unleashed board, so I expect that there are a lot of systems and people with time invested in using it. That said, I always imagined a migration path from riscv-pk to an alternative such as U-Boot (or OpenSBI or whatever).

As the first release of OpenSBI was only at the end of January 2019, I would strongly suggest that we keep riscv-pk for a period of time (possibly commenting the intention to eventually deprecate it in favour of OpenSBI). This will give OpenSBI time to mature and users of riscv-pk a period to evaluate it and consider migrating.

I do think that it would be a good start to test the existing QEMU virt configurations with OpenSBI and then update them as necessary.

Regards

Mark

Quoted 4 lines

Thanks!

Thomas

Signature · 3 lines
Mark Corbin
Embecosm Ltd.
https://www.embecosm.com
#9 lore raw

PATCH 3/3 boot: riscv: Remove riscv-pk

Quoted 20 lines · Mark Corbin

Hello

Quoted 7 lines · Thomas Petazzoni

Hello,

Quoted 2 lines · On Fri, 15 Mar 2019 23:06:39 +0000 Alistair Francis <[email protected]>…

Now that OpenSBI is supported remove BBL (riscv-pk).

Quoted 8 lines
Quoted 1 line

This commit is not enough: you do not update the qemu_riscv64_virt_defconfig and qemu_riscv32_virt_defconfig, which use riscv-pk. They should be converted to use opensbi instead, and of course be runtime tested under Qemu.

And of course, it'd be nice if Mark Corbin, who added riscv-pk, could give his opinion about the replacement of riscv-pk by opensbi.

Quoted 7 lines

I don't think that removing support for riscv-pk at this stage is desirable. I imagine that the majority (if not all) RISC-V systems have been using riscv-pk (BBL) up until this point, including the HiFive Unleashed board, so I expect that there are a lot of systems and people with time invested in using it. That said, I always imagined a migration path from riscv-pk to an alternative such as U-Boot (or OpenSBI or whatever).

I agree that up until OpenSBI almost all boards would have been using BBL. The problem with BBL is that people were never investing time into it. There was never a formal release and the code base is difficult to maintain. I think that the sooner we can replace it the better. Yocto/OpenEmbedded has fully swapped and Fedora is looking at swapping as well.

OpenSBI allows us to not compile the kernel into the boot loader when booting with QEMU. It also allows us to boot directly into u-boot on QEMU and on hardware (with u-boot 2019.04). I think leaving it in confuses people who might continue to use it as that is what they have seen before, even though it is a bad choice.

Quoted 9 lines

As the first release of OpenSBI was only at the end of January 2019, I would strongly suggest that we keep riscv-pk for a period of time (possibly commenting the intention to eventually deprecate it in favour of OpenSBI). This will give OpenSBI time to mature and users of riscv-pk a period to evaluate it and consider migrating.

I do think that it would be a good start to test the existing QEMU virt configurations with OpenSBI and then update them as necessary.

Yep, I'll update the configurations in v2 as well as the documentation. OpenSBI is well tested on QEMU in general.

Alistair

Quoted 14 lines

Regards

Mark

Quoted 4 lines

Thanks!

Thomas

--
Mark Corbin
Embecosm Ltd.
https://www.embecosm.com

#10 lore raw

PATCH 3/3 boot: riscv: Remove riscv-pk

Hello Alistair

Quoted 26 lines · Alistair Francis
Quoted 18 lines · Mark Corbin

Hello

Quoted 7 lines · Thomas Petazzoni

Hello,

Quoted 2 lines · On Fri, 15 Mar 2019 23:06:39 +0000 Alistair Francis <[email protected]>…

Now that OpenSBI is supported remove BBL (riscv-pk).

Quoted 8 lines
Quoted 1 line

This commit is not enough: you do not update the qemu_riscv64_virt_defconfig and qemu_riscv32_virt_defconfig, which use riscv-pk. They should be converted to use opensbi instead, and of course be runtime tested under Qemu.

And of course, it'd be nice if Mark Corbin, who added riscv-pk, could give his opinion about the replacement of riscv-pk by opensbi.

Quoted 7 lines

I don't think that removing support for riscv-pk at this stage is desirable. I imagine that the majority (if not all) RISC-V systems have been using riscv-pk (BBL) up until this point, including the HiFive Unleashed board, so I expect that there are a lot of systems and people with time invested in using it. That said, I always imagined a migration path from riscv-pk to an alternative such as U-Boot (or OpenSBI or whatever).

Quoted 6 lines

I agree that up until OpenSBI almost all boards would have been using BBL. The problem with BBL is that people were never investing time into it. There was never a formal release and the code base is difficult to maintain. I think that the sooner we can replace it the better. Yocto/OpenEmbedded has fully swapped and Fedora is looking at swapping as well.

I'd forgotten that riscv-pk support is of course in the current LTS release for those who want it...so I think that it does make sense to drop it at this point.

Regards

Mark

Signature · 3 lines
Mark Corbin
Embecosm Ltd.
https://www.embecosm.com
#11 lore raw

PATCH 3/3 boot: riscv: Remove riscv-pk

In reply to Thomas Petazzoni
Quoted 6 lines · Thomas Petazzoni

Hello,

On Fri, 15 Mar 2019 23:06:39 +0000 Alistair Francis <[email protected]> wrote:

Quoted 8 lines
Quoted 3 lines

Now that OpenSBI is supported remove BBL (riscv-pk).

This commit is not enough: you do not update the qemu_riscv64_virt_defconfig and qemu_riscv32_virt_defconfig, which use riscv-pk. They should be converted to use opensbi instead, and of course be runtime tested under Qemu.

Ah ok. I didn't think about the defconfigs. I'll update those as well as the instructions.

Alistair

Quoted 11 lines

And of course, it'd be nice if Mark Corbin, who added riscv-pk, could give his opinion about the replacement of riscv-pk by opensbi.

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#12 lore raw

PATCH 1/3 arch: riscv: Add a RISC-V Platform option

In reply to Alistair Francis

Hello Alistair,

Thanks for your contribution.

Quoted 8 lines · On Fri, 15 Mar 2019 23:06:38 +0000 Alistair Francis <[email protected]>…

Add a RISC-V Platform option. At the moment only QEMU platforms are supported, but in the future this can be extended to include real hardware platforms (such as the Unleashed board).

My goal is that this platform will set default config options (such as the default defconfig for the kernel) based on the platform value.

We never describe each and every board using Buildroot options. If we were to do that, we would have gazillion of options for the thousands of boards that exist.

So, we are not going to accept this patch. What we do however is add a number of defconfigs for well known platforms, just like:

configs/qemu_riscv32_virt_defconfig
configs/qemu_riscv64_virt_defconfig

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#13 lore raw

PATCH 1/3 arch: riscv: Add a RISC-V Platform option

Quoted 12 lines · Thomas Petazzoni

Hello Alistair,

Thanks for your contribution.

Quoted 4 lines · On Fri, 15 Mar 2019 23:06:38 +0000 Alistair Francis <[email protected]>…

Add a RISC-V Platform option. At the moment only QEMU platforms are supported, but in the future this can be extended to include real hardware platforms (such as the Unleashed board).

Quoted 8 lines
Quoted 4 lines

My goal is that this platform will set default config options (such as the default defconfig for the kernel) based on the platform value.

We never describe each and every board using Buildroot options. If we were to do that, we would have gazillion of options for the thousands of boards that exist.

Yep, that makes sense.

Quoted 6 lines

So, we are not going to accept this patch. What we do however is add a number of defconfigs for well known platforms, just like:

configs/qemu_riscv32_virt_defconfig
configs/qemu_riscv64_virt_defconfig

Update in v2.

Alistair

Quoted 8 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com