[PATCH v2 02/14] qemu: arm: Initialise virtio in board_late_init

Sughosh Ganu sughosh.ganu at linaro.org
Mon Dec 21 12:43:02 CET 2020


On the qemu arm platform, the virtio devices are initialised in
board_init, which gets called before the initr_pci. With this, the
virtio block devices on the pci bus are not initialised. Move the
initialisation of virtio devices to board_late_init which gets called
after the call to initr_pci.

Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
---

Changes since V1:
* The earlier patch was adding a call to pci_init in board_init. Moved
  the virtio_init call to board_late_init

 board/emulation/qemu-arm/qemu-arm.c | 5 +++++
 configs/qemu_arm64_defconfig        | 1 +
 2 files changed, 6 insertions(+)

diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c
index f18f2ed7da..aa68bef469 100644
--- a/board/emulation/qemu-arm/qemu-arm.c
+++ b/board/emulation/qemu-arm/qemu-arm.c
@@ -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
diff --git a/configs/qemu_arm64_defconfig b/configs/qemu_arm64_defconfig
index f6e586627a..5c855fa08c 100644
--- a/configs/qemu_arm64_defconfig
+++ b/configs/qemu_arm64_defconfig
@@ -14,6 +14,7 @@ CONFIG_LEGACY_IMAGE_FORMAT=y
 CONFIG_USE_PREBOOT=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_PCI_INIT_R=y
 CONFIG_CMD_BOOTEFI_SELFTEST=y
 CONFIG_CMD_NVEDIT_EFI=y
-- 
2.17.1



More information about the U-Boot mailing list