]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ppc: qemu: Enable VirtIO NET support
authorBin Meng <bmeng.cn@gmail.com>
Thu, 25 Feb 2021 09:22:46 +0000 (17:22 +0800)
committerPriyanka Jain <priyanka.jain@nxp.com>
Fri, 5 Mar 2021 04:55:43 +0000 (10:25 +0530)
By default the QEMU ppce500 machine connects a VirtIO NET to the
PCI controller, although it can be replaced to an e1000 NIC via
additional command line options.

Now that we have switched over to DM PCI, VirtIO support becomes
possible. This commit enables the support.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
board/freescale/qemu-ppce500/qemu-ppce500.c
configs/qemu-ppce500_defconfig

index 79a698671c611ad7d91a408e1db8605f82db734b..9c30c12d4f92cfdb21fa1e87c38eae0518d1fc81 100644 (file)
@@ -24,6 +24,8 @@
 #include <fdtdec.h>
 #include <errno.h>
 #include <malloc.h>
+#include <virtio_types.h>
+#include <virtio.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -130,6 +132,12 @@ int misc_init_r(void)
        if (ret)
                return ret;
 
+       /*
+        * Make sure virtio bus is enumerated so that peripherals
+        * on the virtio bus can be discovered by their drivers.
+        */
+       virtio_init();
+
        return 0;
 }
 
index 918739b615dbcd13cf2fa48421c34823c237f6ff..202e97e8ec55d58ac2325ea43bf5a4b1d92d27be 100644 (file)
@@ -33,5 +33,7 @@ CONFIG_DM_PCI=y
 CONFIG_PCI_MPC85XX=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
+CONFIG_VIRTIO_PCI=y
+CONFIG_VIRTIO_NET=y
 CONFIG_ADDR_MAP=y
 CONFIG_PANIC_HANG=y