Add virtio-mmio bus support for LoongArch, so that devices could be added in the virtio-mmio bus.
Signed-off-by: Tianrui Zhao <[email protected]> --- hw/loongarch/Kconfig | 1 + hw/loongarch/virt.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/hw/loongarch/Kconfig b/hw/loongarch/Kconfig index 1e7c5b43c5..01ab8ce8e7 100644 --- a/hw/loongarch/Kconfig +++ b/hw/loongarch/Kconfig @@ -22,3 +22,4 @@ config LOONGARCH_VIRT select DIMM select PFLASH_CFI01 select ACPI_HMAT + select VIRTIO_MMIO diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 2629128aed..06f4bc3a5e 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -560,6 +560,9 @@ static void loongarch_devices_init(DeviceState *pch_pic, LoongArchMachineState * VIRT_RTC_IRQ - VIRT_GSI_BASE)); fdt_add_rtc_node(lams); + /* virtio-mmio device */ + sysbus_create_simple("virtio-mmio", 0x1e200000, qdev_get_gpio_in(pch_pic, 7)); + pm_mem = g_new(MemoryRegion, 1); memory_region_init_io(pm_mem, NULL, &loongarch_virt_pm_ops, NULL, "loongarch_virt_pm", PM_SIZE); -- 2.39.1
