Revision 4e002105 hw/arm/strongarm.c
b/hw/arm/strongarm.c | ||
---|---|---|
242 | 242 |
* trim delete isn't emulated, so |
243 | 243 |
* f = 32 768 / (RTTR_trim + 1) */ |
244 | 244 |
|
245 |
typedef struct { |
|
246 |
SysBusDevice busdev; |
|
245 |
#define TYPE_STRONGARM_RTC "strongarm-rtc" |
|
246 |
#define STRONGARM_RTC(obj) \ |
|
247 |
OBJECT_CHECK(StrongARMRTCState, (obj), TYPE_STRONGARM_RTC) |
|
248 |
|
|
249 |
typedef struct StrongARMRTCState { |
|
250 |
SysBusDevice parent_obj; |
|
251 |
|
|
247 | 252 |
MemoryRegion iomem; |
248 | 253 |
uint32_t rttr; |
249 | 254 |
uint32_t rtsr; |
... | ... | |
374 | 379 |
|
375 | 380 |
static int strongarm_rtc_init(SysBusDevice *dev) |
376 | 381 |
{ |
377 |
StrongARMRTCState *s = FROM_SYSBUS(StrongARMRTCState, dev);
|
|
382 |
StrongARMRTCState *s = STRONGARM_RTC(dev);
|
|
378 | 383 |
struct tm tm; |
379 | 384 |
|
380 | 385 |
s->rttr = 0x0; |
... | ... | |
443 | 448 |
} |
444 | 449 |
|
445 | 450 |
static const TypeInfo strongarm_rtc_sysbus_info = { |
446 |
.name = "strongarm-rtc",
|
|
451 |
.name = TYPE_STRONGARM_RTC,
|
|
447 | 452 |
.parent = TYPE_SYS_BUS_DEVICE, |
448 | 453 |
.instance_size = sizeof(StrongARMRTCState), |
449 | 454 |
.class_init = strongarm_rtc_sysbus_class_init, |
... | ... | |
1599 | 1604 |
qdev_get_gpio_in(s->pic, SA_PIC_OSTC3), |
1600 | 1605 |
NULL); |
1601 | 1606 |
|
1602 |
sysbus_create_simple("strongarm-rtc", 0x90010000,
|
|
1607 |
sysbus_create_simple(TYPE_STRONGARM_RTC, 0x90010000,
|
|
1603 | 1608 |
qdev_get_gpio_in(s->pic, SA_PIC_RTC_ALARM)); |
1604 | 1609 |
|
1605 | 1610 |
s->gpio = strongarm_gpio_init(0x90040000, s->pic); |
Also available in: Unified diff