aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-u300
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-04-05 16:45:11 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-05-31 05:06:52 -0400
commit3c96d8ea8101936959dede664ac7b97b30fafbe8 (patch)
tree7a4d3e37d048a8facda78177545ca6ecd9b53769 /arch/arm/mach-u300
parentf722406faae2d073cc1d01063d1123c35425939e (diff)
ARM: u300: enable delaytimer on the U300
The U300 can support timer-based delays, so implement this. Skips past jiffy calibration. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-u300')
-rw-r--r--arch/arm/mach-u300/timer.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c
index d9e73209c9b8..c3d3802b46a0 100644
--- a/arch/arm/mach-u300/timer.c
+++ b/arch/arm/mach-u300/timer.c
@@ -18,6 +18,7 @@
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/irq.h> 20#include <linux/irq.h>
21#include <linux/delay.h>
21 22
22#include <mach/hardware.h> 23#include <mach/hardware.h>
23#include <mach/irqs.h> 24#include <mach/irqs.h>
@@ -345,6 +346,12 @@ static u32 notrace u300_read_sched_clock(void)
345 return readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC); 346 return readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC);
346} 347}
347 348
349static unsigned long u300_read_current_timer(void)
350{
351 return readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC);
352}
353
354static struct delay_timer u300_delay_timer;
348 355
349/* 356/*
350 * This sets up the system timers, clock source and clock event. 357 * This sets up the system timers, clock source and clock event.
@@ -362,6 +369,10 @@ void __init u300_timer_init(void)
362 369
363 setup_sched_clock(u300_read_sched_clock, 32, rate); 370 setup_sched_clock(u300_read_sched_clock, 32, rate);
364 371
372 u300_delay_timer.read_current_timer = &u300_read_current_timer;
373 u300_delay_timer.freq = rate;
374 register_current_timer_delay(&u300_delay_timer);
375
365 /* 376 /*
366 * Disable the "OS" and "DD" timers - these are designed for Symbian! 377 * Disable the "OS" and "DD" timers - these are designed for Symbian!
367 * Example usage in cnh1601578 cpu subsystem pd_timer_app.c 378 * Example usage in cnh1601578 cpu subsystem pd_timer_app.c