riscv: Switch to use generic platform of opensbi bios images
Subsystems (2)
cover riscv: Switch to use generic platform of opensbi bios images
From: Bin Meng <[email protected]>
The RISC-V generic platform is a flattened device tree (FDT) based platform where all platform specific functionality is provided based on FDT passed by previous booting stage. The support was added in upstream opensbi recently.
This series updates QEMU to switch to use generic platform of opensbi bios images.
The patch emails do not contain binary bits, please grab all updates at https://github.com/lbmeng/qemu.git bios branch.
Bin Meng (5):
roms/opensbi: Update to support building bios images for generic
platform
gitlab-ci/opensbi: Update GitLab CI to build generic platform
riscv: Use pre-built bios image of generic platform for virt &
sifive_u
riscv/spike: Change the default bios to use generic platform image
riscv: Suppress the error report for QEMU testing with
riscv_find_firmware()
.gitlab-ci-opensbi.yml | 26 +++++++---------------- hw/riscv/boot.c | 14 ++++++++++--- hw/riscv/sifive_u.c | 4 ++-- hw/riscv/spike.c | 9 ++++++-- hw/riscv/virt.c | 4 ++-- pc-bios/opensbi-riscv32-generic-fw_jump.bin | Bin 0 -> 58032 bytes pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin | Bin 49520 -> 0 bytes pc-bios/opensbi-riscv32-virt-fw_jump.bin | Bin 49504 -> 0 bytes pc-bios/opensbi-riscv64-generic-fw_jump.bin | Bin 0 -> 66680 bytes pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 57936 -> 0 bytes pc-bios/opensbi-riscv64-virt-fw_jump.bin | Bin 57920 -> 0 bytes roms/Makefile | 30 +++++++-------------------- roms/opensbi | 2 +- 13 files changed, 39 insertions(+), 50 deletions(-) create mode 100644 pc-bios/opensbi-riscv32-generic-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin create mode 100644 pc-bios/opensbi-riscv64-generic-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
Signature · 1 line
2.7.4
PATCH 1/5 roms/opensbi: Update to support building bios images for generic platform
From: Bin Meng <[email protected]>
The RISC-V generic platform is a flattened device tree (FDT) based platform where all platform specific functionality is provided based on FDT passed by previous booting stage. The support was added in upstream opensbi recently.
Bring the QEMU roms/opensbi submodule to the upstream opensbi commit:
commit 4f18c6e55049 ("platform: generic: Add Sifive FU540 TLB flush range limit override") with the following changes since v0.7 release:
1bb00ab lib: No need to provide default PMP region using platform callbacks a9eac67 include: sbi_platform: Combine reboot and shutdown into one callback 6585fab lib: utils: Add SiFive test device
4781545 platform: Add Nuclei UX600 platform
3a326af scripts: adapt binary archive script for Nuclei UX600 5bdf022 firmware: fw_base: Remove CSR_MTVEC update check e6c1345 lib: utils/serial: Skip baudrate config if input frequency is zero 01a8c8e lib: utils: Improve fdt_parse_uart8250() API
0a0093b lib: utils: Add fdt_parse_uart8250_node() function 243b0d0 lib: utils: Remove redundant clint_ipi_sync() declaration e3ad7c1 lib: utils: Rename fdt_parse_clint() to fdt_parse_compat_addr() a39cd6f lib: utils: Add FDT match table based node lookup dd33b9e lib: utils: Make fdt_get_node_addr_size() public function 66185b3 lib: utils: Add fdt_parse_sifive_uart_node() function 19e966b lib: utils: Add fdt_parse_hart_id() function
44dd7be lib: utils: Add fdt_parse_max_hart_id() API
f0eb503 lib: utils: Add fdt_parse_plic_node() function
1ac794c include: Add array_size() macro
8ff2b94 lib: utils: Add simple FDT timer framework
76f0f81 lib: utils: Add simple FDT ipi framework
75322a6 lib: utils: Add simple FDT irqchip framework
76a8940 lib: utils: Add simple FDT serial framework
7cc6fa4 lib: utils: Add simple FDT reset framework
4d06353 firmware: fw_base: Introduce optional fw_platform_init() f1aa9e5 platform: Add generic FDT based platform support 1f21b99 lib: sbi: Print platform hart count at boot time 2ba7087 scripts: Add generic platform to create-binary-archive.sh 4f18c6e platform: generic: Add Sifive FU540 TLB flush range limit override
Update our Makefile to build the generic platform instead of building virt and sifive_u separately.
---
roms/Makefile | 30 ++++++++---------------------- roms/opensbi | 2 +- 2 files changed, 9 insertions(+), 23 deletions(-)
roms/Makefile +8 -22
@@ -64,10 +64,8 @@ default help: @echo " u-boot.e500 -- update u-boot.e500" @echo " u-boot.sam460 -- update u-boot.sam460" @echo " efi -- update UEFI (edk2) platform firmware" - @echo " opensbi32-virt -- update OpenSBI for 32-bit virt machine" - @echo " opensbi64-virt -- update OpenSBI for 64-bit virt machine" - @echo " opensbi32-sifive_u -- update OpenSBI for 32-bit sifive_u machine" - @echo " opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine" + @echo " opensbi32-generic -- update OpenSBI for 32-bit generic machine" + @echo " opensbi64-generic -- update OpenSBI for 64-bit generic machine" @echo " bios-microvm -- update bios-microvm.bin (qboot)" @echo " clean -- delete the files generated by the previous" \ "build targets"
@@ -170,29 +168,17 @@ skiboot: efi: edk2-basetools $(MAKE) -f Makefile.edk2 -opensbi32-virt: +opensbi32-generic: $(MAKE) -C opensbi \ CROSS_COMPILE=$(riscv32_cross_prefix) \ - PLATFORM="qemu/virt" - cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin + PLATFORM="generic" + cp opensbi/build/platform/generic/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-generic-fw_jump.bin -opensbi64-virt: +opensbi64-generic: $(MAKE) -C opensbi \ CROSS_COMPILE=$(riscv64_cross_prefix) \ - PLATFORM="qemu/virt" - cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin - -opensbi32-sifive_u: - $(MAKE) -C opensbi \ - CROSS_COMPILE=$(riscv32_cross_prefix) \ - PLATFORM="sifive/fu540" - cp opensbi/build/platform/sifive/fu540/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin - -opensbi64-sifive_u: - $(MAKE) -C opensbi \ - CROSS_COMPILE=$(riscv64_cross_prefix) \ - PLATFORM="sifive/fu540" - cp opensbi/build/platform/sifive/fu540/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin + PLATFORM="generic" + cp opensbi/build/platform/generic/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-generic-fw_jump.bin bios-microvm: $(MAKE) -C qboot
roms/opensbi +1 -1
@@ -1 +1 @@ -Subproject commit 9f1b72ce66d659e91013b358939e832fb27223f5 +Subproject commit 4f18c6e55049d858c62e87d2605dd41c06956e4e
Signature · 1 line
2.7.4
Re: [PATCH 1/5] roms/opensbi: Update to support building bios images for generic platform
Quoted 70 lines · Bin Meng
From: Bin Meng <[email protected]>
The RISC-V generic platform is a flattened device tree (FDT) based platform where all platform specific functionality is provided based on FDT passed by previous booting stage. The support was added in upstream opensbi recently.
Bring the QEMU roms/opensbi submodule to the upstream opensbi commit:
commit4f18c6e55049("platform: generic: Add Sifive FU540 TLB flush range limit override") with the following changes since v0.7 release:1bb00ab lib: No need to provide default PMP region using platform callbacks a9eac67 include:
sbi_platform: Combine reboot and shutdown into one callback 6585fab lib: utils: Add SiFive test device
4781545 platform: Add Nuclei UX600 platform
3a326af scripts: adapt binary archive script for Nuclei UX600 5bdf022 firmware:fw_base: RemoveCSR_MTVECupdate check e6c1345 lib: utils/serial: Skip baudrate config if input frequency is zero 01a8c8e lib: utils: Improvefdt_parse_uart8250()API
0a0093b lib: utils: Addfdt_parse_uart8250_node()function 243b0d0 lib: utils: Remove redundantclint_ipi_sync()declaration e3ad7c1 lib: utils: Renamefdt_parse_clint()tofdt_parse_compat_addr()a39cd6f lib: utils: Add FDT match table based node lookup dd33b9e lib: utils: Makefdt_get_node_addr_size()public function 66185b3 lib: utils: Addfdt_parse_sifive_uart_node()function 19e966b lib: utils: Addfdt_parse_hart_id()function
44dd7be lib: utils: Addfdt_parse_max_hart_id()API
f0eb503 lib: utils: Addfdt_parse_plic_node()function
1ac794c include: Addarray_size()macro
8ff2b94 lib: utils: Add simple FDT timer framework
76f0f81 lib: utils: Add simple FDT ipi framework
75322a6 lib: utils: Add simple FDT irqchip framework
76a8940 lib: utils: Add simple FDT serial framework
7cc6fa4 lib: utils: Add simple FDT reset framework
4d06353 firmware:fw_base: Introduce optionalfw_platform_init()f1aa9e5 platform: Add generic FDT based platform support 1f21b99 lib: sbi: Print platform hart count at boot time 2ba7087 scripts: Add generic platform tocreate-binary-archive.sh4f18c6e platform: generic: Add Sifive FU540 TLB flush range limit overrideUpdate our
Makefileto build the generic platform instead of building virt andsifive_useparately.Signed-off-by Bin Meng <[email protected]>---
roms/Makefile | 30 ++++++++---------------------- roms/opensbi | 2 +- 2 files changed, 9 insertions(+), 23 deletions(-)roms/Makefile +2
-4@@ -64,10 +64,8 @@ default help: @echo " u-boot.e500 -- update u-boot.e500" @echo " u-boot.sam460 -- update u-boot.sam460" @echo " efi -- update UEFI (edk2) platform firmware" - @echo " opensbi32-virt -- update OpenSBI for 32-bit virt machine" - @echo " opensbi64-virt -- update OpenSBI for 64-bit virt machine" - @echo " opensbi32-sifive_u -- update OpenSBI for 32-bit sifive_u machine" - @echo " opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine" + @echo " opensbi32-generic -- update OpenSBI for 32-bit generic machine" + @echo " opensbi64-generic -- update OpenSBI for 64-bit generic machine" @echo " bios-microvm -- update bios-microvm.bin (qboot)" @echo " clean -- delete the files generated by the previous" \ "build targets"@@ -170,29 +168,17 @@ skiboot: efi: edk2-basetools
roms/Makefile skiboot: · line 175
Quoted 10 lines
roms/Makefile +3
-3$(MAKE) -f Makefile.edk2 -opensbi32-virt: +opensbi32-generic: $(MAKE) -C opensbi \ CROSS_COMPILE=$(riscv32_cross_prefix) \ - PLATFORM="qemu/virt" - cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin + PLATFORM="generic" + cp opensbi/build/platform/generic/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-generic-fw_jump.bin
I think you should copy fw_jump.elf as well because QEMU Spike platform needs it.
Quoted 11 lines
roms/Makefile +1
-7-opensbi64-virt: +opensbi64-generic: $(MAKE) -C opensbi \ CROSS_COMPILE=$(riscv64_cross_prefix) \ - PLATFORM="qemu/virt" - cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin - -opensbi32-sifive_u: - $(MAKE) -C opensbi \ - CROSS_COMPILE=$(riscv32_cross_prefix) \
roms/Makefile skiboot: · line 181
Quoted 10 lines
roms/Makefile +2
-8- PLATFORM="sifive/fu540" - cp opensbi/build/platform/sifive/fu540/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin - -opensbi64-sifive_u: - $(MAKE) -C opensbi \ - CROSS_COMPILE=$(riscv64_cross_prefix) \ - PLATFORM="sifive/fu540" - cp opensbi/build/platform/sifive/fu540/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin + PLATFORM="generic" + cp opensbi/build/platform/generic/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-generic-fw_jump.bin
Same as above.
Quoted 11 lines
roms/Makefile +0
-0bios-microvm: $(MAKE) -C qbootroms/opensbi +1
-2@@ -1 +1 @@ -Subproject commit 9f1b72ce66d659e91013b358939e832fb27223f5 +Subproject commit 4f18c6e55049d858c62e87d2605dd41c06956e4e --
Quoted 3 lines
2.7.4
Otherwise looks good to me.
Regards,
Anup
Re: [PATCH 1/5] roms/opensbi: Update to support building bios images for generic platform
Hi Anup,
Quoted 74 lines · Anup Patel
Quoted 72 lines · Bin Meng
From: Bin Meng <[email protected]>
The RISC-V generic platform is a flattened device tree (FDT) based platform where all platform specific functionality is provided based on FDT passed by previous booting stage. The support was added in upstream opensbi recently.
Bring the QEMU roms/opensbi submodule to the upstream opensbi commit:
commit4f18c6e55049("platform: generic: Add Sifive FU540 TLB flush range limit override") with the following changes since v0.7 release:1bb00ab lib: No need to provide default PMP region using platform callbacks a9eac67 include:
sbi_platform: Combine reboot and shutdown into one callback 6585fab lib: utils: Add SiFive test device
4781545 platform: Add Nuclei UX600 platform
3a326af scripts: adapt binary archive script for Nuclei UX600 5bdf022 firmware:fw_base: RemoveCSR_MTVECupdate check e6c1345 lib: utils/serial: Skip baudrate config if input frequency is zero 01a8c8e lib: utils: Improvefdt_parse_uart8250()API
0a0093b lib: utils: Addfdt_parse_uart8250_node()function 243b0d0 lib: utils: Remove redundantclint_ipi_sync()declaration e3ad7c1 lib: utils: Renamefdt_parse_clint()tofdt_parse_compat_addr()a39cd6f lib: utils: Add FDT match table based node lookup dd33b9e lib: utils: Makefdt_get_node_addr_size()public function 66185b3 lib: utils: Addfdt_parse_sifive_uart_node()function 19e966b lib: utils: Addfdt_parse_hart_id()function
44dd7be lib: utils: Addfdt_parse_max_hart_id()API
f0eb503 lib: utils: Addfdt_parse_plic_node()function
1ac794c include: Addarray_size()macro
8ff2b94 lib: utils: Add simple FDT timer framework
76f0f81 lib: utils: Add simple FDT ipi framework
75322a6 lib: utils: Add simple FDT irqchip framework
76a8940 lib: utils: Add simple FDT serial framework
7cc6fa4 lib: utils: Add simple FDT reset framework
4d06353 firmware:fw_base: Introduce optionalfw_platform_init()f1aa9e5 platform: Add generic FDT based platform support 1f21b99 lib: sbi: Print platform hart count at boot time 2ba7087 scripts: Add generic platform tocreate-binary-archive.sh4f18c6e platform: generic: Add Sifive FU540 TLB flush range limit overrideUpdate our
Makefileto build the generic platform instead of building virt andsifive_useparately.Signed-off-by Bin Meng <[email protected]>---
roms/Makefile | 30 ++++++++---------------------- roms/opensbi | 2 +- 2 files changed, 9 insertions(+), 23 deletions(-)roms/Makefile +2
-4@@ -64,10 +64,8 @@ default help: @echo " u-boot.e500 -- update u-boot.e500" @echo " u-boot.sam460 -- update u-boot.sam460" @echo " efi -- update UEFI (edk2) platform firmware" - @echo " opensbi32-virt -- update OpenSBI for 32-bit virt machine" - @echo " opensbi64-virt -- update OpenSBI for 64-bit virt machine" - @echo " opensbi32-sifive_u -- update OpenSBI for 32-bit sifive_u machine" - @echo " opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine" + @echo " opensbi32-generic -- update OpenSBI for 32-bit generic machine" + @echo " opensbi64-generic -- update OpenSBI for 64-bit generic machine" @echo " bios-microvm -- update bios-microvm.bin (qboot)" @echo " clean -- delete the files generated by the previous" \ "build targets"@@ -170,29 +168,17 @@ skiboot: efi: edk2-basetools $(MAKE) -f Makefile.edk2
Quoted 12 lines
roms/Makefile skiboot: · line 175
Quoted 8 lines
roms/Makefile +3
-3-opensbi32-virt: +opensbi32-generic: $(MAKE) -C opensbi \ CROSS_COMPILE=$(riscv32_cross_prefix) \ - PLATFORM="qemu/virt" - cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin + PLATFORM="generic" + cp opensbi/build/platform/generic/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-generic-fw_jump.binI think you should copy fw_jump.elf as well because QEMU Spike platform needs it.
I believe we intended only to ship default bios images for virt and sifive_u. Spike bios image was not shipped in previous QEMU version too.
Quoted 41 lines
Quoted 11 lines
roms/Makefile +1
-7-opensbi64-virt: +opensbi64-generic: $(MAKE) -C opensbi \ CROSS_COMPILE=$(riscv64_cross_prefix) \ - PLATFORM="qemu/virt" - cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin - -opensbi32-sifive_u: - $(MAKE) -C opensbi \ - CROSS_COMPILE=$(riscv32_cross_prefix) \roms/Makefile skiboot: · line 181
Quoted 10 lines
roms/Makefile +2
-8- PLATFORM="sifive/fu540" - cp opensbi/build/platform/sifive/fu540/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin - -opensbi64-sifive_u: - $(MAKE) -C opensbi \ - CROSS_COMPILE=$(riscv64_cross_prefix) \ - PLATFORM="sifive/fu540" - cp opensbi/build/platform/sifive/fu540/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin + PLATFORM="generic" + cp opensbi/build/platform/generic/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-generic-fw_jump.binSame as above.
Quoted 11 lines
roms/Makefile +0
-0bios-microvm: $(MAKE) -C qbootroms/opensbi +1
-2@@ -1 +1 @@ -Subproject commit 9f1b72ce66d659e91013b358939e832fb27223f5 +Subproject commit 4f18c6e55049d858c62e87d2605dd41c06956e4e --Quoted 3 lines
2.7.4
Otherwise looks good to me.
Quoted 1 line
Reviewed-by Anup Patel <[email protected]>
Regards,
Bin
Re: [PATCH 1/5] roms/opensbi: Update to support building bios images for generic platform
Quoted 91 lines · Bin Meng
Hi Anup,
Quoted 74 lines · Anup Patel
Quoted 72 lines · Bin Meng
From: Bin Meng <[email protected]>
The RISC-V generic platform is a flattened device tree (FDT) based platform where all platform specific functionality is provided based on FDT passed by previous booting stage. The support was added in upstream opensbi recently.
Bring the QEMU roms/opensbi submodule to the upstream opensbi commit:
commit4f18c6e55049("platform: generic: Add Sifive FU540 TLB flush range limit override") with the following changes since v0.7 release:1bb00ab lib: No need to provide default PMP region using platform callbacks a9eac67 include:
sbi_platform: Combine reboot and shutdown into one callback 6585fab lib: utils: Add SiFive test device
4781545 platform: Add Nuclei UX600 platform
3a326af scripts: adapt binary archive script for Nuclei UX600 5bdf022 firmware:fw_base: RemoveCSR_MTVECupdate check e6c1345 lib: utils/serial: Skip baudrate config if input frequency is zero 01a8c8e lib: utils: Improvefdt_parse_uart8250()API
0a0093b lib: utils: Addfdt_parse_uart8250_node()function 243b0d0 lib: utils: Remove redundantclint_ipi_sync()declaration e3ad7c1 lib: utils: Renamefdt_parse_clint()tofdt_parse_compat_addr()a39cd6f lib: utils: Add FDT match table based node lookup dd33b9e lib: utils: Makefdt_get_node_addr_size()public function 66185b3 lib: utils: Addfdt_parse_sifive_uart_node()function 19e966b lib: utils: Addfdt_parse_hart_id()function
44dd7be lib: utils: Addfdt_parse_max_hart_id()API
f0eb503 lib: utils: Addfdt_parse_plic_node()function
1ac794c include: Addarray_size()macro
8ff2b94 lib: utils: Add simple FDT timer framework
76f0f81 lib: utils: Add simple FDT ipi framework
75322a6 lib: utils: Add simple FDT irqchip framework
76a8940 lib: utils: Add simple FDT serial framework
7cc6fa4 lib: utils: Add simple FDT reset framework
4d06353 firmware:fw_base: Introduce optionalfw_platform_init()f1aa9e5 platform: Add generic FDT based platform support 1f21b99 lib: sbi: Print platform hart count at boot time 2ba7087 scripts: Add generic platform tocreate-binary-archive.sh4f18c6e platform: generic: Add Sifive FU540 TLB flush range limit overrideUpdate our
Makefileto build the generic platform instead of building virt andsifive_useparately.Signed-off-by Bin Meng <[email protected]>---
roms/Makefile | 30 ++++++++---------------------- roms/opensbi | 2 +- 2 files changed, 9 insertions(+), 23 deletions(-)roms/Makefile +2
-4@@ -64,10 +64,8 @@ default help: @echo " u-boot.e500 -- update u-boot.e500" @echo " u-boot.sam460 -- update u-boot.sam460" @echo " efi -- update UEFI (edk2) platform firmware" - @echo " opensbi32-virt -- update OpenSBI for 32-bit virt machine" - @echo " opensbi64-virt -- update OpenSBI for 64-bit virt machine" - @echo " opensbi32-sifive_u -- update OpenSBI for 32-bit sifive_u machine" - @echo " opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine" + @echo " opensbi32-generic -- update OpenSBI for 32-bit generic machine" + @echo " opensbi64-generic -- update OpenSBI for 64-bit generic machine" @echo " bios-microvm -- update bios-microvm.bin (qboot)" @echo " clean -- delete the files generated by the previous" \ "build targets"@@ -170,29 +168,17 @@ skiboot: efi: edk2-basetools $(MAKE) -f Makefile.edk2Quoted 12 lines
roms/Makefile skiboot: · line 175
Quoted 8 lines
roms/Makefile +3
-3-opensbi32-virt: +opensbi32-generic: $(MAKE) -C opensbi \ CROSS_COMPILE=$(riscv32_cross_prefix) \ - PLATFORM="qemu/virt" - cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin + PLATFORM="generic" + cp opensbi/build/platform/generic/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-generic-fw_jump.binI think you should copy fw_jump.elf as well because QEMU Spike platform needs it.
Quoted 3 lines
I believe we intended only to ship default bios images for virt and
sifive_u. Spike bios image was not shipped in previous QEMU version too.
Is there a specific reason for not shipping bios image for Spike machine ?
There were issues booting Linux on QEMU spike machine which are now fixed and available in QEMU master. I think we should certainly ship fw_jump.elf for Spike machine. This way we have OpenSBI generic firmware available as a bios image for three QEMU machines(virt, sifive_u, and spike).
Regards,
Anup
Quoted 46 lines
Quoted 42 lines
Quoted 12 lines
roms/Makefile +1
-7-opensbi64-virt: +opensbi64-generic: $(MAKE) -C opensbi \ CROSS_COMPILE=$(riscv64_cross_prefix) \ - PLATFORM="qemu/virt" - cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin - -opensbi32-sifive_u: - $(MAKE) -C opensbi \ - CROSS_COMPILE=$(riscv32_cross_prefix) \roms/Makefile skiboot: · line 181
Quoted 10 lines
roms/Makefile +2
-8- PLATFORM="sifive/fu540" - cp opensbi/build/platform/sifive/fu540/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin - -opensbi64-sifive_u: - $(MAKE) -C opensbi \ - CROSS_COMPILE=$(riscv64_cross_prefix) \ - PLATFORM="sifive/fu540" - cp opensbi/build/platform/sifive/fu540/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin + PLATFORM="generic" + cp opensbi/build/platform/generic/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-generic-fw_jump.binSame as above.
Quoted 11 lines
roms/Makefile +0
-0bios-microvm: $(MAKE) -C qbootroms/opensbi +1
-2@@ -1 +1 @@ -Subproject commit 9f1b72ce66d659e91013b358939e832fb27223f5 +Subproject commit 4f18c6e55049d858c62e87d2605dd41c06956e4e --Quoted 3 lines
2.7.4
Otherwise looks good to me.
Quoted 1 line
Reviewed-by Anup Patel <[email protected]>Regards,
Bin
Re: [PATCH 1/5] roms/opensbi: Update to support building bios images for generic platform
Hi Anup,
Quoted 93 lines · Anup Patel
Quoted 91 lines · Bin Meng
Hi Anup,
Quoted 86 lines · Anup Patel
Quoted 70 lines · Bin Meng
From: Bin Meng <[email protected]>
The RISC-V generic platform is a flattened device tree (FDT) based platform where all platform specific functionality is provided based on FDT passed by previous booting stage. The support was added in upstream opensbi recently.
Bring the QEMU roms/opensbi submodule to the upstream opensbi commit:
commit4f18c6e55049("platform: generic: Add Sifive FU540 TLB flush range limit override") with the following changes since v0.7 release:1bb00ab lib: No need to provide default PMP region using platform callbacks a9eac67 include:
sbi_platform: Combine reboot and shutdown into one callback 6585fab lib: utils: Add SiFive test device
4781545 platform: Add Nuclei UX600 platform
3a326af scripts: adapt binary archive script for Nuclei UX600 5bdf022 firmware:fw_base: RemoveCSR_MTVECupdate check e6c1345 lib: utils/serial: Skip baudrate config if input frequency is zero 01a8c8e lib: utils: Improvefdt_parse_uart8250()API
0a0093b lib: utils: Addfdt_parse_uart8250_node()function 243b0d0 lib: utils: Remove redundantclint_ipi_sync()declaration e3ad7c1 lib: utils: Renamefdt_parse_clint()tofdt_parse_compat_addr()a39cd6f lib: utils: Add FDT match table based node lookup dd33b9e lib: utils: Makefdt_get_node_addr_size()public function 66185b3 lib: utils: Addfdt_parse_sifive_uart_node()function 19e966b lib: utils: Addfdt_parse_hart_id()function
44dd7be lib: utils: Addfdt_parse_max_hart_id()API
f0eb503 lib: utils: Addfdt_parse_plic_node()function
1ac794c include: Addarray_size()macro
8ff2b94 lib: utils: Add simple FDT timer framework
76f0f81 lib: utils: Add simple FDT ipi framework
75322a6 lib: utils: Add simple FDT irqchip framework
76a8940 lib: utils: Add simple FDT serial framework
7cc6fa4 lib: utils: Add simple FDT reset framework
4d06353 firmware:fw_base: Introduce optionalfw_platform_init()f1aa9e5 platform: Add generic FDT based platform support 1f21b99 lib: sbi: Print platform hart count at boot time 2ba7087 scripts: Add generic platform tocreate-binary-archive.sh4f18c6e platform: generic: Add Sifive FU540 TLB flush range limit overrideUpdate our
Makefileto build the generic platform instead of building virt andsifive_useparately.Signed-off-by Bin Meng <[email protected]>---
roms/Makefile | 30 ++++++++---------------------- roms/opensbi | 2 +- 2 files changed, 9 insertions(+), 23 deletions(-)roms/Makefile +2
-4@@ -64,10 +64,8 @@ default help: @echo " u-boot.e500 -- update u-boot.e500" @echo " u-boot.sam460 -- update u-boot.sam460" @echo " efi -- update UEFI (edk2) platform firmware" - @echo " opensbi32-virt -- update OpenSBI for 32-bit virt machine" - @echo " opensbi64-virt -- update OpenSBI for 64-bit virt machine" - @echo " opensbi32-sifive_u -- update OpenSBI for 32-bit sifive_u machine" - @echo " opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine" + @echo " opensbi32-generic -- update OpenSBI for 32-bit generic machine" + @echo " opensbi64-generic -- update OpenSBI for 64-bit generic machine" @echo " bios-microvm -- update bios-microvm.bin (qboot)" @echo " clean -- delete the files generated by the previous" \ "build targets"@@ -170,29 +168,17 @@ skiboot: efi: edk2-basetoolsroms/Makefile skiboot: · line 175
Quoted 10 lines
roms/Makefile +3
-3$(MAKE) -f Makefile.edk2 -opensbi32-virt: +opensbi32-generic: $(MAKE) -C opensbi \ CROSS_COMPILE=$(riscv32_cross_prefix) \ - PLATFORM="qemu/virt" - cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin + PLATFORM="generic" + cp opensbi/build/platform/generic/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-generic-fw_jump.binI think you should copy fw_jump.elf as well because QEMU Spike platform needs it.
Quoted 6 lines
Quoted 3 lines
I believe we intended only to ship default bios images for virt and
sifive_u. Spike bios image was not shipped in previous QEMU version too.Is there a specific reason for not shipping bios image for Spike machine ?
That's only my guess. Based on what I see from git history, adding "-bios" support was added via:
commit 5b8a986350a9 ("hw/riscv/spike: Allow loading firmware separately using -bios option")
with bios image as opensbi-riscv{32,64}-spike-fw_jump.elf, but the images were not added to QEMU repo.
Quoted 6 lines
There were issues booting Linux on QEMU spike machine which are now fixed and available in QEMU master. I think we should certainly ship fw_jump.elf for Spike machine. This way we have OpenSBI generic firmware available as a bios image for three QEMU
machines(virt, sifive_u, and spike).
If everyone thinks shipping the ELF image is OK, I can do that in v2.
Regards,
Bin
Re: [PATCH 1/5] roms/opensbi: Update to support building bios images for generic platform
Quoted 113 lines · Bin Meng
Hi Anup,
Quoted 93 lines · Anup Patel
Quoted 91 lines · Bin Meng
Hi Anup,
Quoted 86 lines · Anup Patel
Quoted 70 lines · Bin Meng
From: Bin Meng <[email protected]>
The RISC-V generic platform is a flattened device tree (FDT) based platform where all platform specific functionality is provided based on FDT passed by previous booting stage. The support was added in upstream opensbi recently.
Bring the QEMU roms/opensbi submodule to the upstream opensbi commit:
commit4f18c6e55049("platform: generic: Add Sifive FU540 TLB flush range limit override") with the following changes since v0.7 release:1bb00ab lib: No need to provide default PMP region using platform callbacks a9eac67 include:
sbi_platform: Combine reboot and shutdown into one callback 6585fab lib: utils: Add SiFive test device
4781545 platform: Add Nuclei UX600 platform
3a326af scripts: adapt binary archive script for Nuclei UX600 5bdf022 firmware:fw_base: RemoveCSR_MTVECupdate check e6c1345 lib: utils/serial: Skip baudrate config if input frequency is zero 01a8c8e lib: utils: Improvefdt_parse_uart8250()API
0a0093b lib: utils: Addfdt_parse_uart8250_node()function 243b0d0 lib: utils: Remove redundantclint_ipi_sync()declaration e3ad7c1 lib: utils: Renamefdt_parse_clint()tofdt_parse_compat_addr()a39cd6f lib: utils: Add FDT match table based node lookup dd33b9e lib: utils: Makefdt_get_node_addr_size()public function 66185b3 lib: utils: Addfdt_parse_sifive_uart_node()function 19e966b lib: utils: Addfdt_parse_hart_id()function
44dd7be lib: utils: Addfdt_parse_max_hart_id()API
f0eb503 lib: utils: Addfdt_parse_plic_node()function
1ac794c include: Addarray_size()macro
8ff2b94 lib: utils: Add simple FDT timer framework
76f0f81 lib: utils: Add simple FDT ipi framework
75322a6 lib: utils: Add simple FDT irqchip framework
76a8940 lib: utils: Add simple FDT serial framework
7cc6fa4 lib: utils: Add simple FDT reset framework
4d06353 firmware:fw_base: Introduce optionalfw_platform_init()f1aa9e5 platform: Add generic FDT based platform support 1f21b99 lib: sbi: Print platform hart count at boot time 2ba7087 scripts: Add generic platform tocreate-binary-archive.sh4f18c6e platform: generic: Add Sifive FU540 TLB flush range limit overrideUpdate our
Makefileto build the generic platform instead of building virt andsifive_useparately.Signed-off-by Bin Meng <[email protected]>---
roms/Makefile | 30 ++++++++---------------------- roms/opensbi | 2 +- 2 files changed, 9 insertions(+), 23 deletions(-)roms/Makefile +2
-4@@ -64,10 +64,8 @@ default help: @echo " u-boot.e500 -- update u-boot.e500" @echo " u-boot.sam460 -- update u-boot.sam460" @echo " efi -- update UEFI (edk2) platform firmware" - @echo " opensbi32-virt -- update OpenSBI for 32-bit virt machine" - @echo " opensbi64-virt -- update OpenSBI for 64-bit virt machine" - @echo " opensbi32-sifive_u -- update OpenSBI for 32-bit sifive_u machine" - @echo " opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine" + @echo " opensbi32-generic -- update OpenSBI for 32-bit generic machine" + @echo " opensbi64-generic -- update OpenSBI for 64-bit generic machine" @echo " bios-microvm -- update bios-microvm.bin (qboot)" @echo " clean -- delete the files generated by the previous" \ "build targets"@@ -170,29 +168,17 @@ skiboot: efi: edk2-basetoolsroms/Makefile skiboot: · line 175
Quoted 10 lines
roms/Makefile +3
-3$(MAKE) -f Makefile.edk2 -opensbi32-virt: +opensbi32-generic: $(MAKE) -C opensbi \ CROSS_COMPILE=$(riscv32_cross_prefix) \ - PLATFORM="qemu/virt" - cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin + PLATFORM="generic" + cp opensbi/build/platform/generic/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-generic-fw_jump.binI think you should copy fw_jump.elf as well because QEMU Spike platform needs it.
Quoted 6 lines
Quoted 3 lines
I believe we intended only to ship default bios images for virt and
sifive_u. Spike bios image was not shipped in previous QEMU version too.Is there a specific reason for not shipping bios image for Spike machine ?
That's only my guess. Based on what I see from git history, adding "-bios" support was added via:
commit
5b8a986350a9("hw/riscv/spike: Allow loading firmware separately using -bios option")with bios image as opensbi-riscv{32,64}-spike-fw_jump.elf, but the images were not added to QEMU repo.
Quoted 8 lines
Quoted 6 lines
There were issues booting Linux on QEMU spike machine which are now fixed and available in QEMU master. I think we should certainly ship fw_jump.elf for Spike machine. This way we have OpenSBI generic firmware available as a bios image for three QEMU
machines(virt, sifive_u, and spike).If everyone thinks shipping the ELF image is OK, I can do that in v2.
One additional note, that's why patch 5 in this series for. Without the default bios image being shipped in QEMU, QEMU testing will complain.
So in the future, when we have more QEMU RISC-V machines added, if they are not using the generic firmware, do we want to ship all of these different firmware images in QEMU?
Regards,
Bin
Re: [PATCH 1/5] roms/opensbi: Update to support building bios images for generic platform
Quoted 124 lines · Bin Meng
Quoted 113 lines · Bin Meng
Hi Anup,
Quoted 93 lines · Anup Patel
Quoted 91 lines · Bin Meng
Hi Anup,
Quoted 86 lines · Anup Patel
Quoted 70 lines · Bin Meng
From: Bin Meng <[email protected]>
The RISC-V generic platform is a flattened device tree (FDT) based platform where all platform specific functionality is provided based on FDT passed by previous booting stage. The support was added in upstream opensbi recently.
Bring the QEMU roms/opensbi submodule to the upstream opensbi commit:
commit4f18c6e55049("platform: generic: Add Sifive FU540 TLB flush range limit override") with the following changes since v0.7 release:1bb00ab lib: No need to provide default PMP region using platform callbacks a9eac67 include:
sbi_platform: Combine reboot and shutdown into one callback 6585fab lib: utils: Add SiFive test device
4781545 platform: Add Nuclei UX600 platform
3a326af scripts: adapt binary archive script for Nuclei UX600 5bdf022 firmware:fw_base: RemoveCSR_MTVECupdate check e6c1345 lib: utils/serial: Skip baudrate config if input frequency is zero 01a8c8e lib: utils: Improvefdt_parse_uart8250()API
0a0093b lib: utils: Addfdt_parse_uart8250_node()function 243b0d0 lib: utils: Remove redundantclint_ipi_sync()declaration e3ad7c1 lib: utils: Renamefdt_parse_clint()tofdt_parse_compat_addr()a39cd6f lib: utils: Add FDT match table based node lookup dd33b9e lib: utils: Makefdt_get_node_addr_size()public function 66185b3 lib: utils: Addfdt_parse_sifive_uart_node()function 19e966b lib: utils: Addfdt_parse_hart_id()function
44dd7be lib: utils: Addfdt_parse_max_hart_id()API
f0eb503 lib: utils: Addfdt_parse_plic_node()function
1ac794c include: Addarray_size()macro
8ff2b94 lib: utils: Add simple FDT timer framework
76f0f81 lib: utils: Add simple FDT ipi framework
75322a6 lib: utils: Add simple FDT irqchip framework
76a8940 lib: utils: Add simple FDT serial framework
7cc6fa4 lib: utils: Add simple FDT reset framework
4d06353 firmware:fw_base: Introduce optionalfw_platform_init()f1aa9e5 platform: Add generic FDT based platform support 1f21b99 lib: sbi: Print platform hart count at boot time 2ba7087 scripts: Add generic platform tocreate-binary-archive.sh4f18c6e platform: generic: Add Sifive FU540 TLB flush range limit overrideUpdate our
Makefileto build the generic platform instead of building virt andsifive_useparately.Signed-off-by Bin Meng <[email protected]>---
roms/Makefile | 30 ++++++++---------------------- roms/opensbi | 2 +- 2 files changed, 9 insertions(+), 23 deletions(-)roms/Makefile +2
-4@@ -64,10 +64,8 @@ default help: @echo " u-boot.e500 -- update u-boot.e500" @echo " u-boot.sam460 -- update u-boot.sam460" @echo " efi -- update UEFI (edk2) platform firmware" - @echo " opensbi32-virt -- update OpenSBI for 32-bit virt machine" - @echo " opensbi64-virt -- update OpenSBI for 64-bit virt machine" - @echo " opensbi32-sifive_u -- update OpenSBI for 32-bit sifive_u machine" - @echo " opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine" + @echo " opensbi32-generic -- update OpenSBI for 32-bit generic machine" + @echo " opensbi64-generic -- update OpenSBI for 64-bit generic machine" @echo " bios-microvm -- update bios-microvm.bin (qboot)" @echo " clean -- delete the files generated by the previous" \ "build targets"@@ -170,29 +168,17 @@ skiboot: efi: edk2-basetoolsroms/Makefile skiboot: · line 175
Quoted 10 lines
roms/Makefile +3
-3$(MAKE) -f Makefile.edk2 -opensbi32-virt: +opensbi32-generic: $(MAKE) -C opensbi \ CROSS_COMPILE=$(riscv32_cross_prefix) \ - PLATFORM="qemu/virt" - cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin + PLATFORM="generic" + cp opensbi/build/platform/generic/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-generic-fw_jump.binI think you should copy fw_jump.elf as well because QEMU Spike platform needs it.
Quoted 6 lines
Quoted 3 lines
I believe we intended only to ship default bios images for virt and
sifive_u. Spike bios image was not shipped in previous QEMU version too.Is there a specific reason for not shipping bios image for Spike machine ?
That's only my guess. Based on what I see from git history, adding "-bios" support was added via:
commit
5b8a986350a9("hw/riscv/spike: Allow loading firmware separately using -bios option")with bios image as opensbi-riscv{32,64}-spike-fw_jump.elf, but the images were not added to QEMU repo.
Quoted 8 lines
Quoted 6 lines
There were issues booting Linux on QEMU spike machine which are now fixed and available in QEMU master. I think we should certainly ship fw_jump.elf for Spike machine. This way we have OpenSBI generic firmware available as a bios image for three QEMU
machines(virt, sifive_u, and spike).If everyone thinks shipping the ELF image is OK, I can do that in v2.
Quoted 7 lines
One additional note, that's why patch 5 in this series for. Without the default bios image being shipped in QEMU, QEMU testing will complain.
So in the future, when we have more QEMU RISC-V machines added, if they are not using the generic firmware, do we want to ship all of these different firmware images in QEMU?
This would be a QEMU RISC-V policy decision which Palmer or Alistair can decide.
IMHO, we can insist that newer QEMU RISC-V machines work fine with OpenSBI generic firmwares so that we don't increase the number of bios images shipped for QEMU RISC-V.
Regards,
Anup
Re: [PATCH 1/5] roms/opensbi: Update to support building bios images for generic platform
In reply to Bin MengQuoted 55 lines · Bin Meng
Quoted 53 lines · Bin Meng
Hi Anup,
Quoted 49 lines · Anup Patel
Quoted 47 lines · Bin Meng
Hi Anup,
Quoted 43 lines · Anup Patel
Quoted 41 lines · Bin Meng
From: Bin Meng <[email protected]>
The RISC-V generic platform is a flattened device tree (FDT) based platform where all platform specific functionality is provided based on FDT passed by previous booting stage. The support was added in upstream opensbi recently.
Bring the QEMU roms/opensbi submodule to the upstream opensbi commit:
commit4f18c6e55049("platform: generic: Add Sifive FU540 TLB flush range limit override") with the following changes since v0.7 release:1bb00ab lib: No need to provide default PMP region using platform callbacks a9eac67 include:
sbi_platform: Combine reboot and shutdown into one callback 6585fab lib: utils: Add SiFive test device
4781545 platform: Add Nuclei UX600 platform
3a326af scripts: adapt binary archive script for Nuclei UX600 5bdf022 firmware:fw_base: RemoveCSR_MTVECupdate check e6c1345 lib: utils/serial: Skip baudrate config if input frequency is zero 01a8c8e lib: utils: Improvefdt_parse_uart8250()API
0a0093b lib: utils: Addfdt_parse_uart8250_node()function 243b0d0 lib: utils: Remove redundantclint_ipi_sync()declaration e3ad7c1 lib: utils: Renamefdt_parse_clint()tofdt_parse_compat_addr()a39cd6f lib: utils: Add FDT match table based node lookup dd33b9e lib: utils: Makefdt_get_node_addr_size()public function 66185b3 lib: utils: Addfdt_parse_sifive_uart_node()function 19e966b lib: utils: Addfdt_parse_hart_id()function
44dd7be lib: utils: Addfdt_parse_max_hart_id()API
f0eb503 lib: utils: Addfdt_parse_plic_node()function
1ac794c include: Addarray_size()macro
8ff2b94 lib: utils: Add simple FDT timer framework
76f0f81 lib: utils: Add simple FDT ipi framework
75322a6 lib: utils: Add simple FDT irqchip framework
76a8940 lib: utils: Add simple FDT serial framework
7cc6fa4 lib: utils: Add simple FDT reset framework
4d06353 firmware:fw_base: Introduce optionalfw_platform_init()f1aa9e5 platform: Add generic FDT based platform support 1f21b99 lib: sbi: Print platform hart count at boot time 2ba7087 scripts: Add generic platform tocreate-binary-archive.sh4f18c6e platform: generic: Add Sifive FU540 TLB flush range limit override
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Update our
Makefileto build the generic platform instead of building virt andsifive_useparately.
Hey Bin,
Thanks for the patch!
I don't think we can take this update though, as we should stick with OpenSBI releases.
Quoted 58 lines
Quoted 58 lines
Quoted 42 lines
Quoted 42 lines
Quoted 41 lines
Quoted 27 lines
Signed-off-by Bin Meng <[email protected]>---
roms/Makefile | 30 ++++++++---------------------- roms/opensbi | 2 +- 2 files changed, 9 insertions(+), 23 deletions(-)roms/Makefile +2
-4@@ -64,10 +64,8 @@ default help: @echo " u-boot.e500 -- update u-boot.e500" @echo " u-boot.sam460 -- update u-boot.sam460" @echo " efi -- update UEFI (edk2) platform firmware" - @echo " opensbi32-virt -- update OpenSBI for 32-bit virt machine" - @echo " opensbi64-virt -- update OpenSBI for 64-bit virt machine" - @echo " opensbi32-sifive_u -- update OpenSBI for 32-bit sifive_u machine" - @echo " opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine" + @echo " opensbi32-generic -- update OpenSBI for 32-bit generic machine" + @echo " opensbi64-generic -- update OpenSBI for 64-bit generic machine" @echo " bios-microvm -- update bios-microvm.bin (qboot)" @echo " clean -- delete the files generated by the previous" \ "build targets"@@ -170,29 +168,17 @@ skiboot: efi: edk2-basetoolsroms/Makefile skiboot: · line 175
Quoted 10 lines
roms/Makefile +3
-3$(MAKE) -f Makefile.edk2 -opensbi32-virt: +opensbi32-generic: $(MAKE) -C opensbi \ CROSS_COMPILE=$(riscv32_cross_prefix) \ - PLATFORM="qemu/virt" - cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin + PLATFORM="generic" + cp opensbi/build/platform/generic/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-generic-fw_jump.binI think you should copy fw_jump.elf as well because QEMU Spike platform needs it.
Quoted 6 lines
Quoted 3 lines
I believe we intended only to ship default bios images for virt and
sifive_u. Spike bios image was not shipped in previous QEMU version too.Is there a specific reason for not shipping bios image for Spike machine ?
That's only my guess. Based on what I see from git history, adding "-bios" support was added via:
commit
5b8a986350a9("hw/riscv/spike: Allow loading firmware separately using -bios option")with bios image as opensbi-riscv{32,64}-spike-fw_jump.elf, but the images were not added to QEMU repo.
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
There were issues booting Linux on QEMU spike machine which are now fixed and available in QEMU master. I think we should certainly ship fw_jump.elf for Spike machine. This way we have OpenSBI generic firmware available as a bios image for three QEMU
machines(virt, sifive_u, and spike).If everyone thinks shipping the ELF image is OK, I can do that in v2.
I don't really mind either way.
On one hand it is nice to have all the boards "just work" with OpenSBI. On the other hand Spike isn't used very often from what I can tell and it's a larger maintenance burden to update another image.
Quoted 8 lines
One additional note, that's why patch 5 in this series for. Without the default bios image being shipped in QEMU, QEMU testing will complain.
So in the future, when we have more QEMU RISC-V machines added, if they are not using the generic firmware, do we want to ship all of these different firmware images in QEMU?
That's a good point.
I don't really want to be maintaining 20 different OpenSBI binaries.
I suspect the plan will be that we supply OpenSBI binaries for the "key" boards. Which is the Virt board and sifive_u. If other boards can use the same OpenSBI binary then that's great. If not we won't ship a binary. The main reason to ship the binary is to allow people to try RISC-V easily. The virt and sifive_u machines do that, we don't need them all to do that.
So on that note, I think we should include the generic elf which will support Spike and any future boards that need the elf as well.
So to summarise my ramblings:
- We will swap to shipping generic ELF and BIN OpenSBI files
- All boards that can use those should
- Other boards won't have pre-built OpenSBI support
- For future updates we just update the 4 files (32-bit and 64-bit)
on each release.
Alistair
Quoted 4 lines
Regards,
Bin
Re: [PATCH 1/5] roms/opensbi: Update to support building bios images for generic platform
Hi Alistair,
Quoted 60 lines · Alistair Francis
Quoted 55 lines · Bin Meng
Quoted 53 lines · Bin Meng
Hi Anup,
Quoted 49 lines · Anup Patel
Quoted 47 lines · Bin Meng
Hi Anup,
Quoted 43 lines · Anup Patel
Quoted 41 lines · Bin Meng
From: Bin Meng <[email protected]>
The RISC-V generic platform is a flattened device tree (FDT) based platform where all platform specific functionality is provided based on FDT passed by previous booting stage. The support was added in upstream opensbi recently.
Bring the QEMU roms/opensbi submodule to the upstream opensbi commit:
commit4f18c6e55049("platform: generic: Add Sifive FU540 TLB flush range limit override") with the following changes since v0.7 release:1bb00ab lib: No need to provide default PMP region using platform callbacks a9eac67 include:
sbi_platform: Combine reboot and shutdown into one callback 6585fab lib: utils: Add SiFive test device
4781545 platform: Add Nuclei UX600 platform
3a326af scripts: adapt binary archive script for Nuclei UX600 5bdf022 firmware:fw_base: RemoveCSR_MTVECupdate check e6c1345 lib: utils/serial: Skip baudrate config if input frequency is zero 01a8c8e lib: utils: Improvefdt_parse_uart8250()API
0a0093b lib: utils: Addfdt_parse_uart8250_node()function 243b0d0 lib: utils: Remove redundantclint_ipi_sync()declaration e3ad7c1 lib: utils: Renamefdt_parse_clint()tofdt_parse_compat_addr()a39cd6f lib: utils: Add FDT match table based node lookup dd33b9e lib: utils: Makefdt_get_node_addr_size()public function 66185b3 lib: utils: Addfdt_parse_sifive_uart_node()function 19e966b lib: utils: Addfdt_parse_hart_id()function
44dd7be lib: utils: Addfdt_parse_max_hart_id()API
f0eb503 lib: utils: Addfdt_parse_plic_node()function
1ac794c include: Addarray_size()macro
8ff2b94 lib: utils: Add simple FDT timer framework
76f0f81 lib: utils: Add simple FDT ipi framework
75322a6 lib: utils: Add simple FDT irqchip framework
76a8940 lib: utils: Add simple FDT serial framework
7cc6fa4 lib: utils: Add simple FDT reset framework
4d06353 firmware:fw_base: Introduce optionalfw_platform_init()f1aa9e5 platform: Add generic FDT based platform support 1f21b99 lib: sbi: Print platform hart count at boot time 2ba7087 scripts: Add generic platform tocreate-binary-archive.sh4f18c6e platform: generic: Add Sifive FU540 TLB flush range limit overrideQuoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Update our
Makefileto build the generic platform instead of building virt andsifive_useparately.
Quoted 6 lines
Hey Bin,
Thanks for the patch!
I don't think we can take this update though, as we should stick with OpenSBI releases.
Sure, will delay this series once OpenSBI v0.8 release is out.
Quoted 97 lines
Quoted 59 lines
Quoted 59 lines
Quoted 43 lines
Quoted 43 lines
Quoted 42 lines
Quoted 28 lines
Signed-off-by Bin Meng <[email protected]>---
roms/Makefile | 30 ++++++++---------------------- roms/opensbi | 2 +- 2 files changed, 9 insertions(+), 23 deletions(-)roms/Makefile +2
-4@@ -64,10 +64,8 @@ default help: @echo " u-boot.e500 -- update u-boot.e500" @echo " u-boot.sam460 -- update u-boot.sam460" @echo " efi -- update UEFI (edk2) platform firmware" - @echo " opensbi32-virt -- update OpenSBI for 32-bit virt machine" - @echo " opensbi64-virt -- update OpenSBI for 64-bit virt machine" - @echo " opensbi32-sifive_u -- update OpenSBI for 32-bit sifive_u machine" - @echo " opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine" + @echo " opensbi32-generic -- update OpenSBI for 32-bit generic machine" + @echo " opensbi64-generic -- update OpenSBI for 64-bit generic machine" @echo " bios-microvm -- update bios-microvm.bin (qboot)" @echo " clean -- delete the files generated by the previous" \ "build targets"@@ -170,29 +168,17 @@ skiboot: efi: edk2-basetoolsroms/Makefile skiboot: · line 175
Quoted 10 lines
roms/Makefile +3
-3$(MAKE) -f Makefile.edk2 -opensbi32-virt: +opensbi32-generic: $(MAKE) -C opensbi \ CROSS_COMPILE=$(riscv32_cross_prefix) \ - PLATFORM="qemu/virt" - cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin + PLATFORM="generic" + cp opensbi/build/platform/generic/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-generic-fw_jump.binI think you should copy fw_jump.elf as well because QEMU Spike platform needs it.
Quoted 6 lines
Quoted 3 lines
I believe we intended only to ship default bios images for virt and
sifive_u. Spike bios image was not shipped in previous QEMU version too.Is there a specific reason for not shipping bios image for Spike machine ?
That's only my guess. Based on what I see from git history, adding "-bios" support was added via:
commit
5b8a986350a9("hw/riscv/spike: Allow loading firmware separately using -bios option")with bios image as opensbi-riscv{32,64}-spike-fw_jump.elf, but the images were not added to QEMU repo.
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
There were issues booting Linux on QEMU spike machine which are now fixed and available in QEMU master. I think we should certainly ship fw_jump.elf for Spike machine. This way we have OpenSBI generic firmware available as a bios image for three QEMU
machines(virt, sifive_u, and spike).If everyone thinks shipping the ELF image is OK, I can do that in v2.
I don't really mind either way.
On one hand it is nice to have all the boards "just work" with OpenSBI. On the other hand Spike isn't used very often from what I can tell and it's a larger maintenance burden to update another image.
Quoted 8 lines
One additional note, that's why patch 5 in this series for. Without the default bios image being shipped in QEMU, QEMU testing will complain.
So in the future, when we have more QEMU RISC-V machines added, if they are not using the generic firmware, do we want to ship all of these different firmware images in QEMU?
That's a good point.
I don't really want to be maintaining 20 different OpenSBI binaries.
I suspect the plan will be that we supply OpenSBI binaries for the "key" boards. Which is the Virt board and
sifive_u. If other boards can use the same OpenSBI binary then that's great. If not we won't ship a binary. The main reason to ship the binary is to allow people to try RISC-V easily. The virt andsifive_umachines do that, we don't need them all to do that.So on that note, I think we should include the generic elf which will support Spike and any future boards that need the elf as well.
Quoted 6 lines
So to summarise my ramblings:
- We will swap to shipping generic ELF and BIN OpenSBI files
- All boards that can use those should
- Other boards won't have pre-built OpenSBI support
- For future updates we just update the 4 files (32-bit and 64-bit)
on each release.
Sounds good to me. Thanks for providing the guideline from the maintainer's view!
Regards,
Bin
PATCH 2/5 gitlab-ci/opensbi: Update GitLab CI to build generic platform
In reply to Bin MengFrom: Bin Meng <[email protected]>
This updates the GitLab CI opensbi job to build opensbi bios images for the generic platform.
---
.gitlab-ci-opensbi.yml | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-)
.gitlab-ci-opensbi.yml +8 -18
@@ -34,18 +34,12 @@ build-opensbi: when: always artifacts: paths: # 'artifacts.zip' will contains the following files: - - pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin - - pc-bios/opensbi-riscv32-virt-fw_jump.bin - - pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin - - pc-bios/opensbi-riscv64-virt-fw_jump.bin - - opensbi32-virt-stdout.log - - opensbi32-virt-stderr.log - - opensbi64-virt-stdout.log - - opensbi64-virt-stderr.log - - opensbi32-sifive_u-stdout.log - - opensbi32-sifive_u-stderr.log - - opensbi64-sifive_u-stdout.log - - opensbi64-sifive_u-stderr.log + - pc-bios/opensbi-riscv32-generic-fw_jump.bin + - pc-bios/opensbi-riscv64-generic-fw_jump.bin + - opensbi32-generic-stdout.log + - opensbi32-generic-stderr.log + - opensbi64-generic-stdout.log + - opensbi64-generic-stderr.log image: $CI_REGISTRY_IMAGE:opensbi-cross-build variables: GIT_DEPTH: 3
@@ -54,10 +48,6 @@ build-opensbi: - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1)) - echo "=== Using ${JOBS} simultaneous jobs ===" - make -j${JOBS} -C roms/opensbi clean - - make -j${JOBS} -C roms opensbi32-virt 2>&1 1>opensbi32-virt-stdout.log | tee -a opensbi32-virt-stderr.log >&2 + - make -j${JOBS} -C roms opensbi32-generic 2>&1 1>opensbi32-generic-stdout.log | tee -a opensbi32-generic-stderr.log >&2 - make -j${JOBS} -C roms/opensbi clean - - make -j${JOBS} -C roms opensbi64-virt 2>&1 1>opensbi64-virt-stdout.log | tee -a opensbi64-virt-stderr.log >&2 - - make -j${JOBS} -C roms/opensbi clean - - make -j${JOBS} -C roms opensbi32-sifive_u 2>&1 1>opensbi32-sifive_u-stdout.log | tee -a opensbi32-sifive_u-stderr.log >&2 - - make -j${JOBS} -C roms/opensbi clean - - make -j${JOBS} -C roms opensbi64-sifive_u 2>&1 1>opensbi64-sifive_u-stdout.log | tee -a opensbi64-sifive_u-stderr.log >&2 + - make -j${JOBS} -C roms opensbi64-generic 2>&1 1>opensbi64-generic-stdout.log | tee -a opensbi64-generic-stderr.log >&2
Signature · 1 line
2.7.4
Re: [PATCH 2/5] gitlab-ci/opensbi: Update GitLab CI to build generic platform
Quoted 24 lines · Bin Meng
From: Bin Meng <[email protected]>
This updates the GitLab CI opensbi job to build opensbi bios images for the generic platform.
Signed-off-by Bin Meng <[email protected]>---
.gitlab-ci-opensbi.yml | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-).gitlab-ci-opensbi.yml +0
-4@@ -34,18 +34,12 @@ build-opensbi: when: always artifacts: paths: # 'artifacts.zip' will contains the following files: - - pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin - - pc-bios/opensbi-riscv32-virt-fw_jump.bin - - pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin - - pc-bios/opensbi-riscv64-virt-fw_jump.bin
.gitlab-ci-opensbi.yml build-opensbi: · line 38
Quoted 10 lines
.gitlab-ci-opensbi.yml +2
-8- - opensbi32-virt-stdout.log - - opensbi32-virt-stderr.log - - opensbi64-virt-stdout.log - - opensbi64-virt-stderr.log - - opensbi32-sifive_u-stdout.log - - opensbi32-sifive_u-stderr.log - - opensbi64-sifive_u-stdout.log - - opensbi64-sifive_u-stderr.log + - pc-bios/opensbi-riscv32-generic-fw_jump.bin + - pc-bios/opensbi-riscv64-generic-fw_jump.bin
Same comment as PATCH1
We should add generic-fw_jump.elf here as well.
Quoted 21 lines
.gitlab-ci-opensbi.yml +6
-7+ - opensbi32-generic-stdout.log + - opensbi32-generic-stderr.log + - opensbi64-generic-stdout.log + - opensbi64-generic-stderr.log image: $CI_REGISTRY_IMAGE:opensbi-cross-build variables: GIT_DEPTH: 3@@ -54,10 +48,6 @@ build-opensbi: - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1)) - echo "=== Using ${JOBS} simultaneous jobs ===" - make -j${JOBS} -C roms/opensbi clean - - make -j${JOBS} -C roms opensbi32-virt 2>&1 1>opensbi32-virt-stdout.log | tee -a opensbi32-virt-stderr.log >&2 + - make -j${JOBS} -C roms opensbi32-generic 2>&1 1>opensbi32-generic-stdout.log | tee -a opensbi32-generic-stderr.log >&2 - make -j${JOBS} -C roms/opensbi clean - - make -j${JOBS} -C roms opensbi64-virt 2>&1 1>opensbi64-virt-stdout.log | tee -a opensbi64-virt-stderr.log >&2 - - make -j${JOBS} -C roms/opensbi clean - - make -j${JOBS} -C roms opensbi32-sifive_u 2>&1 1>opensbi32-sifive_u-stdout.log | tee -a opensbi32-sifive_u-stderr.log >&2 - - make -j${JOBS} -C roms/opensbi clean - - make -j${JOBS} -C roms opensbi64-sifive_u 2>&1 1>opensbi64-sifive_u-stdout.log | tee -a opensbi64-sifive_u-stderr.log >&2 + - make -j${JOBS} -C roms opensbi64-generic 2>&1 1>opensbi64-generic-stdout.log | tee -a opensbi64-generic-stderr.log >&2 --
Quoted 3 lines
2.7.4
Otherwise looks good to me.
Regards,
Anup
PATCH 3/5 riscv: Use pre-built bios image of generic platform for virt & sifive_u
In reply to Bin MengFrom: Bin Meng <[email protected]>
Update virt and sifive_u machines to use the opensbi bios image built for the generic FDT platform.
Remove the out-of-date no longer used bios images.
---
hw/riscv/sifive_u.c | 4 ++-- hw/riscv/virt.c | 4 ++-- pc-bios/opensbi-riscv32-generic-fw_jump.bin | Bin 0 -> 58032 bytes pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin | Bin 49520 -> 0 bytes pc-bios/opensbi-riscv32-virt-fw_jump.bin | Bin 49504 -> 0 bytes pc-bios/opensbi-riscv64-generic-fw_jump.bin | Bin 0 -> 66680 bytes pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 57936 -> 0 bytes pc-bios/opensbi-riscv64-virt-fw_jump.bin | Bin 57920 -> 0 bytes 8 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 pc-bios/opensbi-riscv32-generic-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin create mode 100644 pc-bios/opensbi-riscv64-generic-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.bin
hw/riscv/sifive_u.c +2 -2
@@ -58,9 +58,9 @@#include <libfdt.h> #if defined(TARGET_RISCV32 ) -# define BIOS_FILENAME "opensbi-riscv32-sifive_u-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv32-generic-fw_jump.bin"#else -# define BIOS_FILENAME "opensbi-riscv64-sifive_u-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv64-generic-fw_jump.bin"#endif static const struct MemmapEntry {
hw/riscv/virt.c +2 -2
@@ -46,9 +46,9 @@#include <libfdt.h> #if defined(TARGET_RISCV32 ) -# define BIOS_FILENAME "opensbi-riscv32-virt-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv32-generic-fw_jump.bin"#else -# define BIOS_FILENAME "opensbi-riscv64-virt-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv64-generic-fw_jump.bin"#endif static const struct MemmapEntry {
pc-bios/opensbi-riscv32-generic-fw_jump.bin new file binary +0 -0
pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin deleted binary +0 -0
pc-bios/opensbi-riscv32-virt-fw_jump.bin deleted binary +0 -0
pc-bios/opensbi-riscv64-generic-fw_jump.bin new file binary +0 -0
pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin deleted binary +0 -0
pc-bios/opensbi-riscv64-virt-fw_jump.bin deleted binary +0 -0
Signature · 1 line
2.7.4
Re: [PATCH 3/5] riscv: Use pre-built bios image of generic platform for virt & sifive_u
Quoted 84 lines · Bin Meng
From: Bin Meng <[email protected]>
Update virt and
sifive_umachines to use the opensbi bios image built for the generic FDT platform.Remove the out-of-date no longer used bios images.
Signed-off-by Bin Meng <[email protected]>---
hw/riscv/sifive_u.c | 4 ++-- hw/riscv/virt.c | 4 ++-- pc-bios/opensbi-riscv32-generic-fw_jump.bin | Bin 0 -> 58032 bytes pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin | Bin 49520 -> 0 bytes pc-bios/opensbi-riscv32-virt-fw_jump.bin | Bin 49504 -> 0 bytes pc-bios/opensbi-riscv64-generic-fw_jump.bin | Bin 0 -> 66680 bytes pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 57936 -> 0 bytes pc-bios/opensbi-riscv64-virt-fw_jump.bin | Bin 57920 -> 0 bytes 8 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 pc-bios/opensbi-riscv32-generic-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin create mode 100644 pc-bios/opensbi-riscv64-generic-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.binhw/riscv/sifive_u.c +2
-2@@ -58,9 +58,9 @@#include <libfdt.h> #if defined(TARGET_RISCV32 ) -# define BIOS_FILENAME "opensbi-riscv32-sifive_u-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv32-generic-fw_jump.bin"#else -# define BIOS_FILENAME "opensbi-riscv64-sifive_u-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv64-generic-fw_jump.bin"#endif static const struct MemmapEntry {hw/riscv/virt.c +2
-2@@ -46,9 +46,9 @@#include <libfdt.h> #if defined(TARGET_RISCV32 ) -# define BIOS_FILENAME "opensbi-riscv32-virt-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv32-generic-fw_jump.bin"#else -# define BIOS_FILENAME "opensbi-riscv64-virt-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv64-generic-fw_jump.bin"#endif static const struct MemmapEntry {pc-bios/opensbi-riscv32-generic-fw_jump.bin new file binary +0
-0pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin deleted binary +0
-0pc-bios/opensbi-riscv32-virt-fw_jump.bin deleted binary +0
-0pc-bios/opensbi-riscv64-generic-fw_jump.bin new file binary +0
-0pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin deleted binary +0
-0pc-bios/opensbi-riscv64-virt-fw_jump.bin deleted binary +0
-1--
Quoted 3 lines
2.7.4
Looks good to me.
Regards,
Anup
Re: [PATCH 3/5] riscv: Use pre-built bios image of generic platform for virt & sifive_u
In reply to Bin MengQuoted 9 lines · Bin Meng
From: Bin Meng <[email protected]>
Update virt and
sifive_umachines to use the opensbi bios image built for the generic FDT platform.Remove the out-of-date no longer used bios images.
Signed-off-by Bin Meng <[email protected]>
Alistair
Quoted 78 lines
---
hw/riscv/sifive_u.c | 4 ++-- hw/riscv/virt.c | 4 ++-- pc-bios/opensbi-riscv32-generic-fw_jump.bin | Bin 0 -> 58032 bytes pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin | Bin 49520 -> 0 bytes pc-bios/opensbi-riscv32-virt-fw_jump.bin | Bin 49504 -> 0 bytes pc-bios/opensbi-riscv64-generic-fw_jump.bin | Bin 0 -> 66680 bytes pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin 57936 -> 0 bytes pc-bios/opensbi-riscv64-virt-fw_jump.bin | Bin 57920 -> 0 bytes 8 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 pc-bios/opensbi-riscv32-generic-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv32-virt-fw_jump.bin create mode 100644 pc-bios/opensbi-riscv64-generic-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin delete mode 100644 pc-bios/opensbi-riscv64-virt-fw_jump.binhw/riscv/sifive_u.c +2
-2@@ -58,9 +58,9 @@#include <libfdt.h> #if defined(TARGET_RISCV32 ) -# define BIOS_FILENAME "opensbi-riscv32-sifive_u-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv32-generic-fw_jump.bin"#else -# define BIOS_FILENAME "opensbi-riscv64-sifive_u-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv64-generic-fw_jump.bin"#endif static const struct MemmapEntry {hw/riscv/virt.c +2
-2@@ -46,9 +46,9 @@#include <libfdt.h> #if defined(TARGET_RISCV32 ) -# define BIOS_FILENAME "opensbi-riscv32-virt-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv32-generic-fw_jump.bin"#else -# define BIOS_FILENAME "opensbi-riscv64-virt-fw_jump.bin" +# define BIOS_FILENAME "opensbi-riscv64-generic-fw_jump.bin"#endif static const struct MemmapEntry {pc-bios/opensbi-riscv32-generic-fw_jump.bin new file binary +0
-0pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin deleted binary +0
-0pc-bios/opensbi-riscv32-virt-fw_jump.bin deleted binary +0
-0pc-bios/opensbi-riscv64-generic-fw_jump.bin new file binary +0
-0pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin deleted binary +0
-0pc-bios/opensbi-riscv64-virt-fw_jump.bin deleted binary +0
-1--2.7.4
PATCH 4/5 riscv/spike: Change the default bios to use generic platform image
In reply to Bin MengFrom: Bin Meng <[email protected]>
To keep sync with other RISC-V machines, change the default bios to use generic platform image.
While we are here, add some comments to mention that keeping ELF files here was intentional.
---
hw/riscv/spike.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
hw/riscv/spike.c +7 -2
@@ -45,10 +45,15 @@#include <libfdt.h> +/* +* Not like other RISC-V machines that use plain binary bios images, +* keeping ELF files here was intentional because BIN files don't work +* for the Spike machine as HTIF emulation depends on ELF parsing. +*/ #if defined(TARGET_RISCV32 ) -# define BIOS_FILENAME "opensbi-riscv32-spike-fw_jump.elf" +# define BIOS_FILENAME "opensbi-riscv32-generic-fw_jump.elf"#else -# define BIOS_FILENAME "opensbi-riscv64-spike-fw_jump.elf" +# define BIOS_FILENAME "opensbi-riscv64-generic-fw_jump.elf"#endif static const struct MemmapEntry {
Signature · 1 line
2.7.4
Re: [PATCH 4/5] riscv/spike: Change the default bios to use generic platform image
Quoted 38 lines · Bin Meng
From: Bin Meng <[email protected]>
To keep sync with other RISC-V machines, change the default bios to use generic platform image.
While we are here, add some comments to mention that keeping ELF files here was intentional.
Signed-off-by Bin Meng <[email protected]>---
hw/riscv/spike.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)hw/riscv/spike.c +7
-3@@ -45,10 +45,15 @@#include <libfdt.h> +/* +* Not like other RISC-V machines that use plain binary bios images, +* keeping ELF files here was intentional because BIN files don't work +* for the Spike machine as HTIF emulation depends on ELF parsing. +*/ #if defined(TARGET_RISCV32 ) -# define BIOS_FILENAME "opensbi-riscv32-spike-fw_jump.elf" +# define BIOS_FILENAME "opensbi-riscv32-generic-fw_jump.elf"#else -# define BIOS_FILENAME "opensbi-riscv64-spike-fw_jump.elf" +# define BIOS_FILENAME "opensbi-riscv64-generic-fw_jump.elf"#endif static const struct MemmapEntry { --
Quoted 3 lines
2.7.4
Looks good to me.
Regards,
Anup
Re: [PATCH 4/5] riscv/spike: Change the default bios to use generic platform image
In reply to Bin MengQuoted 10 lines · Bin Meng
From: Bin Meng <[email protected]>
To keep sync with other RISC-V machines, change the default bios to use generic platform image.
While we are here, add some comments to mention that keeping ELF files here was intentional.
Signed-off-by Bin Meng <[email protected]>
Alistair
Quoted 31 lines
---
hw/riscv/spike.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)hw/riscv/spike.c +7
-3@@ -45,10 +45,15 @@#include <libfdt.h> +/* +* Not like other RISC-V machines that use plain binary bios images, +* keeping ELF files here was intentional because BIN files don't work +* for the Spike machine as HTIF emulation depends on ELF parsing. +*/ #if defined(TARGET_RISCV32 ) -# define BIOS_FILENAME "opensbi-riscv32-spike-fw_jump.elf" +# define BIOS_FILENAME "opensbi-riscv32-generic-fw_jump.elf"#else -# define BIOS_FILENAME "opensbi-riscv64-spike-fw_jump.elf" +# define BIOS_FILENAME "opensbi-riscv64-generic-fw_jump.elf"#endif static const struct MemmapEntry { --2.7.4
PATCH 5/5 riscv: Suppress the error report for QEMU testing with riscv_find_firmware()
In reply to Bin MengFrom: Bin Meng <[email protected]>
We only ship plain binary bios images in the QEMU source. With Spike machine that uses ELF images as the default bios, running QEMU test will complain hence let's suppress the error report for QEMU testing.
---
hw/riscv/boot.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
hw/riscv/boot.c +11 -3
@@ -65,9 +65,17 @@ char *riscv_find_firmware(const char *firmware_filename) filename =qemu_find_file (QEMU_FILE_TYPE_BIOS , firmware_filename);if (filename ==NULL ) { -error_report ("Unable to load the RISC-V firmware \"%s\"" , - firmware_filename); -exit (1 ); +if (!qtest_enabled ()) { +/* +* We only ship plain binary bios images in the QEMU source. +* With Spike machine that uses ELF images as the default bios, +* running QEMU test will complain hence let's suppress the error +* report for QEMU testing. +*/ +error_report ("Unable to load the RISC-V firmware \"%s\"" , + firmware_filename); +exit (1 ); + } }return filename;
Signature · 1 line
2.7.4
Re: [PATCH 5/5] riscv: Suppress the error report for QEMU testing with riscv_find_firmware()
Quoted 40 lines · Bin Meng
From: Bin Meng <[email protected]>
We only ship plain binary bios images in the QEMU source. With Spike machine that uses ELF images as the default bios, running QEMU test will complain hence let's suppress the error report for QEMU testing.
Signed-off-by Bin Meng <[email protected]>---
hw/riscv/boot.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)hw/riscv/boot.c +11
-4@@ -65,9 +65,17 @@ char *riscv_find_firmware(const char *firmware_filename) filename =qemu_find_file (QEMU_FILE_TYPE_BIOS , firmware_filename);if (filename ==NULL ) { -error_report ("Unable to load the RISC-V firmware \"%s\"" , - firmware_filename); -exit (1 ); +if (!qtest_enabled ()) { +/* +* We only ship plain binary bios images in the QEMU source. +* With Spike machine that uses ELF images as the default bios, +* running QEMU test will complain hence let's suppress the error +* report for QEMU testing. +*/ +error_report ("Unable to load the RISC-V firmware \"%s\"" , + firmware_filename); +exit (1 ); + } }return filename; --
Quoted 3 lines
2.7.4
Looks good to me.
Regards,
Anup