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>
This commit is contained in:
Bin Meng 2018-10-15 02:21:13 -07:00 committed by Simon Glass
parent 78e12901f3
commit 3c5196dca5
2 changed files with 12 additions and 0 deletions

View File

@ -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

View File

@ -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;
}