diff options
Diffstat (limited to 'hw/arm_sysctl.c')
-rw-r--r-- | hw/arm_sysctl.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c index c9d1e3ff15..bb005c8015 100644 --- a/hw/arm_sysctl.c +++ b/hw/arm_sysctl.c @@ -194,7 +194,6 @@ static void arm_sysctl_init1(SysBusDevice *dev) arm_sysctl_state *s = FROM_SYSBUS(arm_sysctl_state, dev); int iomemtype; - s->sys_id = qdev_get_prop_int(&dev->qdev, "sys_id", 0); /* The MPcore bootloader uses these flags to start secondary CPUs. We don't use a bootloader, so do this here. */ s->flags = 3; @@ -210,15 +209,28 @@ void arm_sysctl_init(uint32_t base, uint32_t sys_id) DeviceState *dev; dev = qdev_create(NULL, "realview_sysctl"); - qdev_set_prop_int(dev, "sys_id", sys_id); + qdev_prop_set_uint32(dev, "sys_id", sys_id); qdev_init(dev); sysbus_mmio_map(sysbus_from_qdev(dev), 0, base); } +static SysBusDeviceInfo arm_sysctl_info = { + .init = arm_sysctl_init1, + .qdev.name = "realview_sysctl", + .qdev.size = sizeof(arm_sysctl_state), + .qdev.props = (Property[]) { + { + .name = "sys_id", + .info = &qdev_prop_uint32, + .offset = offsetof(arm_sysctl_state, sys_id), + }, + {/* end of list */} + } +}; + static void arm_sysctl_register_devices(void) { - sysbus_register_dev("realview_sysctl", sizeof(arm_sysctl_state), - arm_sysctl_init1); + sysbus_register_withprop(&arm_sysctl_info); } device_init(arm_sysctl_register_devices) |