Replace distro boot with standard boot, as the QEMU Arm targets did. Move the environment from CFG_EXTRA_ENV_SETTINGS into qemu-riscv.env, keeping the same addresses, and replace BOOT_TARGET_DEVICES with a boot_targets variable that lists qfw first, then the devices distro boot scanned.
With distro boot, a kernel passed with -kernel is never tried, as distro_bootcmd has no qfw target. With this change, booting U-Boot from pflash with -kernel, -initrd and -append boots that kernel directly. The sysboot command is no longer enabled, as the extlinux boot method replaces it; this matches the QEMU Arm targets. Signed-off-by: Hung-Chun Tseng <[email protected]> --- board/emulation/qemu-riscv/qemu-riscv.env | 15 +++++++++++++ configs/qemu-riscv32_defconfig | 2 +- configs/qemu-riscv32_smode_defconfig | 2 +- configs/qemu-riscv32_spl_defconfig | 2 +- configs/qemu-riscv64_defconfig | 2 +- configs/qemu-riscv64_smode_defconfig | 2 +- configs/qemu-riscv64_spl_defconfig | 2 +- include/configs/qemu-riscv.h | 26 ----------------------- 8 files changed, 21 insertions(+), 32 deletions(-) create mode 100644 board/emulation/qemu-riscv/qemu-riscv.env diff --git a/board/emulation/qemu-riscv/qemu-riscv.env b/board/emulation/qemu-riscv/qemu-riscv.env new file mode 100644 index 000000000..9e691616b --- /dev/null +++ b/board/emulation/qemu-riscv/qemu-riscv.env @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +/* environment for qemu-riscv32 and qemu-riscv64 */ + +stdin=serial,usbkbd +stdout=serial,vidconsole +stderr=serial,vidconsole +kernel_addr_r=0x84000000 +kernel_comp_addr_r=0x88000000 +kernel_comp_size=0x4000000 +fdt_addr_r=0x8c000000 +scriptaddr=0x8c100000 +pxefile_addr_r=0x8c200000 +ramdisk_addr_r=0x8c300000 +boot_targets=qfw nvme virtio scsi dhcp diff --git a/configs/qemu-riscv32_defconfig b/configs/qemu-riscv32_defconfig index 2801e0b21..e16a0c6e2 100644 --- a/configs/qemu-riscv32_defconfig +++ b/configs/qemu-riscv32_defconfig @@ -7,7 +7,7 @@ CONFIG_SYS_MONITOR_LEN=786432 CONFIG_SYS_LOAD_ADDR=0x80200000 CONFIG_TARGET_QEMU_VIRT=y CONFIG_FIT=y -CONFIG_DISTRO_DEFAULTS=y +CONFIG_BOOTSTD_DEFAULTS=y CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y # CONFIG_BOARD_INIT is not set diff --git a/configs/qemu-riscv32_smode_defconfig b/configs/qemu-riscv32_smode_defconfig index 69f25349d..4629bf3ac 100644 --- a/configs/qemu-riscv32_smode_defconfig +++ b/configs/qemu-riscv32_smode_defconfig @@ -8,7 +8,7 @@ CONFIG_SYS_LOAD_ADDR=0x80200000 CONFIG_TARGET_QEMU_VIRT=y CONFIG_RISCV_SMODE=y CONFIG_FIT=y -CONFIG_DISTRO_DEFAULTS=y +CONFIG_BOOTSTD_DEFAULTS=y CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y # CONFIG_BOARD_INIT is not set diff --git a/configs/qemu-riscv32_spl_defconfig b/configs/qemu-riscv32_spl_defconfig index 790bcb72b..94827f35c 100644 --- a/configs/qemu-riscv32_spl_defconfig +++ b/configs/qemu-riscv32_spl_defconfig @@ -13,7 +13,7 @@ CONFIG_RISCV_SMODE=y # CONFIG_OF_BOARD_FIXUP is not set CONFIG_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x80200000 -CONFIG_DISTRO_DEFAULTS=y +CONFIG_BOOTSTD_DEFAULTS=y CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y # CONFIG_BOARD_INIT is not set diff --git a/configs/qemu-riscv64_defconfig b/configs/qemu-riscv64_defconfig index a32eb95f2..1103a3dd0 100644 --- a/configs/qemu-riscv64_defconfig +++ b/configs/qemu-riscv64_defconfig @@ -7,7 +7,7 @@ CONFIG_SYS_LOAD_ADDR=0x80200000 CONFIG_TARGET_QEMU_VIRT=y CONFIG_ARCH_RV64I=y CONFIG_FIT=y -CONFIG_DISTRO_DEFAULTS=y +CONFIG_BOOTSTD_DEFAULTS=y CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y # CONFIG_BOARD_INIT is not set diff --git a/configs/qemu-riscv64_smode_defconfig b/configs/qemu-riscv64_smode_defconfig index 084960460..9d50df410 100644 --- a/configs/qemu-riscv64_smode_defconfig +++ b/configs/qemu-riscv64_smode_defconfig @@ -8,7 +8,7 @@ CONFIG_TARGET_QEMU_VIRT=y CONFIG_ARCH_RV64I=y CONFIG_RISCV_SMODE=y CONFIG_FIT=y -CONFIG_DISTRO_DEFAULTS=y +CONFIG_BOOTSTD_DEFAULTS=y CONFIG_USE_PREBOOT=y CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr}; fdt addr ${fdtcontroladdr};" CONFIG_DISPLAY_CPUINFO=y diff --git a/configs/qemu-riscv64_spl_defconfig b/configs/qemu-riscv64_spl_defconfig index 5c1ced65b..2c0e42045 100644 --- a/configs/qemu-riscv64_spl_defconfig +++ b/configs/qemu-riscv64_spl_defconfig @@ -12,7 +12,7 @@ CONFIG_ARCH_RV64I=y CONFIG_RISCV_SMODE=y CONFIG_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x80200000 -CONFIG_DISTRO_DEFAULTS=y +CONFIG_BOOTSTD_DEFAULTS=y CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y # CONFIG_BOARD_INIT is not set diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h index 63078ee41..d9ca371d9 100644 --- a/include/configs/qemu-riscv.h +++ b/include/configs/qemu-riscv.h @@ -15,30 +15,4 @@ #define RISCV_MMODE_TIMER_FREQ 1000000 #define RISCV_SMODE_TIMER_FREQ 1000000 -/* Environment options */ - -#define CFG_STD_DEVICES_SETTINGS "stdin=serial,usbkbd\0" \ - "stdout=serial,vidconsole\0" \ - "stderr=serial,vidconsole\0" - -#define BOOT_TARGET_DEVICES(func) \ - func(NVME, nvme, 0) \ - func(VIRTIO, virtio, 0) \ - func(VIRTIO, virtio, 1) \ - func(SCSI, scsi, 0) \ - func(DHCP, dhcp, na) - -#include <config_distro_bootcmd.h> - -#define CFG_EXTRA_ENV_SETTINGS \ - CFG_STD_DEVICES_SETTINGS \ - "kernel_addr_r=0x84000000\0" \ - "kernel_comp_addr_r=0x88000000\0" \ - "kernel_comp_size=0x4000000\0" \ - "fdt_addr_r=0x8c000000\0" \ - "scriptaddr=0x8c100000\0" \ - "pxefile_addr_r=0x8c200000\0" \ - "ramdisk_addr_r=0x8c300000\0" \ - BOOTENV - #endif /* __CONFIG_H */ -- 2.43.0
