Skip to contentSkip to conversation

qemu-arm: Enable NVMe for distro boot

PATCH In review Alexander Graf 3 participants 3 messages Feb 27, 2022 – Apr 5, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-arm: Enable NVMe for distro boot

We already support the NVMe commands and PCIe backend in the QEMU target, so let's make it easy for anyone to consume them and enable NVMe distro boot along the way!

With this patch, I can put an NVMe backed disk image into my QEMU VM and have it automatically load a UEFI target blob.

---
 include/configs/qemu-arm.h | 7 +++++++
 1 file changed, 7 insertions(+)
include/configs/qemu-arm.h +7 -0
index d45f606860..7ae71e0029 100644
@@ -39,6 +39,12 @@
 # define BOOT_TARGET_VIRTIO(func)
 #endif
 
+#if CONFIG_IS_ENABLED(CMD_NVME)
+# define BOOT_TARGET_NVME(func) func(NVME, nvme, 0)
+#else
+# define BOOT_TARGET_NVME(func)
+#endif
+
 #if CONFIG_IS_ENABLED(CMD_DHCP)
 # define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
 #else
@@ -49,6 +55,7 @@
 	BOOT_TARGET_USB(func) \
 	BOOT_TARGET_SCSI(func) \
 	BOOT_TARGET_VIRTIO(func) \
+	BOOT_TARGET_NVME(func) \
 	BOOT_TARGET_DHCP(func)
 
 #include <config_distro_bootcmd.h>
Signature · 1 line
2.32.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines

From: Alexander Graf <[email protected]>
Date: Sun, 27 Feb 2022 13:20:32 +0100

We already support the NVMe commands and PCIe backend in the QEMU target, so let's make it easy for anyone to consume them and enable NVMe distro boot along the way!

Quoted 7 lines

With this patch, I can put an NVMe backed disk image into my QEMU VM and have it automatically load a UEFI target blob.

---
 include/configs/qemu-arm.h | 7 +++++++
 1 file changed, 7 insertions(+)
Quoted 29 lines
include/configs/qemu-arm.h +7 -0
index d45f606860..7ae71e0029 100644
@@ -39,6 +39,12 @@
 # define BOOT_TARGET_VIRTIO(func)
 #endif
 
+#if CONFIG_IS_ENABLED(CMD_NVME)
+# define BOOT_TARGET_NVME(func) func(NVME, nvme, 0)
+#else
+# define BOOT_TARGET_NVME(func)
+#endif
+
 #if CONFIG_IS_ENABLED(CMD_DHCP)
 # define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
 #else
@@ -49,6 +55,7 @@
 	BOOT_TARGET_USB(func) \
 	BOOT_TARGET_SCSI(func) \
 	BOOT_TARGET_VIRTIO(func) \
+	BOOT_TARGET_NVME(func) \
 	BOOT_TARGET_DHCP(func)
 
 #include <config_distro_bootcmd.h>
Signature · 1 line
2.32.0
#2 lore raw
In reply to Alexander Graf
Quoted 9 lines · Alexander Graf

We already support the NVMe commands and PCIe backend in the QEMU target, so let's make it easy for anyone to consume them and enable NVMe distro boot along the way!

With this patch, I can put an NVMe backed disk image into my QEMU VM and have it automatically load a UEFI target blob.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom