aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/a9scu.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/misc/a9scu.c')
-rw-r--r--hw/misc/a9scu.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/hw/misc/a9scu.c b/hw/misc/a9scu.c
index 601b5733f2..4434945908 100644
--- a/hw/misc/a9scu.c
+++ b/hw/misc/a9scu.c
@@ -8,20 +8,7 @@
* This code is licensed under the GPL.
*/
-#include "hw/sysbus.h"
-
-/* A9MP private memory region. */
-
-typedef struct A9SCUState {
- SysBusDevice busdev;
- MemoryRegion iomem;
- uint32_t control;
- uint32_t status;
- uint32_t num_cpu;
-} A9SCUState;
-
-#define TYPE_A9_SCU "a9-scu"
-#define A9_SCU(obj) OBJECT_CHECK(A9SCUState, (obj), TYPE_A9_SCU)
+#include "hw/misc/a9scu.h"
static uint64_t a9_scu_read(void *opaque, hwaddr offset,
unsigned size)
@@ -114,12 +101,12 @@ static void a9_scu_reset(DeviceState *dev)
s->control = 0;
}
-static void a9_scu_realize(DeviceState *dev, Error ** errp)
+static void a9_scu_init(Object *obj)
{
- A9SCUState *s = A9_SCU(dev);
- SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
+ A9SCUState *s = A9_SCU(obj);
+ SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
- memory_region_init_io(&s->iomem, OBJECT(dev), &a9_scu_ops, s,
+ memory_region_init_io(&s->iomem, obj, &a9_scu_ops, s,
"a9-scu", 0x100);
sysbus_init_mmio(sbd, &s->iomem);
}
@@ -144,7 +131,6 @@ static void a9_scu_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
- dc->realize = a9_scu_realize;
dc->props = a9_scu_properties;
dc->vmsd = &vmstate_a9_scu;
dc->reset = a9_scu_reset;
@@ -154,6 +140,7 @@ static const TypeInfo a9_scu_info = {
.name = TYPE_A9_SCU,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(A9SCUState),
+ .instance_init = a9_scu_init,
.class_init = a9_scu_class_init,
};