Skip to content

riscv: qemu: Boot a kernel passed with -kernel

Hung-Chun Tseng u-boot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4cmd: Enable qfw by default on QEMU RISC-Vcmd/Kconfig configs/qemu-riscv32_spl_defconfig configs/qemu-riscv64_spl_defconfig+3 -10 replies
2/4riscv: qemu: Do not disable initrd relocationinclude/configs/qemu-riscv.h+0 -10 replies
3/4riscv: qemu: Switch to standard bootboard/emulation/qemu-riscv/qemu-riscv.env configs/qemu-riscv32_defconfig configs/qemu-riscv32_smode_defconfig +5 more+21 -320 replies
4/4doc: qemu-riscv: Describe booting a kernel through fw_cfgdoc/board/emulation/qemu-riscv.rst+12 -00 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchLeo Yu-Chi Liang
SeriesR-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] riscv: qemu: Boot a kernel passed with -kernel

When U-Boot runs from pflash on the QEMU RISC-V virt machine, QEMU passes -kernel, -initrd and -append through fw_cfg and leaves booting them to the firmware. U-Boot ignores them today: QFW is only enabled with ACPI, and distro boot has no qfw target.

This series brings the RISC-V QEMU targets in line with the Arm ones:

1. Enable CMD_QFW (and so QFW_MMIO) by default, and keep SPL_BLOBLIST off in the SPL defconfigs, which would otherwise fail to link.
2. Stop disabling initrd relocation, which checkpatch would reject in the .env file of the next patch.
3. Switch from distro boot to standard boot, with the environment in qemu-riscv.env and qfw first in boot_targets.
4. Document booting through fw_cfg.

Tested with QEMU v11.1.2 and the Debian trixie riscv64 netboot kernel and initrd (Linux 6.12):

- qemu-riscv64_smode built for pflash, run with -kernel, -initrd and -append and no input: U-Boot boots the kernel through qfw, the kernel gets the command line and unpacks the initrd.
- qemu-riscv64_smode with a GPT disk holding an extlinux.conf on
virtio-blk: standard boot boots it with the extlinux method, as distro boot did before the series.
- qemu-riscv64, qemu-riscv64_smode_acpi and qemu-riscv64_spl boot to the prompt with the new boot_targets and bootcmd.
- qemu-riscv64_smode and qemu-riscv64_spl build at every patch.

I could not build the riscv32 targets here: my toolchain lacks the rv32 libgcc and fails to link them with or without this series.

Hung-Chun Tseng (4):
cmd: Enable qfw by default on QEMU RISC-V
riscv: qemu: Do not disable initrd relocation
riscv: qemu: Switch to standard boot
doc: qemu-riscv: Describe booting a kernel through fw_cfg

 board/emulation/qemu-riscv/qemu-riscv.env | 15 +++++++++++++
 cmd/Kconfig                               |  2 +-
 configs/qemu-riscv32_defconfig            |  2 +-
 configs/qemu-riscv32_smode_defconfig      |  2 +-
 configs/qemu-riscv32_spl_defconfig        |  3 ++-
 configs/qemu-riscv64_defconfig            |  2 +-
 configs/qemu-riscv64_smode_defconfig      |  2 +-
 configs/qemu-riscv64_spl_defconfig        |  3 ++-
 doc/board/emulation/qemu-riscv.rst        | 12 ++++++++++
 include/configs/qemu-riscv.h              | 27 -----------------------
 10 files changed, 36 insertions(+), 34 deletions(-)
 create mode 100644 board/emulation/qemu-riscv/qemu-riscv.env
Signature · 1 line
2.43.0