From: Łukasz Stelmach Date: Mon, 19 Feb 2024 12:21:37 +0000 (+0100) Subject: riscv: Move virtio scan to board_late_init() X-Git-Tag: accepted/tizen/unified/x/20240403.102935 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Faccepted%2Ftizen%2Funified%2Fx%2F20240403.102935;p=platform%2Fkernel%2Fu-boot.git 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. Change-Id: I446c473c2c41be8b59842dce09593a47d9a42d73 Signed-off-by: Łukasz Stelmach Forwarded: https://lore.kernel.org/u-boot/20240328095824.1179072-1-l.stelmach@samsung.com/ --- diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 1c62c23..1a39cb4 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -16,6 +16,7 @@ config TARGET_MICROCHIP_ICICLE 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 181abbb..173245b 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; }