Skip to contentSkip to conversation

riscv: Various fixes and small enhancements

PATCH Applied Bin Meng 4 participants 21 messages Jun 26, 2023 – Aug 12, 2023

Subsystems (2)
lore
Share & tools
lore

Bin Meng

author
#0 lore raw

cover riscv: Various fixes and small enhancements

A bug report [1] was filed recently against HiFive Unleashed board that it did not build. Although I could not reproduce the build failure, it does make sense to upgrade the OpenSBI version for this board, as discussed in the bug report.

Now OpenSBI version is bumped up to 1.3 in this series for all RISC-V boards. For HiFive Unleashed board I decided to use the latest U-Boot release as well, which requires some new changes.

The Kconfig options of RISC-V boards have been cleaned up. Instructions of using QEMU to test the HiFive Unleashed board images are added.

[1] https://bugs.busybox.net/show_bug.cgi?id=15658

Bin Meng (10):
configs/hifive_unleashed: Update to use OpenSBI 1.2 configs/hifive_unleashed: Update to use U-Boot v2023.04 configs/hifive_unleashed: Enable BR2_RISCV_ISA_CUSTOM_RVA explicitly configs/beaglev_defconfig: Enable BR2_RISCV_ISA_CUSTOM_RVA explicitly arch/Config.in.riscv: Remove BR2_RISCV_ISA_CUSTOM_RVA from
BR2_riscv_custom
configs: riscv: Drop BR2_TARGET_OPENSBI_CUSTOM_VERSION boot/opensbi: Config.in: Cosmetic style fix
boot/opensbi: Bump to version 1.3
board/sifive: hifive-unleashed: Update rootfs offset board/sifive: hifive-unleashed: Include QEMU instructions in
readme.txt

 arch/Config.in.riscv                            |  1 -
 .../sifive/hifive-unleashed/genimage_sdcard.cfg |  1 +
 board/sifive/hifive-unleashed/readme.txt        | 17 +++++++++++++++++
 boot/opensbi/Config.in                          |  6 +++---
 boot/opensbi/opensbi.hash                       |  2 +-
 configs/beaglev_defconfig                       |  1 +
 configs/hifive_unleashed_defconfig              | 10 +++++-----
 configs/nezha_defconfig                         |  2 --
 configs/qemu_riscv32_virt_defconfig             |  2 --
 configs/qemu_riscv64_virt_defconfig             |  2 --
 configs/sipeed_lichee_rv_defconfig              |  2 --
 configs/sipeed_lichee_rv_dock_defconfig         |  2 --
 configs/spike_riscv64_defconfig                 |  2 --
 13 files changed, 28 insertions(+), 22 deletions(-)
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#1 lore raw

PATCH 1/10 configs/hifive_unleashed: Update to use OpenSBI 1.2

From: Bin Meng <[email protected]>

Since the rest of RISC-V boards have been switched to use OpenSBI 1.2, let's update hifive_unleashed to use OpenSBI 1.2 too.

Resolves: https://bugs.busybox.net/show_bug.cgi?id=15658

---

 configs/hifive_unleashed_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configs/hifive_unleashed_defconfig +1 -1
index 2b6ee6c08e..0440b14ba5 100644
@@ -38,7 +38,7 @@ BR2_LINUX_KERNEL_INSTALL_TARGET=y
 # Bootloader
 BR2_TARGET_OPENSBI=y
 BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="0.9"
+BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#2 lore raw

PATCH 2/10 configs/hifive_unleashed: Update to use U-Boot v2023.04

In reply to Bin Meng

From: Bin Meng <[email protected]>

With upstream commit ae2d9506a36c ("riscv: sifive: Rename fu540 board to unleashed") in U-Boot v2021.07 release, the defconfig for SiFive Unleashed board has been changed to sifive_unleashed_defconfig.

Also newer U-Boot has deprecated the usage of SPL_FIT_GENERATOR to generate u-boot.itb hence there is no 'u-boot.itb' target in the U-Boot Makefile anymore. Instead binman is used to assemble the u-boot.itb image.

We will need to switch to BR2_TARGET_UBOOT_FORMAT_CUSTOM for installing u-boot.itb.

Switch over to use the latest U-Boot v2023.04 release.

---

 configs/hifive_unleashed_defconfig | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
configs/hifive_unleashed_defconfig +4 -3
index 0440b14ba5..35cb3558f9 100644
@@ -42,12 +42,13 @@ BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
-BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2021.01"
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2023.04"
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
-BR2_TARGET_UBOOT_BOARD_DEFCONFIG="sifive_fu540"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="sifive_unleashed"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_OPENSBI=y
-BR2_TARGET_UBOOT_FORMAT_ITB=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb"
 BR2_TARGET_UBOOT_SPL=y
 
 # Host tools
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#3 lore raw

PATCH 3/10 configs/hifive_unleashed: Enable BR2_RISCV_ISA_CUSTOM_RVA explicitly

In reply to Bin Meng

From: Bin Meng <[email protected]>

BR2_RISCV_ISA_CUSTOM_RVA is currently not explicitly listed as it is selected by BR2_riscv_custom. This looks confusing. Let's enable it.

---

 configs/hifive_unleashed_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/hifive_unleashed_defconfig +1 -0
index 35cb3558f9..80c5e48f96 100644
@@ -2,6 +2,7 @@
 BR2_riscv=y
 BR2_riscv_custom=y
 BR2_RISCV_ISA_CUSTOM_RVM=y
+BR2_RISCV_ISA_CUSTOM_RVA=y
 BR2_RISCV_ISA_CUSTOM_RVF=y
 BR2_RISCV_ISA_CUSTOM_RVD=y
 BR2_RISCV_ISA_CUSTOM_RVC=y
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#4 lore raw

PATCH 4/10 configs/beaglev_defconfig: Enable BR2_RISCV_ISA_CUSTOM_RVA explicitly

In reply to Bin Meng

From: Bin Meng <[email protected]>

BR2_RISCV_ISA_CUSTOM_RVA is currently not explicitly listed as it is selected by BR2_riscv_custom. This looks confusing. Let's enable it.

---

 configs/beaglev_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/beaglev_defconfig +1 -0
index 79af8c2ece..42c732b973 100644
@@ -1,6 +1,7 @@
 BR2_riscv=y
 BR2_riscv_custom=y
 BR2_RISCV_ISA_CUSTOM_RVM=y
+BR2_RISCV_ISA_CUSTOM_RVA=y
 BR2_RISCV_ISA_CUSTOM_RVF=y
 BR2_RISCV_ISA_CUSTOM_RVD=y
 BR2_RISCV_ISA_CUSTOM_RVC=y
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#5 lore raw

PATCH 5/10 arch/Config.in.riscv: Remove BR2_RISCV_ISA_CUSTOM_RVA from BR2_riscv_custom

In reply to Bin Meng

From: Bin Meng <[email protected]>

BR2_riscv_custom should only contain the basic I extension. The A extension should be optional and selected by board configs.

---

 arch/Config.in.riscv | 1 -
 1 file changed, 1 deletion(-)
arch/Config.in.riscv +0 -1
index b5e84389e0..853e8deb06 100644
@@ -35,7 +35,6 @@ config BR2_riscv_g
 config BR2_riscv_custom
 	bool "Custom architecture"
 	select BR2_RISCV_ISA_RVI
-	select BR2_RISCV_ISA_CUSTOM_RVA
 
 endchoice
 
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#6 lore raw

PATCH 6/10 configs: riscv: Drop BR2_TARGET_OPENSBI_CUSTOM_VERSION

In reply to Bin Meng

From: Bin Meng <[email protected]>

Since commit 64f1f82385b2 ("boot/opensbi: Bump to version 1.2"), the default OpenSBI version has been bumped up to 1.2. With that, there is no need to define a custom version in each RISC-V board's defconfig files.

---

 configs/hifive_unleashed_defconfig      | 2 --
 configs/nezha_defconfig                 | 2 --
 configs/qemu_riscv32_virt_defconfig     | 2 --
 configs/qemu_riscv64_virt_defconfig     | 2 --
 configs/sipeed_lichee_rv_defconfig      | 2 --
 configs/sipeed_lichee_rv_dock_defconfig | 2 --
 configs/spike_riscv64_defconfig         | 2 --
 7 files changed, 14 deletions(-)
configs/hifive_unleashed_defconfig +0 -2
index 80c5e48f96..013a1423c0 100644
@@ -38,8 +38,6 @@ BR2_LINUX_KERNEL_INSTALL_TARGET=y
 
 # Bootloader
 BR2_TARGET_OPENSBI=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
configs/nezha_defconfig +0 -2
index dd94707905..b4c5b4d0ba 100644
@@ -15,8 +15,6 @@ BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_OPENSBI=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 # BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
 BR2_TARGET_UBOOT=y
configs/qemu_riscv32_virt_defconfig +0 -2
index 03c871282e..01922ac151 100644
@@ -25,8 +25,6 @@ BR2_LINUX_KERNEL_IMAGE=y
 
 # Bootloader
 BR2_TARGET_OPENSBI=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 
 # host-qemu for gitlab testing
configs/qemu_riscv64_virt_defconfig +0 -2
index 666500d889..8b729f137d 100644
@@ -25,8 +25,6 @@ BR2_LINUX_KERNEL_IMAGE=y
 
 # Bootloader
 BR2_TARGET_OPENSBI=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 
 # host-qemu for gitlab testing
configs/sipeed_lichee_rv_defconfig +0 -2
index 750d2d6e3b..8ad587d35f 100644
@@ -14,8 +14,6 @@ BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_OPENSBI=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 # BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
 BR2_TARGET_UBOOT=y
configs/sipeed_lichee_rv_dock_defconfig +0 -2
index a228cd8cb7..b6ac7aa31f 100644
@@ -22,8 +22,6 @@ BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_OPENSBI=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 # BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
 BR2_TARGET_UBOOT=y
configs/spike_riscv64_defconfig +0 -2
index 73ea566084..a6f746eb3f 100644
@@ -9,8 +9,6 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_1=y
 BR2_TARGET_ROOTFS_CPIO=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_OPENSBI=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 BR2_TARGET_OPENSBI_LINUX_PAYLOAD=y
 BR2_PACKAGE_HOST_RISCV_ISA_SIM=y
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#7 lore raw

Re: [Buildroot] [PATCH 06/10] configs: riscv: Drop BR2_TARGET_OPENSBI_CUSTOM_VERSION

Bin, All,

On 2023-06-27 00:00 +0800, Bin Meng spake thusly:

Quoted 6 lines

From: Bin Meng <[email protected]>

Since commit 64f1f82385b2 ("boot/opensbi: Bump to version 1.2"), the default OpenSBI version has been bumped up to 1.2. With that, there is no need to define a custom version in each RISC-V board's defconfig files.

In fact, no, because opensbi is a "critical" component part of the boot chain and, like uboot or the kernel, we want to pin the version we use in defconfig files. We only want the v ersion to be bumped in defconfig, when someone actually tested the defconfig still generates a bootable system.

Regards,
Yann E. MORIN.

Quoted 110 lines

---

 configs/hifive_unleashed_defconfig      | 2 --
 configs/nezha_defconfig                 | 2 --
 configs/qemu_riscv32_virt_defconfig     | 2 --
 configs/qemu_riscv64_virt_defconfig     | 2 --
 configs/sipeed_lichee_rv_defconfig      | 2 --
 configs/sipeed_lichee_rv_dock_defconfig | 2 --
 configs/spike_riscv64_defconfig         | 2 --
 7 files changed, 14 deletions(-)
configs/hifive_unleashed_defconfig +0 -2
index 80c5e48f96..013a1423c0 100644
@@ -38,8 +38,6 @@ BR2_LINUX_KERNEL_INSTALL_TARGET=y
 
 # Bootloader
 BR2_TARGET_OPENSBI=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
configs/nezha_defconfig +0 -2
index dd94707905..b4c5b4d0ba 100644
@@ -15,8 +15,6 @@ BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_OPENSBI=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 # BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
 BR2_TARGET_UBOOT=y
configs/qemu_riscv32_virt_defconfig +0 -2
index 03c871282e..01922ac151 100644
@@ -25,8 +25,6 @@ BR2_LINUX_KERNEL_IMAGE=y
 
 # Bootloader
 BR2_TARGET_OPENSBI=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 
 # host-qemu for gitlab testing
configs/qemu_riscv64_virt_defconfig +0 -2
index 666500d889..8b729f137d 100644
@@ -25,8 +25,6 @@ BR2_LINUX_KERNEL_IMAGE=y
 
 # Bootloader
 BR2_TARGET_OPENSBI=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 
 # host-qemu for gitlab testing
configs/sipeed_lichee_rv_defconfig +0 -2
index 750d2d6e3b..8ad587d35f 100644
@@ -14,8 +14,6 @@ BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_OPENSBI=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 # BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
 BR2_TARGET_UBOOT=y
configs/sipeed_lichee_rv_dock_defconfig +0 -2
index a228cd8cb7..b6ac7aa31f 100644
@@ -22,8 +22,6 @@ BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_OPENSBI=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 # BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
 BR2_TARGET_UBOOT=y
configs/spike_riscv64_defconfig +0 -2
index 73ea566084..a6f746eb3f 100644
@@ -9,8 +9,6 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_1=y
 BR2_TARGET_ROOTFS_CPIO=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_OPENSBI=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
-BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.2"
 BR2_TARGET_OPENSBI_PLAT="generic"
 BR2_TARGET_OPENSBI_LINUX_PAYLOAD=y
 BR2_PACKAGE_HOST_RISCV_ISA_SIM=y
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#8 lore raw

Re: [Buildroot] [PATCH 06/10] configs: riscv: Drop BR2_TARGET_OPENSBI_CUSTOM_VERSION

Hi Yann,

Quoted 11 lines · Yann E. MORIN

Bin, All,

On 2023-06-27 00:00 +0800, Bin Meng spake thusly:

Quoted 6 lines

From: Bin Meng <[email protected]>

Since commit 64f1f82385b2 ("boot/opensbi: Bump to version 1.2"), the default OpenSBI version has been bumped up to 1.2. With that, there is no need to define a custom version in each RISC-V board's defconfig files.

Quoted 5 lines

In fact, no, because opensbi is a "critical" component part of the boot chain and, like uboot or the kernel, we want to pin the version we use in defconfig files. We only want the v ersion to be bumped in defconfig, when someone actually tested the defconfig still generates a bootable system.

Makes sense to me.

But I would argue at least we should update qemu_riscv32_virt_defconfig and qemu_riscv64_virt_defconfig to use the latest OpenSBI due to the reason that:

1. they are the main platforms to develop and test OpenSBI
2. latest OpenSBI binaries will always be integrated into QEMU as the default bios

thoughts?

Regards,
Bin
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#9 lore raw

Re: [Buildroot] [PATCH 06/10] configs: riscv: Drop BR2_TARGET_OPENSBI_CUSTOM_VERSION

Bin, All,

On 2023-06-27 10:11 +0800, Bin Meng spake thusly:

Quoted 12 lines · Yann E. MORIN
Quoted 11 lines

On 2023-06-27 00:00 +0800, Bin Meng spake thusly:

Quoted 5 lines

From: Bin Meng <[email protected]>
Since commit 64f1f82385b2 ("boot/opensbi: Bump to version 1.2"), the default OpenSBI version has been bumped up to 1.2. With that, there is no need to define a custom version in each RISC-V board's defconfig files.

In fact, no, because opensbi is a "critical" component part of the boot chain and, like uboot or the kernel, we want to pin the version we use in defconfig files. We only want the v ersion to be bumped in defconfig, when someone actually tested the defconfig still generates a bootable system.

Quoted 8 lines

Makes sense to me.
But I would argue at least we should update qemu_riscv32_virt_defconfig and qemu_riscv64_virt_defconfig to use the latest OpenSBI due to the reason that:
1. they are the main platforms to develop and test OpenSBI
2. latest OpenSBI binaries will always be integrated into QEMU as the default bios
thoughts?

For the qemu defconfigs, I wouild indeed understand that we use the latest version; the rationale looks sound.

Regards,
Yann E. MORIN.

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#10 lore raw

PATCH 7/10 boot/opensbi: Config.in: Cosmetic style fix

In reply to Bin Meng

From: Bin Meng <[email protected]>

Use space intead of tab before 'if'.

---

 boot/opensbi/Config.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
boot/opensbi/Config.in +2 -2
index 5e6b8d158e..99c4989479 100644
@@ -57,10 +57,10 @@ endif
 
 config BR2_TARGET_OPENSBI_VERSION
 	string
-	default "1.2"	if BR2_TARGET_OPENSBI_LATEST_VERSION
+	default "1.2" if BR2_TARGET_OPENSBI_LATEST_VERSION
 	default BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE \
 		if BR2_TARGET_OPENSBI_CUSTOM_VERSION
-	default "custom"	if BR2_TARGET_OPENSBI_CUSTOM_TARBALL
+	default "custom" if BR2_TARGET_OPENSBI_CUSTOM_TARBALL
 	default BR2_TARGET_OPENSBI_CUSTOM_REPO_VERSION \
 		if BR2_TARGET_OPENSBI_CUSTOM_GIT
 
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#11 lore raw

PATCH 8/10 boot/opensbi: Bump to version 1.3

In reply to Bin Meng

From: Bin Meng <[email protected]>

---

 boot/opensbi/Config.in    | 4 ++--
 boot/opensbi/opensbi.hash | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
boot/opensbi/Config.in +2 -2
index 99c4989479..de2f0aae20 100644
@@ -19,7 +19,7 @@ choice
 	  Select the specific OpenSBI version you want to use
 
 config BR2_TARGET_OPENSBI_LATEST_VERSION
-	bool "1.2"
+	bool "1.3"
 
 config BR2_TARGET_OPENSBI_CUSTOM_VERSION
 	bool "Custom version"
@@ -57,7 +57,7 @@ endif
 
 config BR2_TARGET_OPENSBI_VERSION
 	string
-	default "1.2" if BR2_TARGET_OPENSBI_LATEST_VERSION
+	default "1.3" if BR2_TARGET_OPENSBI_LATEST_VERSION
 	default BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE \
 		if BR2_TARGET_OPENSBI_CUSTOM_VERSION
 	default "custom" if BR2_TARGET_OPENSBI_CUSTOM_TARBALL
boot/opensbi/opensbi.hash +1 -1
index dbc77e856f..980fb141dc 100644
@@ -1,3 +1,3 @@
 # locally computed
-sha256  8fcbce598a73acc2c7f7d5607d46b9d5107d3ecbede8f68f42631dcfc25ef2b2  opensbi-1.2.tar.gz
+sha256  2c0501eb3475f463b15f5b8531996f64604ea49e0e3ed040ecbd1fc27ecd8c5c  opensbi-1.3.tar.gz
 sha256  82d13fb1bf6bb162629deeea9eb9c117e74548d3b707e478967691fe79a68e21  COPYING.BSD
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#12 lore raw

PATCH 9/10 board/sifive: hifive-unleashed: Update rootfs offset

In reply to Bin Meng

From: Bin Meng <[email protected]>

As the rootfs size is set to 60M, let's put it right on the 4M offset in the SD card, so that the generated sdcard.img can be exactly 64M.

---

 board/sifive/hifive-unleashed/genimage_sdcard.cfg | 1 +
 1 file changed, 1 insertion(+)
board/sifive/hifive-unleashed/genimage_sdcard.cfg +1 -0
index 079ac5ed26..99e3525a8c 100644
@@ -17,6 +17,7 @@ image sdcard.img {
 
 	partition rootfs {
 		image = "rootfs.ext4"
+		offset = 4076K
 		partition-type-uuid = 0fc63daf-8483-4772-8e79-3d69d8477de4
 		bootable = true
 	}
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#13 lore raw

Re: [Buildroot] [PATCH 09/10] board/sifive: hifive-unleashed: Update rootfs offset

Bin, All,

On 2023-06-27 00:00 +0800, Bin Meng spake thusly:

Quoted 4 lines

From: Bin Meng <[email protected]>

As the rootfs size is set to 60M, let's put it right on the 4M offset in the SD card, so that the generated sdcard.img can be exactly 64M.

As much I like power-of-two numbers, is there a technical reason to hit exactly 64MiB?

Regards,
Yann E. MORIN.

Quoted 25 lines

---

 board/sifive/hifive-unleashed/genimage_sdcard.cfg | 1 +
 1 file changed, 1 insertion(+)
board/sifive/hifive-unleashed/genimage_sdcard.cfg +1 -0
index 079ac5ed26..99e3525a8c 100644
@@ -17,6 +17,7 @@ image sdcard.img {
 
 	partition rootfs {
 		image = "rootfs.ext4"
+		offset = 4076K
 		partition-type-uuid = 0fc63daf-8483-4772-8e79-3d69d8477de4
 		bootable = true
 	}
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#14 lore raw

Re: [Buildroot] [PATCH 09/10] board/sifive: hifive-unleashed: Update rootfs offset

In reply to Bin Meng
Quoted 7 lines · On Tue, 27 Jun 2023 00:00:29 +0800 Bin Meng <[email protected]> wrote:

From: Bin Meng <[email protected]>

As the rootfs size is set to 60M, let's put it right on the 4M offset in the SD card, so that the generated sdcard.img can be exactly 64M.

---

Applied to next after adding more explanations about the "why 64 MB":
because Qemu requires power of two sizes for the image files.

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#15 lore raw

PATCH 10/10 board/sifive: hifive-unleashed: Include QEMU instructions in readme.txt

In reply to Bin Meng

From: Bin Meng <[email protected]>

The upstream QEMU 'sifive_u' machine supports running upstream U-Boot for the SiFive HiFive Unleashed board out of the box.

Add the QEMU instructions for testing in readme.txt.

---

 board/sifive/hifive-unleashed/readme.txt | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
board/sifive/hifive-unleashed/readme.txt +17 -0
index 3263913e9c..e9ccb26fa6 100644
@@ -113,3 +113,20 @@ Booting the SPI flash on the board
 
 Make sure that the all DIP switches are set to the off position for
 default boot mode (MSEL mode = 0110) to boot from SPI flash.
+
+Testing under QEMU
+==================
+
+The SD card image can be tested using QEMU:
+
+$ qemu-system-riscv64 -M sifive_u,msel=11 -smp 5 -m 8G \
+    -display none -serial stdio -nic user \
+    -bios output/images/u-boot-spl.bin \
+    -drive file=output/images/sdcard.img,if=sd
+
+The SPI flash image can be tested with a slightly different command:
+
+$ qemu-system-riscv64 -M sifive_u,msel=6 -smp 5 -m 8G \
+    -display none -serial stdio -nic user \
+    -bios output/images/u-boot-spl.bin \
+    -drive file=output/images/spi-nor.img,if=mtd
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#16 lore raw

Re: [Buildroot] [PATCH 10/10] board/sifive: hifive-unleashed: Include QEMU instructions in readme.txt

Bin, All,

On 2023-06-27 00:00 +0800, Bin Meng spake thusly:

Quoted 6 lines

From: Bin Meng <[email protected]>

The upstream QEMU 'sifive_u' machine supports running upstream U-Boot for the SiFive HiFive Unleashed board out of the box.

Add the QEMU instructions for testing in readme.txt.

Ah, is the 64MiB SDcard required to be bootable under qemu?

I.e. is it the same issue as fixed by 6f9e83f5f74d (support/testing:
test_ubi: reduce the rootfs.ubi size to 64M to match the Qemu emulated flash device)?

Regards,
Yann E. MORIN.

Quoted 38 lines

---

 board/sifive/hifive-unleashed/readme.txt | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
board/sifive/hifive-unleashed/readme.txt +17 -0
index 3263913e9c..e9ccb26fa6 100644
@@ -113,3 +113,20 @@ Booting the SPI flash on the board
 
 Make sure that the all DIP switches are set to the off position for
 default boot mode (MSEL mode = 0110) to boot from SPI flash.
+
+Testing under QEMU
+==================
+
+The SD card image can be tested using QEMU:
+
+$ qemu-system-riscv64 -M sifive_u,msel=11 -smp 5 -m 8G \
+    -display none -serial stdio -nic user \
+    -bios output/images/u-boot-spl.bin \
+    -drive file=output/images/sdcard.img,if=sd
+
+The SPI flash image can be tested with a slightly different command:
+
+$ qemu-system-riscv64 -M sifive_u,msel=6 -smp 5 -m 8G \
+    -display none -serial stdio -nic user \
+    -bios output/images/u-boot-spl.bin \
+    -drive file=output/images/spi-nor.img,if=mtd
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#17 lore raw

Re: [Buildroot] [PATCH 10/10] board/sifive: hifive-unleashed: Include QEMU instructions in readme.txt

Quoted 4 lines · Yann E. MORIN

Bin, All,

On 2023-06-27 00:00 +0800, Bin Meng spake thusly:

Quoted 8 lines
Quoted 6 lines

From: Bin Meng <[email protected]>

The upstream QEMU 'sifive_u' machine supports running upstream U-Boot for the SiFive HiFive Unleashed board out of the box.

Add the QEMU instructions for testing in readme.txt.

Ah, is the 64MiB SDcard required to be bootable under qemu?

Yes, QEMU requires the SD card to be a power of 2

https://gitlab.com/qemu-project/qemu/-/commit/a9bcedd15a5834ca9ae6c3a97933e85ac7edbd36

Alistair

Quoted 53 lines

I.e. is it the same issue as fixed by 6f9e83f5f74d (support/testing:
test_ubi: reduce the rootfs.ubi size to 64M to match the Qemu emulated flash device)?

Regards,
Yann E. MORIN.

Quoted 34 lines

---

 board/sifive/hifive-unleashed/readme.txt | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
board/sifive/hifive-unleashed/readme.txt +17 -1
index 3263913e9c..e9ccb26fa6 100644
@@ -113,3 +113,20 @@ Booting the SPI flash on the board
 
 Make sure that the all DIP switches are set to the off position for
 default boot mode (MSEL mode = 0110) to boot from SPI flash.
+
+Testing under QEMU
+==================
+
+The SD card image can be tested using QEMU:
+
+$ qemu-system-riscv64 -M sifive_u,msel=11 -smp 5 -m 8G \
+    -display none -serial stdio -nic user \
+    -bios output/images/u-boot-spl.bin \
+    -drive file=output/images/sdcard.img,if=sd
+
+The SPI flash image can be tested with a slightly different command:
+
+$ qemu-system-riscv64 -M sifive_u,msel=6 -smp 5 -m 8G \
+    -display none -serial stdio -nic user \
+    -bios output/images/u-boot-spl.bin \
+    -drive file=output/images/spi-nor.img,if=mtd
--

2.34.1

Quoted 4 lines

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
Quoted 5 lines

'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

author
#18 lore raw

Re: [Buildroot] [PATCH 10/10] board/sifive: hifive-unleashed: Include QEMU instructions in readme.txt

Hi Yann,

Quoted 11 lines · Alistair Francis
Quoted 9 lines · Yann E. MORIN

Bin, All,

On 2023-06-27 00:00 +0800, Bin Meng spake thusly:

Quoted 5 lines

From: Bin Meng <[email protected]>

The upstream QEMU 'sifive_u' machine supports running upstream U-Boot for the SiFive HiFive Unleashed board out of the box.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Add the QEMU instructions for testing in readme.txt.

Ah, is the 64MiB SDcard required to be bootable under qemu?

Yes, QEMU requires the SD card to be a power of 2

https://gitlab.com/qemu-project/qemu/-/commit/a9bcedd15a5834ca9ae6c3a97933e85ac7edbd36

How about these 2 patches? Do they look good?

Regards,
Bin
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#19 lore raw

Re: [Buildroot] [PATCH 10/10] board/sifive: hifive-unleashed: Include QEMU instructions in readme.txt

In reply to Bin Meng

Hello,

+Romain Naour in Cc.

Quoted 9 lines · On Tue, 27 Jun 2023 00:00:30 +0800 Bin Meng <[email protected]> wrote:

From: Bin Meng <[email protected]>

The upstream QEMU 'sifive_u' machine supports running upstream U-Boot for the SiFive HiFive Unleashed board out of the box.

Add the QEMU instructions for testing in readme.txt.

---

Applied to next, thanks.

Now that this defconfig can be booted under Qemu, maybe it makes sense to ensure that our Gitlab CI does some actual testing of the "bootability" of this image under Qemu? Could you have a look at how our qemu_* defconfigs do this, and try to adapt the HiFive Unleashed defconfig to do the same? Romain Naour in Cc is the author/maintainer of this logic that all the testing of Qemu defconfigs in our CI, so I'm sure he can provide guidance if needed.

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#20 lore raw
In reply to Bin Meng

Bin, All,

On 2023-06-27 00:00 +0800, Bin Meng spake thusly:

Quoted 15 lines

A bug report [1] was filed recently against HiFive Unleashed board that it did not build. Although I could not reproduce the build failure, it does make sense to upgrade the OpenSBI version for this board, as discussed in the bug report.

Now OpenSBI version is bumped up to 1.3 in this series for all RISC-V boards. For HiFive Unleashed board I decided to use the latest U-Boot release as well, which requires some new changes.

The Kconfig options of RISC-V boards have been cleaned up. Instructions of using QEMU to test the HiFive Unleashed board images are added.

[1] https://bugs.busybox.net/show_bug.cgi?id=15658

Quoted 7 lines

Bin Meng (10):
configs/hifive_unleashed: Update to use OpenSBI 1.2 configs/hifive_unleashed: Update to use U-Boot v2023.04 configs/hifive_unleashed: Enable BR2_RISCV_ISA_CUSTOM_RVA explicitly configs/beaglev_defconfig: Enable BR2_RISCV_ISA_CUSTOM_RVA explicitly arch/Config.in.riscv: Remove BR2_RISCV_ISA_CUSTOM_RVA from
BR2_riscv_custom

I've applied the first fice patches to master.

Quoted 1 line

configs: riscv: Drop BR2_TARGET_OPENSBI_CUSTOM_VERSION

I'll reply to that one realy soon...

Quoted 2 lines

boot/opensbi: Config.in: Cosmetic style fix
boot/opensbi: Bump to version 1.3

I've applied those two to master too.

Quoted 3 lines

board/sifive: hifive-unleashed: Update rootfs offset board/sifive: hifive-unleashed: Include QEMU instructions in
readme.txt

I'll handle those two very soon.

Thanks!

Regards,
Yann E. MORIN.

Quoted 23 lines
 arch/Config.in.riscv                            |  1 -
 .../sifive/hifive-unleashed/genimage_sdcard.cfg |  1 +
 board/sifive/hifive-unleashed/readme.txt        | 17 +++++++++++++++++
 boot/opensbi/Config.in                          |  6 +++---
 boot/opensbi/opensbi.hash                       |  2 +-
 configs/beaglev_defconfig                       |  1 +
 configs/hifive_unleashed_defconfig              | 10 +++++-----
 configs/nezha_defconfig                         |  2 --
 configs/qemu_riscv32_virt_defconfig             |  2 --
 configs/qemu_riscv64_virt_defconfig             |  2 --
 configs/sipeed_lichee_rv_defconfig              |  2 --
 configs/sipeed_lichee_rv_dock_defconfig         |  2 --
 configs/spike_riscv64_defconfig                 |  2 --
 13 files changed, 28 insertions(+), 22 deletions(-)
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot