Run virtio scan before booting from VirtIO Block Device over PCIe

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
This commit is contained in:
David Abdurachmanov 2019-06-28 16:57:06 +03:00
parent 8a5a414e3c
commit a87326e86a
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
2 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,37 @@
diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 8f4c70e9..b44ec333 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -282,10 +282,23 @@
#endif
#ifdef CONFIG_CMD_VIRTIO
-#define BOOTENV_SHARED_VIRTIO BOOTENV_SHARED_BLKDEV(virtio)
+#define BOOTENV_RUN_VIRTIO_INIT "run virtio_init; "
+#define BOOTENV_SET_VIRTIO_NEED_INIT "virtio_need_init=; "
+#define BOOTENV_SHARED_VIRTIO \
+ "virtio_init=" \
+ "if ${virtio_need_init}; then " \
+ "virtio_need_init=false; " \
+ "virtio scan; " \
+ "fi\0" \
+ \
+ "virtio_boot=" \
+ BOOTENV_RUN_VIRTIO_INIT \
+ BOOTENV_SHARED_BLKDEV_BODY(virtio)
#define BOOTENV_DEV_VIRTIO BOOTENV_DEV_BLKDEV
#define BOOTENV_DEV_NAME_VIRTIO BOOTENV_DEV_NAME_BLKDEV
#else
+#define BOOTENV_RUN_VIRTIO_INIT
+#define BOOTENV_SET_VIRTIO_NEED_INIT
#define BOOTENV_SHARED_VIRTIO
#define BOOTENV_DEV_VIRTIO \
BOOT_TARGET_DEVICES_references_VIRTIO_without_CONFIG_CMD_VIRTIO
@@ -465,6 +478,7 @@
\
"distro_bootcmd=" BOOTENV_SET_SCSI_NEED_INIT \
BOOTENV_SET_NVME_NEED_INIT \
+ BOOTENV_SET_VIRTIO_NEED_INIT \
"for target in ${boot_targets}; do " \
"run bootcmd_${target}; " \
"done\0"

View File

@ -2,7 +2,7 @@
Name: uboot-tools
Version: 2019.07
Release: 0.1%{?candidate:.%{candidate}}.1.riscv64%{?dist}
Release: 0.1%{?candidate:.%{candidate}}.2.riscv64%{?dist}
Summary: U-Boot utilities
License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+
URL: http://www.denx.de/wiki/U-Boot
@ -28,6 +28,7 @@ Patch9: arm-tegra-defaine-fdtfile-for-all-devices.patch
Patch10: 0001-configs-tinker-rk3288-disable-CONFIG_SPL_I2C_SUPPORT.patch
Patch20: u-boot-2019.07-rc4-riscv-imply-VIRTIO_PCI.patch
Patch21: u-boot-2019.07-rc4-fix-virtio.patch
BuildRequires: bc
BuildRequires: dtc
@ -290,6 +291,9 @@ cp -p board/warp7/README builds/docs/README.warp7
%endif
%changelog
* Fri Jun 28 2019 David Abdurachmanov <david.abdurachmanov@sifive.com> 2019.07-0.1-rc4.2.riscv64
- Run "virtio scan" before booting from VirtIO Block Device over PCIe transport
* Wed Jun 26 2019 David Abdurachmanov <david.abdurachmanov@sifive.com> 2019.07-0.1-rc4.1.riscv64
- Add VIRTIO_PCI for RISC-V QEMU emulation