diff options
author | Edgar E. Iglesias <edgar.iglesias@xilinx.com> | 2020-04-27 20:16:43 +0200 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2020-05-04 11:11:06 +0100 |
commit | 4bd9b59c05bda9c5a8df84ea63292a9471120b02 (patch) | |
tree | 9e7e3eba1bb1bc1d14bf0e2e234499d289fe88d0 /hw | |
parent | 88052ffdd1df6cfe8160662fd4a8cc69f7be63bc (diff) | |
download | qemu-4bd9b59c05bda9c5a8df84ea63292a9471120b02.zip qemu-4bd9b59c05bda9c5a8df84ea63292a9471120b02.tar.gz qemu-4bd9b59c05bda9c5a8df84ea63292a9471120b02.tar.bz2 |
hw/arm: versal: Embed the GEMs into the SoC type
Embed the GEMs into the SoC type.
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Luc Michel <luc.michel@greensocs.com>
Message-id: 20200427181649.26851-6-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/arm/xlnx-versal.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c index dbde03b..e424aa7 100644 --- a/hw/arm/xlnx-versal.c +++ b/hw/arm/xlnx-versal.c @@ -170,25 +170,26 @@ static void versal_create_gems(Versal *s, qemu_irq *pic) DeviceState *dev; MemoryRegion *mr; - dev = qdev_create(NULL, "cadence_gem"); - s->lpd.iou.gem[i] = SYS_BUS_DEVICE(dev); - object_property_add_child(OBJECT(s), name, OBJECT(dev), &error_fatal); + sysbus_init_child_obj(OBJECT(s), name, + &s->lpd.iou.gem[i], sizeof(s->lpd.iou.gem[i]), + TYPE_CADENCE_GEM); + dev = DEVICE(&s->lpd.iou.gem[i]); if (nd->used) { qemu_check_nic_model(nd, "cadence_gem"); qdev_set_nic_properties(dev, nd); } - object_property_set_int(OBJECT(s->lpd.iou.gem[i]), + object_property_set_int(OBJECT(dev), 2, "num-priority-queues", &error_abort); - object_property_set_link(OBJECT(s->lpd.iou.gem[i]), + object_property_set_link(OBJECT(dev), OBJECT(&s->mr_ps), "dma", &error_abort); qdev_init_nofail(dev); - mr = sysbus_mmio_get_region(s->lpd.iou.gem[i], 0); + mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0); memory_region_add_subregion(&s->mr_ps, addrs[i], mr); - sysbus_connect_irq(s->lpd.iou.gem[i], 0, pic[irqs[i]]); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[irqs[i]]); g_free(name); } } |