diff options
Diffstat (limited to 'arch/arm/common')
-rw-r--r-- | arch/arm/common/timer-sp.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c index ded926f7c4e8..ddc740769601 100644 --- a/arch/arm/common/timer-sp.c +++ b/arch/arm/common/timer-sp.c | |||
@@ -31,6 +31,7 @@ | |||
31 | 31 | ||
32 | #include <asm/sched_clock.h> | 32 | #include <asm/sched_clock.h> |
33 | #include <asm/hardware/arm_timer.h> | 33 | #include <asm/hardware/arm_timer.h> |
34 | #include <asm/hardware/timer-sp.h> | ||
34 | 35 | ||
35 | static long __init sp804_get_clock_rate(struct clk *clk) | 36 | static long __init sp804_get_clock_rate(struct clk *clk) |
36 | { | 37 | { |
@@ -262,3 +263,37 @@ err: | |||
262 | iounmap(base); | 263 | iounmap(base); |
263 | } | 264 | } |
264 | CLOCKSOURCE_OF_DECLARE(sp804, "arm,sp804", sp804_of_init); | 265 | CLOCKSOURCE_OF_DECLARE(sp804, "arm,sp804", sp804_of_init); |
266 | |||
267 | static void __init integrator_cp_of_init(struct device_node *np) | ||
268 | { | ||
269 | static int init_count = 0; | ||
270 | void __iomem *base; | ||
271 | int irq; | ||
272 | const char *name = of_get_property(np, "compatible", NULL); | ||
273 | |||
274 | base = of_iomap(np, 0); | ||
275 | if (WARN_ON(!base)) | ||
276 | return; | ||
277 | |||
278 | /* Ensure timer is disabled */ | ||
279 | writel(0, base + TIMER_CTRL); | ||
280 | |||
281 | if (init_count == 2 || !of_device_is_available(np)) | ||
282 | goto err; | ||
283 | |||
284 | if (!init_count) | ||
285 | sp804_clocksource_init(base, name); | ||
286 | else { | ||
287 | irq = irq_of_parse_and_map(np, 0); | ||
288 | if (irq <= 0) | ||
289 | goto err; | ||
290 | |||
291 | sp804_clockevents_init(base, irq, name); | ||
292 | } | ||
293 | |||
294 | init_count++; | ||
295 | return; | ||
296 | err: | ||
297 | iounmap(base); | ||
298 | } | ||
299 | CLOCKSOURCE_OF_DECLARE(intcp, "arm,integrator-cp-timer", integrator_cp_of_init); | ||