@@ -812,7 +812,10 @@ static void create_rtc(const VirtMachineState *vms)
static void create_xhci(const VirtMachineState *vms)
{
hwaddr base = base_memmap[VIRT_XHCI].base;
+ hwaddr size = base_memmap[VIRT_XHCI].size;
int irq = vms->irqmap[VIRT_XHCI];
+ const char compat[] = "generic-xhci";
+ char *nodename;
DeviceState *dev;
dev = qdev_new(TYPE_XHCI_SYSBUS);
@@ -823,6 +826,16 @@ static void create_xhci(const VirtMachineState *vms)
sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, qdev_get_gpio_in(vms->gic, irq));
+
+ nodename = g_strdup_printf("/usb@%" PRIx64, base);
+ qemu_fdt_add_subnode(vms->fdt, nodename);
+ qemu_fdt_setprop(vms->fdt, nodename, "compatible", compat, sizeof(compat));
+ qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg",
+ 2, base, 2, size);
+ qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts",
+ GIC_FDT_IRQ_TYPE_SPI, irq,
+ GIC_FDT_IRQ_FLAGS_LEVEL_HI);
+ g_free(nodename);
}
static DeviceState *gpio_key_dev;
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> --- hw/arm/virt.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)