qemu: arm: Initialise virtio devices in board_late_init
authorSughosh Ganu <sughosh.ganu@linaro.org>
Wed, 30 Dec 2020 13:57:00 +0000 (19:27 +0530)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 31 Dec 2020 13:41:31 +0000 (14:41 +0100)
On the qemu arm platform, the virtio devices are initialised in the
board_init function, which gets called before the initr_pci. With
this sequence, the virtio block devices on the pci bus are not
initialised. Move the initialisation of the virtio devices to
board_late_init which gets called after the call to initr_pci.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
arch/arm/mach-qemu/Kconfig
board/emulation/qemu-arm/qemu-arm.c

index 588d2d3102ae4030770b2dec67e706351c1bbfa3..186c3582ebfaeabb1e4a475796de5fd178ea2183 100644 (file)
@@ -16,12 +16,14 @@ choice
 config TARGET_QEMU_ARM_32BIT
        bool "ARMv7-A, 32bit"
        select ARCH_SUPPORT_PSCI
+       select BOARD_LATE_INIT
        select CPU_V7A
        select SYS_ARCH_TIMER
 
 config TARGET_QEMU_ARM_64BIT
        bool "ARMv8, 64bit"
        select ARM64
+       select BOARD_LATE_INIT
 
 endchoice
 
index f18f2ed7da3a1b5fef92861349fbf9f1b0dee832..aa68bef469a66ac1e738c1ce0145287ae1681a3b 100644 (file)
@@ -64,6 +64,11 @@ struct mm_region *mem_map = qemu_arm64_mem_map;
 #endif
 
 int board_init(void)
+{
+       return 0;
+}
+
+int board_late_init(void)
 {
        /*
         * Make sure virtio bus is enumerated so that peripherals