From 3c5196dca5a639cfe88aae3baad3ecfc429adb49 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Mon, 15 Oct 2018 02:21:13 -0700 Subject: [PATCH] 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 Reviewed-by: Simon Glass --- board/emulation/qemu-riscv/Kconfig | 3 +++ board/emulation/qemu-riscv/qemu-riscv.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/board/emulation/qemu-riscv/Kconfig b/board/emulation/qemu-riscv/Kconfig index af23363fcf..5ae56da764 100644 --- a/board/emulation/qemu-riscv/Kconfig +++ b/board/emulation/qemu-riscv/Kconfig @@ -18,5 +18,8 @@ config SYS_TEXT_BASE config BOARD_SPECIFIC_OPTIONS # dummy def_bool y imply SYS_NS16550 + imply VIRTIO_MMIO + imply VIRTIO_NET + imply VIRTIO_BLK endif 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 +#include #include +#include +#include #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; } -- 2.39.5