[PATCH] qemu: arm: Scan the pci bus in board_init

Heinrich Schuchardt xypron.glpk at gmx.de
Tue Dec 31 16:08:12 CET 2019


On 12/31/19 2:31 PM, Sughosh Ganu wrote:
> Scan the pci bus in board_init routine before scanning the virtio
> devices. This enumerates all the virtio devices, including devices
> found on the pci bus.
>
> Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
> ---
>  board/emulation/qemu-arm/qemu-arm.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c
> index 4e18733..6c5335c 100644
> --- a/board/emulation/qemu-arm/qemu-arm.c
> +++ b/board/emulation/qemu-arm/qemu-arm.c
> @@ -63,6 +63,13 @@ struct mm_region *mem_map = qemu_arm64_mem_map;
>  int board_init(void)
>  {
>  	/*
> +	 * Scan the pci bus before calling virtio_init. This
> +	 * enumerates all virtio devices, including devices
> +	 * on the pci bus.

The last sentence is easy to misunderstand. You surely do not mean that
pci_init() would enumerate all virtio devices including mmio virtio devices.

I would suggest to rephrase it to "This enumerates all pci devices
including virtio devices on the pci bus."

With the patch I no longer need to run `virtio scan` on
qemu_arm64_defonfig before using the rng command supplied in patch

[PATCH 1/1] cmd: add rng command
https://lists.denx.de/pipermail/u-boot/2019-December/394539.html

Unfortunately you only considered the ARM architecture. We need a
solution that works on all QEMU architectures (MIPS, RISC-V, X86, ARM).

How about eliminating board_init() for ARM and RISC-V and moving
virtio_init() to common/board_r.c after initr_pci?

Best regards

Heinrich

> +	 */
> +	pci_init();
> +
> +	/*
>  	 * Make sure virtio bus is enumerated so that peripherals
>  	 * on the virtio bus can be discovered by their drivers
>  	 */
>



More information about the U-Boot mailing list