在 2023/9/11 下午4:59, Tianrui Zhao 写道:
+static void fdt_add_virtio_mmio_node(LoongArchMachineState *lams) +{ + int i; + MachineState *ms = MACHINE(lams); + + for (i = VIRT_VIRTIO_MMIO_NUM - 1; i >= 0; i--) { + char *nodename; + hwaddr base = VIRT_VIRTIO_MMIO_BASE + i * VIRT_VIRTIO_MMIO_SIZE; + + nodename = g_strdup_printf("/virtio_mmio@%" PRIx64, base); + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, + "compatible", "virtio,mmio"); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", + 2, base, 2, VIRT_VIRTIO_MMIO_SIZE);
Missing node interrupts.
Thanks. Song Gao
+ g_free(nodename); + } +}