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 -- 2.43.0
