diff mbox series

[v3,25/38] ppc: qemu: Enable VirtIO NET support

Message ID 1614244979-48216-26-git-send-email-bmeng.cn@gmail.com
State Accepted
Commit 46c9b595369170bc011e56dfb0c26d834f3e5e60
Delegated to: Priyanka Jain
Headers show
Series ppc: qemu: Convert qemu-ppce500 to driver model and enable additional driver support | expand

Commit Message

Bin Meng Feb. 25, 2021, 9:22 a.m. UTC
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>
---

(no changes since v1)

 board/freescale/qemu-ppce500/qemu-ppce500.c | 8 ++++++++
 configs/qemu-ppce500_defconfig              | 2 ++
 2 files changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/board/freescale/qemu-ppce500/qemu-ppce500.c b/board/freescale/qemu-ppce500/qemu-ppce500.c
index 79a6986..9c30c12 100644
--- a/board/freescale/qemu-ppce500/qemu-ppce500.c
+++ b/board/freescale/qemu-ppce500/qemu-ppce500.c
@@ -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;
 }
 
diff --git a/configs/qemu-ppce500_defconfig b/configs/qemu-ppce500_defconfig
index 918739b..202e97e 100644
--- a/configs/qemu-ppce500_defconfig
+++ b/configs/qemu-ppce500_defconfig
@@ -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