Skip to content

Commit

Permalink
hw/arm: versal: Embed the UARTs into the SoC type
Browse files Browse the repository at this point in the history
Embed the UARTs 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-5-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
edgarigl authored and pm215 committed May 4, 2020
1 parent 0b79d1b commit 88052ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions hw/arm/xlnx-versal.c
Expand Up @@ -21,7 +21,6 @@
#include "kvm_arm.h"
#include "hw/misc/unimp.h"
#include "hw/arm/xlnx-versal.h"
#include "hw/char/pl011.h"

#define XLNX_VERSAL_ACPU_TYPE ARM_CPU_TYPE_NAME("cortex-a72")
#define GEM_REVISION 0x40070106
Expand Down Expand Up @@ -144,16 +143,17 @@ static void versal_create_uarts(Versal *s, qemu_irq *pic)
DeviceState *dev;
MemoryRegion *mr;

dev = qdev_create(NULL, TYPE_PL011);
s->lpd.iou.uart[i] = SYS_BUS_DEVICE(dev);
sysbus_init_child_obj(OBJECT(s), name,
&s->lpd.iou.uart[i], sizeof(s->lpd.iou.uart[i]),
TYPE_PL011);
dev = DEVICE(&s->lpd.iou.uart[i]);
qdev_prop_set_chr(dev, "chardev", serial_hd(i));
object_property_add_child(OBJECT(s), name, OBJECT(dev), &error_fatal);
qdev_init_nofail(dev);

mr = sysbus_mmio_get_region(s->lpd.iou.uart[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.uart[i], 0, pic[irqs[i]]);
sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[irqs[i]]);
g_free(name);
}
}
Expand Down
3 changes: 2 additions & 1 deletion include/hw/arm/xlnx-versal.h
Expand Up @@ -15,6 +15,7 @@
#include "hw/sysbus.h"
#include "hw/arm/boot.h"
#include "hw/intc/arm_gicv3.h"
#include "hw/char/pl011.h"

#define TYPE_XLNX_VERSAL "xlnx-versal"
#define XLNX_VERSAL(obj) OBJECT_CHECK(Versal, (obj), TYPE_XLNX_VERSAL)
Expand Down Expand Up @@ -49,7 +50,7 @@ typedef struct Versal {
MemoryRegion mr_ocm;

struct {
SysBusDevice *uart[XLNX_VERSAL_NR_UARTS];
PL011State uart[XLNX_VERSAL_NR_UARTS];
SysBusDevice *gem[XLNX_VERSAL_NR_GEMS];
SysBusDevice *adma[XLNX_VERSAL_NR_ADMAS];
} iou;
Expand Down

0 comments on commit 88052ff

Please sign in to comment.