diff mbox series

[U-Boot,v3,24/28] distro_bootcmd: add VirtIO distro boot command

Message ID 20181109125923.7034-25-lukas.auer@aisec.fraunhofer.de
State Superseded
Delegated to: Andes
Headers show
Series General fixes / cleanup for RISC-V and improvements to qemu-riscv | expand

Commit Message

Lukas Auer Nov. 9, 2018, 12:59 p.m. UTC
Add a boot command to distro boot to support disks connected over the
VirtIO bus. The boot command uses the shared block environment.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
---

Changes in v3:
- New patch to add VirtIO distro boot command

Changes in v2: None

 doc/README.distro               |  3 ++-
 include/config_distro_bootcmd.h | 13 +++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

Comments

Bin Meng Nov. 13, 2018, 5:57 a.m. UTC | #1
On Fri, Nov 9, 2018 at 9:00 PM Lukas Auer
<lukas.auer@aisec.fraunhofer.de> wrote:
>
> Add a boot command to distro boot to support disks connected over the
> VirtIO bus. The boot command uses the shared block environment.
>
> Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
> ---
>
> Changes in v3:
> - New patch to add VirtIO distro boot command
>
> Changes in v2: None
>
>  doc/README.distro               |  3 ++-
>  include/config_distro_bootcmd.h | 13 +++++++++++++
>  2 files changed, 15 insertions(+), 1 deletion(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Alexander Graf Nov. 13, 2018, 8:56 a.m. UTC | #2
On 09.11.18 13:59, Lukas Auer wrote:
> Add a boot command to distro boot to support disks connected over the
> VirtIO bus. The boot command uses the shared block environment.
> 
> Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>

Reviewed-by: Alexander Graf <agraf@suse.de>

Alex
diff mbox series

Patch

diff --git a/doc/README.distro b/doc/README.distro
index f8e9752a0f..ab6e6f4e74 100644
--- a/doc/README.distro
+++ b/doc/README.distro
@@ -292,7 +292,7 @@  Each entry in the macro defines a single boot device (e.g. a specific eMMC
 device or SD card) or type of boot device (e.g. USB disk). The parameters to
 the func macro (passed in by the internal implementation of the header) are:
 
-- Upper-case disk type (MMC, SATA, SCSI, IDE, USB, DHCP, PXE).
+- Upper-case disk type (MMC, SATA, SCSI, IDE, USB, DHCP, PXE, VIRTIO).
 - Lower-case disk type (same options as above).
 - ID of the specific disk (MMC only) or ignored for other types.
 
@@ -398,6 +398,7 @@  The list of possible targets consists of:
   * scsi
   * ide
   * usb
+  * virtio
 
 Other *boot* variables than the ones defined above are only for internal use
 of the boot environment and are not guaranteed to exist or work in the same
diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 54186efe7b..5324ede292 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -242,6 +242,18 @@ 
 	BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
 #endif
 
+#ifdef CONFIG_CMD_VIRTIO
+#define BOOTENV_SHARED_VIRTIO	BOOTENV_SHARED_BLKDEV(virtio)
+#define BOOTENV_DEV_VIRTIO	BOOTENV_DEV_BLKDEV
+#define BOOTENV_DEV_NAME_VIRTIO	BOOTENV_DEV_NAME_BLKDEV
+#else
+#define BOOTENV_SHARED_VIRTIO
+#define BOOTENV_DEV_VIRTIO \
+	BOOT_TARGET_DEVICES_references_VIRTIO_without_CONFIG_CMD_VIRTIO
+#define BOOTENV_DEV_NAME_VIRTIO \
+	BOOT_TARGET_DEVICES_references_VIRTIO_without_CONFIG_CMD_VIRTIO
+#endif
+
 #if defined(CONFIG_CMD_DHCP)
 #if defined(CONFIG_EFI_LOADER)
 /* http://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml */
@@ -350,6 +362,7 @@ 
 	BOOTENV_SHARED_IDE \
 	BOOTENV_SHARED_UBIFS \
 	BOOTENV_SHARED_EFI \
+	BOOTENV_SHARED_VIRTIO \
 	"boot_prefixes=/ /boot/\0" \
 	"boot_scripts=boot.scr.uimg boot.scr\0" \
 	"boot_script_dhcp=boot.scr.uimg\0" \