[PATCH v8 02/13] virtio: Ensure PCI is set up first

Simon Glass sjg at chromium.org
Fri Apr 7 12:36:40 CEST 2023


Sometimes virtio may rely on PCI, or at least that is what the
distro_bootcmd script suggests. Add this in.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v5)

Changes in v5:
- Add new patch to ensure PCI is set up first when using virtio

 drivers/virtio/virtio-uclass.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/virtio/virtio-uclass.c b/drivers/virtio/virtio-uclass.c
index de9bc90359ca..918cc15b019f 100644
--- a/drivers/virtio/virtio-uclass.c
+++ b/drivers/virtio/virtio-uclass.c
@@ -373,6 +373,12 @@ static int virtio_bootdev_hunt(struct bootdev_hunter *info, bool show)
 {
 	int ret;
 
+	if (IS_ENABLED(CONFIG_PCI)) {
+		ret = uclass_probe_all(UCLASS_PCI);
+		if (ret && ret != -ENOENT)
+			return log_msg_ret("pci", ret);
+	}
+
 	ret = uclass_probe_all(UCLASS_VIRTIO);
 	if (ret && ret != -ENOENT)
 		return log_msg_ret("vir", ret);
-- 
2.40.0.577.gac1e443424-goog



More information about the U-Boot mailing list