summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndre Przywara <[email protected]>2022-10-10 18:01:22 +0100
committerTom Rini <[email protected]>2022-10-21 16:06:14 -0400
commitd6d8720c3f273f412ca1e2f6436b1ae11904161d (patch)
tree7caf2e41938bdc0d49be6a5ea1201ae67e53ce85 /include
parent2f6c45eb6870989372d62afa365380aa44448bf3 (diff)
qemu: Try to automatically boot from the QEMU firmware device (qfw)
At the moment the QEMU boot sequence tries various (storage) devices when trying to find a payload to boot. To simplify starting a specific kernel and initrd, there is also the qfw command, which can use the files specified on the QEMU command line, via the -kernel and -initrd options. Add this command to the list of boot options to try. Since users specifying those options on the command line probably explicitly want to run them, let's place the new command first. Without those options, the qfw command will just gracefully fail, and we continue with the existing order. This allows auto-booting of specific kernels in QEMU, for instance in CI systems. Signed-off-by: Andre Przywara <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/configs/qemu-arm.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/configs/qemu-arm.h b/include/configs/qemu-arm.h
index dd2faebbbb2..535762ecb24 100644
--- a/include/configs/qemu-arm.h
+++ b/include/configs/qemu-arm.h
@@ -21,6 +21,17 @@
EFI_GUID(0x058b7d83, 0x50d5, 0x4c47, 0xa1, 0x95, \
0x60, 0xd8, 0x6a, 0xd3, 0x41, 0xc4)
+/* Try files from QEMU's -kernel/-initrd, through the QEMU firmware device. */
+#define BOOTENV_DEV_QFW(devtypeu, devtypel, instance) \
+ "bootcmd_qfw= " \
+ "if qfw load $kernel_addr_r $ramdisk_addr_r; then " \
+ " booti $kernel_addr_r $ramdisk_addr_r:$filesize $fdtcontroladdr; " \
+ " if test $? -eq 1; then " \
+ " bootz $kernel_addr_r $ramdisk_addr_r:$filesize $fdtcontroladdr; " \
+ " fi ; " \
+ "fi\0"
+#define BOOTENV_DEV_NAME_QFW(devtypeu, devtypel, instance) "qfw "
+
/* For timer, QEMU emulates an ARMv7/ARMv8 architected timer */
/* Environment options */
@@ -56,6 +67,7 @@
#endif
#define BOOT_TARGET_DEVICES(func) \
+ func(QFW, qfw, na) \
BOOT_TARGET_USB(func) \
BOOT_TARGET_SCSI(func) \
BOOT_TARGET_VIRTIO(func) \