]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
riscv: Move virtio scan to board_late_init()
authorŁukasz Stelmach <l.stelmach@samsung.com>
Thu, 28 Mar 2024 09:58:24 +0000 (10:58 +0100)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Tue, 9 Apr 2024 03:30:24 +0000 (11:30 +0800)
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>
arch/riscv/Kconfig
board/emulation/qemu-riscv/qemu-riscv.c

index d70c7e3a5a88373fc7a98c7bb6ac3be511a23a0e..7e20ef63bba016b2f7c3a7b14aff0c5ea1b4b1a4 100644 (file)
@@ -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"
index 181abbbf97d845da2eba212f1039f4ff3c2c3f3c..173245b40e3ca0167cd55545d3c71dfd6a1d2023 100644 (file)
@@ -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;
 }