From a87326e86ad4572ca91857b7d290dfb2339e3604 Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Fri, 28 Jun 2019 16:57:06 +0300 Subject: [PATCH] Run virtio scan before booting from VirtIO Block Device over PCIe Signed-off-by: David Abdurachmanov --- u-boot-2019.07-rc4-fix-virtio.patch | 37 +++++++++++++++++++++++++++++ uboot-tools.spec | 6 ++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 u-boot-2019.07-rc4-fix-virtio.patch diff --git a/u-boot-2019.07-rc4-fix-virtio.patch b/u-boot-2019.07-rc4-fix-virtio.patch new file mode 100644 index 0000000..0619317 --- /dev/null +++ b/u-boot-2019.07-rc4-fix-virtio.patch @@ -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" diff --git a/uboot-tools.spec b/uboot-tools.spec index f65dc31..50b9653 100644 --- a/uboot-tools.spec +++ b/uboot-tools.spec @@ -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 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 2019.07-0.1-rc4.1.riscv64 - Add VIRTIO_PCI for RISC-V QEMU emulation