summaryrefslogtreecommitdiff
path: root/board/emulation/qemu-riscv/qemu-riscv.c
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2018-10-15 02:21:13 -0700
committerSimon Glass <sjg@chromium.org>2018-11-14 09:16:27 -0800
commit3c5196dca5a639cfe88aae3baad3ecfc429adb49 (patch)
tree58a1415ffe3b095843018581e09fa382d0ee20df /board/emulation/qemu-riscv/qemu-riscv.c
parent78e12901f3fc8d228bd050f35594e1994f6a7d35 (diff)
riscv: qemu: Enumerate virtio bus during early boot
Currently devices on the virtio bus is not automatically enumerated, which means peripherals on the virtio bus are not discovered by their drivers. This uses board_init() to do the virtio enumeration. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board/emulation/qemu-riscv/qemu-riscv.c')
-rw-r--r--board/emulation/qemu-riscv/qemu-riscv.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/board/emulation/qemu-riscv/qemu-riscv.c b/board/emulation/qemu-riscv/qemu-riscv.c
index 041e716c9b..2730a288fb 100644
--- a/board/emulation/qemu-riscv/qemu-riscv.c
+++ b/board/emulation/qemu-riscv/qemu-riscv.c
@@ -4,12 +4,21 @@
*/
#include <common.h>
+#include <dm.h>
#include <fdtdec.h>
+#include <virtio_types.h>
+#include <virtio.h>
#define MROM_FDT_ADDR 0x1020
int board_init(void)
{
+ /*
+ * Make sure virtio bus is enumerated so that peripherals
+ * on the virtio bus can be discovered by their drivers
+ */
+ virtio_init();
+
return 0;
}