22 #include <linux/kernel.h>
33 #include <mach/addr-map.h>
36 #include <mach/irqs.h>
37 #include <mach/cputype.h>
42 #define TIMERS_VIRT_BASE TIMERS1_VIRT_BASE
44 #define MAX_DELTA (0xfffffffe)
45 #define MIN_DELTA (16)
52 static inline uint32_t timer_read(
void)
71 struct clock_event_device *
c =
dev_id;
88 static int timer_set_next_event(
unsigned long delta,
89 struct clock_event_device *
dev)
121 static void timer_set_mode(
enum clock_event_mode
mode,
122 struct clock_event_device *dev)
128 case CLOCK_EVT_MODE_ONESHOT:
129 case CLOCK_EVT_MODE_UNUSED:
130 case CLOCK_EVT_MODE_SHUTDOWN:
134 case CLOCK_EVT_MODE_RESUME:
135 case CLOCK_EVT_MODE_PERIODIC:
141 static struct clock_event_device ckevt = {
142 .name =
"clockevent",
143 .features = CLOCK_EVT_FEAT_ONESHOT,
146 .set_next_event = timer_set_next_event,
147 .set_mode = timer_set_mode,
156 .name =
"clocksource",
163 static void __init timer_config(
void)
235 if (!mmp_timer_base) {
242 pr_err(
"Failed to get timer from device tree with error:%d\n", ret);