aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBin Meng2018-10-15 04:21:19 -0500
committerSimon Glass2018-11-14 11:16:28 -0600
commitb9b5956eb08a0ab12702b3bb9304e8157c595442 (patch)
tree731ad6622cb835ce2bd79062f5228858ff88774b
parent6f3327658b03f448c324ac54aad1bd6cc2c2e50d (diff)
downloadu-boot-b9b5956eb08a0ab12702b3bb9304e8157c595442.tar.gz
u-boot-b9b5956eb08a0ab12702b3bb9304e8157c595442.tar.xz
u-boot-b9b5956eb08a0ab12702b3bb9304e8157c595442.zip
arm: qemu: Enumerate virtio bus during early boot
Currently devices on the virtio bus is not automatically enumerated, which means peripherals on the virtio bus are not discovered by their drivers. This uses board_init() to do the virtio enumeration. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--board/emulation/qemu-arm/Kconfig4
-rw-r--r--board/emulation/qemu-arm/qemu-arm.c10
2 files changed, 14 insertions, 0 deletions
diff --git a/board/emulation/qemu-arm/Kconfig b/board/emulation/qemu-arm/Kconfig
index d1c08c2f6a..02ae4d9884 100644
--- a/board/emulation/qemu-arm/Kconfig
+++ b/board/emulation/qemu-arm/Kconfig
@@ -5,5 +5,9 @@ config SYS_TEXT_BASE
5 5
6config BOARD_SPECIFIC_OPTIONS # dummy 6config BOARD_SPECIFIC_OPTIONS # dummy
7 def_bool y 7 def_bool y
8 imply VIRTIO_MMIO
9 imply VIRTIO_PCI
10 imply VIRTIO_NET
11 imply VIRTIO_BLK
8 12
9endif 13endif
diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c
index 812c90636d..e1f4709c4c 100644
--- a/board/emulation/qemu-arm/qemu-arm.c
+++ b/board/emulation/qemu-arm/qemu-arm.c
@@ -2,8 +2,12 @@
2/* 2/*
3 * Copyright (c) 2017 Tuomas Tynkkynen 3 * Copyright (c) 2017 Tuomas Tynkkynen
4 */ 4 */
5
5#include <common.h> 6#include <common.h>
7#include <dm.h>
6#include <fdtdec.h> 8#include <fdtdec.h>
9#include <virtio_types.h>
10#include <virtio.h>
7 11
8#ifdef CONFIG_ARM64 12#ifdef CONFIG_ARM64
9#include <asm/armv8/mmu.h> 13#include <asm/armv8/mmu.h>
@@ -58,6 +62,12 @@ struct mm_region *mem_map = qemu_arm64_mem_map;
58 62
59int board_init(void) 63int board_init(void)
60{ 64{
65 /*
66 * Make sure virtio bus is enumerated so that peripherals
67 * on the virtio bus can be discovered by their drivers
68 */
69 virtio_init();
70
61 return 0; 71 return 0;
62} 72}
63 73