summaryrefslogtreecommitdiffstats
path: root/hw/arm/armsse.c
diff options
context:
space:
mode:
authorPeter Maydell2021-02-19 15:46:01 +0100
committerPeter Maydell2021-03-08 18:20:02 +0100
commit9de4ddb49595670fcbf8da16c3a6bceb083c34ce (patch)
treeb387f74b31200e82f1f95220e715bec47f184ed2 /hw/arm/armsse.c
parenthw/arm/armsse: Move sysinfo register block into data-driven framework (diff)
downloadqemu-9de4ddb49595670fcbf8da16c3a6bceb083c34ce.tar.gz
qemu-9de4ddb49595670fcbf8da16c3a6bceb083c34ce.tar.xz
qemu-9de4ddb49595670fcbf8da16c3a6bceb083c34ce.zip
hw/arm/armsse: Move sysctl register block into data-driven framework
Move the sysctl register block into the data-driven device placement framework. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210219144617.4782-29-peter.maydell@linaro.org
Diffstat (limited to 'hw/arm/armsse.c')
-rw-r--r--hw/arm/armsse.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
index 91f30b1fdc..961b2d4413 100644
--- a/hw/arm/armsse.c
+++ b/hw/arm/armsse.c
@@ -166,6 +166,14 @@ static const ARMSSEDeviceInfo sse200_devices[] = {
.irq = NO_IRQ,
},
{
+ .name = "armsse-sysctl",
+ .type = TYPE_IOTKIT_SYSCTL,
+ .index = 0,
+ .addr = 0x50021000,
+ .ppc = NO_PPC,
+ .irq = NO_IRQ,
+ },
+ {
.name = NULL,
}
};
@@ -419,6 +427,10 @@ static void armsse_init(Object *obj)
assert(devinfo->index == 0);
object_initialize_child(obj, devinfo->name, &s->sysinfo,
TYPE_IOTKIT_SYSINFO);
+ } else if (!strcmp(devinfo->type, TYPE_IOTKIT_SYSCTL)) {
+ assert(devinfo->index == 0);
+ object_initialize_child(obj, devinfo->name, &s->sysctl,
+ TYPE_IOTKIT_SYSCTL);
} else {
g_assert_not_reached();
}
@@ -447,8 +459,6 @@ static void armsse_init(Object *obj)
g_free(name);
}
- object_initialize_child(obj, "armsse-sysctl", &s->sysctl,
- TYPE_IOTKIT_SYSCTL);
if (info->has_mhus) {
object_initialize_child(obj, "mhu0", &s->mhu[0], TYPE_ARMSSE_MHU);
object_initialize_child(obj, "mhu1", &s->mhu[1], TYPE_ARMSSE_MHU);
@@ -915,6 +925,22 @@ static void armsse_realize(DeviceState *dev, Error **errp)
return;
}
mr = sysbus_mmio_get_region(sbd, 0);
+ } else if (!strcmp(devinfo->type, TYPE_IOTKIT_SYSCTL)) {
+ /* System control registers */
+ sbd = SYS_BUS_DEVICE(&s->sysctl);
+
+ object_property_set_int(OBJECT(&s->sysctl), "sse-version",
+ info->sse_version, &error_abort);
+ object_property_set_int(OBJECT(&s->sysctl), "CPUWAIT_RST",
+ info->cpuwait_rst, &error_abort);
+ object_property_set_int(OBJECT(&s->sysctl), "INITSVTOR0_RST",
+ s->init_svtor, &error_abort);
+ object_property_set_int(OBJECT(&s->sysctl), "INITSVTOR1_RST",
+ s->init_svtor, &error_abort);
+ if (!sysbus_realize(sbd, errp)) {
+ return;
+ }
+ mr = sysbus_mmio_get_region(sbd, 0);
} else {
g_assert_not_reached();
}
@@ -1132,20 +1158,6 @@ static void armsse_realize(DeviceState *dev, Error **errp)
memory_region_add_subregion(&s->container, devinfo->addr, mr);
}
- /* System control registers */
- object_property_set_int(OBJECT(&s->sysctl), "sse-version",
- info->sse_version, &error_abort);
- object_property_set_int(OBJECT(&s->sysctl), "CPUWAIT_RST",
- info->cpuwait_rst, &error_abort);
- object_property_set_int(OBJECT(&s->sysctl), "INITSVTOR0_RST",
- s->init_svtor, &error_abort);
- object_property_set_int(OBJECT(&s->sysctl), "INITSVTOR1_RST",
- s->init_svtor, &error_abort);
- if (!sysbus_realize(SYS_BUS_DEVICE(&s->sysctl), errp)) {
- return;
- }
- sysbus_mmio_map(SYS_BUS_DEVICE(&s->sysctl), 0, 0x50021000);
-
if (info->has_ppus) {
/* CPUnCORE_PPU for each CPU */
for (i = 0; i < info->num_cpus; i++) {