| 1 | |
| 2 | * ARM timer implementation, found in Integrator, Versatile and Realview
|
| 3 | * platforms. Not all platforms support all registers and bits in these
|
| 4 | * registers, so we mark them with A for Integrator AP, C for Integrator
|
| 5 | * CP, V for Versatile and R for Realview.
|
| 6 | *
|
| 7 | * Integrator AP has 16-bit timers, Integrator CP, Versatile and Realview
|
| 8 | * can have 16-bit or 32-bit selectable via a bit in the control register.
|
| 9 | *
|
| 10 | * Every SP804 contains two identical timers.
|
| 11 |
|
| 12 | #define TIMER_1_BASE 0x00
|
| 13 | #define TIMER_2_BASE 0x20
|
| 14 |
|
| 15 | #define TIMER_LOAD 0x00
|
| 16 | #define TIMER_VALUE 0x04
|
| 17 | #define TIMER_CTRL 0x08
|
| 18 | #define TIMER_CTRL_ONESHOT (1 << 0)
|
| 19 | #define TIMER_CTRL_32BIT (1 << 1)
|
| 20 | #define TIMER_CTRL_DIV1 (0 << 2)
|
| 21 | #define TIMER_CTRL_DIV16 (1 << 2)
|
| 22 | #define TIMER_CTRL_DIV256 (2 << 2)
|
| 23 | #define TIMER_CTRL_IE (1 << 5)
|
| 24 | #define TIMER_CTRL_PERIODIC (1 << 6)
|
| 25 | #define TIMER_CTRL_ENABLE (1 << 7)
|
| 26 |
|
| 27 | #define TIMER_INTCLR 0x0c
|
| 28 | #define TIMER_RIS 0x10
|
| 29 | #define TIMER_MIS 0x14
|
| 30 | #define TIMER_BGLOAD 0x18
|