aboutsummaryrefslogtreecommitdiffstats
path: root/board
diff options
context:
space:
mode:
authorBin Meng2018-10-15 04:21:13 -0500
committerSimon Glass2018-11-14 11:16:27 -0600
commit3c5196dca5a639cfe88aae3baad3ecfc429adb49 (patch)
tree58a1415ffe3b095843018581e09fa382d0ee20df /board
parent78e12901f3fc8d228bd050f35594e1994f6a7d35 (diff)
downloadu-boot-3c5196dca5a639cfe88aae3baad3ecfc429adb49.tar.gz
u-boot-3c5196dca5a639cfe88aae3baad3ecfc429adb49.tar.xz
u-boot-3c5196dca5a639cfe88aae3baad3ecfc429adb49.zip
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')
-rw-r--r--board/emulation/qemu-riscv/Kconfig3
-rw-r--r--board/emulation/qemu-riscv/qemu-riscv.c9
2 files changed, 12 insertions, 0 deletions
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
18config BOARD_SPECIFIC_OPTIONS # dummy 18config BOARD_SPECIFIC_OPTIONS # dummy
19 def_bool y 19 def_bool y
20 imply SYS_NS16550 20 imply SYS_NS16550
21 imply VIRTIO_MMIO
22 imply VIRTIO_NET
23 imply VIRTIO_BLK
21 24
22endif 25endif
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 @@
4 */ 4 */
5 5
6#include <common.h> 6#include <common.h>
7#include <dm.h>
7#include <fdtdec.h> 8#include <fdtdec.h>
9#include <virtio_types.h>
10#include <virtio.h>
8 11
9#define MROM_FDT_ADDR 0x1020 12#define MROM_FDT_ADDR 0x1020
10 13
11int board_init(void) 14int board_init(void)
12{ 15{
16 /*
17 * Make sure virtio bus is enumerated so that peripherals
18 * on the virtio bus can be discovered by their drivers
19 */
20 virtio_init();
21
13 return 0; 22 return 0;
14} 23}
15 24