From 0701fee2853375d125b3ab16c2326e1b92803a05 Mon Sep 17 00:00:00 2001 From: Yanfeng Liu Date: Wed, 24 Jul 2024 15:10:30 +0800 Subject: [PATCH] riscv/virt: probe virtio earlier This allows virtio devices to be probed upon board_early_init, thus allowing virito-serial being ready earlier for console uses. Signed-off-by: Yanfeng Liu --- boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_appinit.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_appinit.c b/boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_appinit.c index fb3292a84a2a9..8b4baf621cd97 100644 --- a/boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_appinit.c +++ b/boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_appinit.c @@ -131,7 +131,9 @@ int board_app_initialize(uintptr_t arg) #endif #ifdef CONFIG_DRIVERS_VIRTIO_MMIO +#ifndef CONFIG_BOARD_EARLY_INITIALIZE qemu_virtio_register_mmio_devices(); +#endif #endif return OK; @@ -183,6 +185,13 @@ void board_late_initialize(void) #endif } +void board_early_initialize(void) +{ +#ifdef CONFIG_DRIVERS_VIRTIO_MMIO + qemu_virtio_register_mmio_devices(); +#endif +} + #ifdef CONFIG_BOARDCTL_POWEROFF int board_power_off(int status) {