xref: /qemu/include/hw/rtc/pl031.h (revision b0de99f3e9bc7a0cacbff0ff8517379d915dd5f6)
1 /*
2  * ARM AMBA PrimeCell PL031 RTC
3  *
4  * Copyright (c) 2007 CodeSourcery
5  *
6  * This file is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * Contributions after 2012-01-13 are licensed under the terms of the
11  * GNU GPL, version 2 or (at your option) any later version.
12  */
13 
14 #ifndef HW_TIMER_PL031
15 #define HW_TIMER_PL031
16 
17 #include "hw/sysbus.h"
18 
19 #define TYPE_PL031 "pl031"
20 #define PL031(obj) OBJECT_CHECK(PL031State, (obj), TYPE_PL031)
21 
22 typedef struct PL031State {
23     SysBusDevice parent_obj;
24 
25     MemoryRegion iomem;
26     QEMUTimer *timer;
27     qemu_irq irq;
28 
29     /*
30      * Needed to preserve the tick_count across migration, even if the
31      * absolute value of the rtc_clock is different on the source and
32      * destination.
33      */
34     uint32_t tick_offset_vmstate;
35     uint32_t tick_offset;
36 
37     uint32_t mr;
38     uint32_t lr;
39     uint32_t cr;
40     uint32_t im;
41     uint32_t is;
42 } PL031State;
43 
44 #endif
45