[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/39] hw/arm: versal: Embed the UARTs into the SoC type
From: |
Peter Maydell |
Subject: |
[PULL 12/39] hw/arm: versal: Embed the UARTs into the SoC type |
Date: |
Mon, 4 May 2020 13:32:42 +0100 |
From: "Edgar E. Iglesias" <address@hidden>
Embed the UARTs into the SoC type.
Suggested-by: Peter Maydell <address@hidden>
Signed-off-by: Edgar E. Iglesias <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Luc Michel <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>
---
include/hw/arm/xlnx-versal.h | 3 ++-
hw/arm/xlnx-versal.c | 12 ++++++------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h
index 6c0a692b2fd..a3dfd064b3c 100644
--- a/include/hw/arm/xlnx-versal.h
+++ b/include/hw/arm/xlnx-versal.h
@@ -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)
@@ -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;
diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c
index cc696e44c06..dbde03b7e69 100644
--- a/hw/arm/xlnx-versal.c
+++ b/hw/arm/xlnx-versal.c
@@ -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
@@ -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);
}
}
--
2.20.1
- [PULL 02/39] hw/arm/mps2-tz: Use TYPE_IOTKIT instead of hardcoded string, (continued)
- [PULL 02/39] hw/arm/mps2-tz: Use TYPE_IOTKIT instead of hardcoded string, Peter Maydell, 2020/05/04
- [PULL 05/39] target/arm: Add new 's1_is_el0' argument to get_phys_addr_lpae(), Peter Maydell, 2020/05/04
- [PULL 06/39] target/arm: Implement ARMv8.2-TTS2UXN, Peter Maydell, 2020/05/04
- [PULL 03/39] target/arm: Don't use a TLB for ARMMMUIdx_Stage2, Peter Maydell, 2020/05/04
- [PULL 04/39] target/arm: Use enum constant in get_phys_addr_lpae() call, Peter Maydell, 2020/05/04
- [PULL 08/39] target/arm: Use uint64_t for midr field in CPU state struct, Peter Maydell, 2020/05/04
- [PULL 07/39] target/arm: Use correct variable for setting 'max' cpu's ID_AA64DFR0, Peter Maydell, 2020/05/04
- [PULL 11/39] hw/arm: versal-virt: Fix typo xlnx-ve -> xlnx-versal, Peter Maydell, 2020/05/04
- [PULL 09/39] hw/arm: versal: Remove inclusion of arm_gicv3_common.h, Peter Maydell, 2020/05/04
- [PULL 10/39] hw/arm: versal: Move misplaced comment, Peter Maydell, 2020/05/04
- [PULL 12/39] hw/arm: versal: Embed the UARTs into the SoC type,
Peter Maydell <=
- [PULL 13/39] hw/arm: versal: Embed the GEMs into the SoC type, Peter Maydell, 2020/05/04
- [PULL 14/39] hw/arm: versal: Embed the ADMAs into the SoC type, Peter Maydell, 2020/05/04
- [PULL 15/39] hw/arm: versal: Embed the APUs into the SoC type, Peter Maydell, 2020/05/04
- [PULL 16/39] hw/arm: versal: Add support for SD, Peter Maydell, 2020/05/04
- [PULL 17/39] hw/arm: versal: Add support for the RTC, Peter Maydell, 2020/05/04
- [PULL 19/39] hw/arm: versal-virt: Add support for the RTC, Peter Maydell, 2020/05/04
- [PULL 18/39] hw/arm: versal-virt: Add support for SD, Peter Maydell, 2020/05/04
- [PULL 20/39] target/arm/translate-vfp.inc.c: Remove duplicate simd_r32 check, Peter Maydell, 2020/05/04
- [PULL 22/39] target/arm: Add stubs for AArch32 Neon decodetree, Peter Maydell, 2020/05/04
- [PULL 21/39] target/arm: Don't allow Thumb Neon insns without FEATURE_NEON, Peter Maydell, 2020/05/04