diff options
author | Łukasz Stelmach <l.stelmach@samsung.com> | 2024-03-28 10:58:24 +0100 |
---|---|---|
committer | Leo Yu-Chi Liang <ycliang@andestech.com> | 2024-04-09 11:30:24 +0800 |
commit | c532ddded9093df585dd324c68932053b6241abf (patch) | |
tree | 5126c2c745b49a547b01d8bc7887e049469a6892 | |
parent | f39b1b77d822916498f4dc9b9f50fe740df9afb6 (diff) | |
download | u-boot-c532ddded9093df585dd324c68932053b6241abf.tar.gz |
riscv: Move virtio scan to board_late_init()
When virtio_init() gets called from board_init() PCI isn't ready. Thus,
virtio-over-PCI (e.g. network interfaces) devices can't be detected and
used without additional `virtio scan` scan in the shell or a script.
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
-rw-r--r-- | arch/riscv/Kconfig | 1 | ||||
-rw-r--r-- | board/emulation/qemu-riscv/qemu-riscv.c | 12 |
2 files changed, 7 insertions, 6 deletions
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index d70c7e3a5a8..7e20ef63bba 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -22,6 +22,7 @@ config TARGET_OPENPITON_RISCV64 config TARGET_QEMU_VIRT bool "Support QEMU Virt Board" + select BOARD_LATE_INIT config TARGET_SIFIVE_UNLEASHED bool "Support SiFive Unleashed Board" diff --git a/board/emulation/qemu-riscv/qemu-riscv.c b/board/emulation/qemu-riscv/qemu-riscv.c index 181abbbf97d..173245b40e3 100644 --- a/board/emulation/qemu-riscv/qemu-riscv.c +++ b/board/emulation/qemu-riscv/qemu-riscv.c @@ -31,12 +31,6 @@ int is_flash_available(void) 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; } @@ -46,6 +40,12 @@ int board_late_init(void) if (CONFIG_IS_ENABLED(USB_KEYBOARD)) usb_init(); + /* + * Make sure virtio bus is enumerated so that peripherals + * on the virtio bus can be discovered by their drivers + */ + virtio_init(); + return 0; } |