diff options
author | Torben Hohn <torbenh@linutronix.de> | 2012-12-21 09:06:15 -0500 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2013-02-04 22:19:46 -0500 |
commit | 2fb318ff75d7c4d5ccc418ab4dcce19aa40fc059 (patch) | |
tree | 16db81ddeeedae652d70bda0ac1d86d4b56accb8 /arch/arm/mach-mxs | |
parent | 77d168a99877bd045f02e4845a7f392762f182fb (diff) |
ARM: mxs: use apbx bus clock to drive the timers on timrotv2
timer resolution of ~32us is pretty low.
v2 has 32bits resolution, so we have quite some headroom, and
can use the 24MHz clock.
v1 has only 16bits, so we only increase v2.
So we just exchange the timrot clock in imx28.
On imx23 we have timrotv1 and everything stays the same.
Signed-off-by: Torben Hohn <torbenh@linutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-mxs')
-rw-r--r-- | arch/arm/mach-mxs/timer.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c index 27451b1ba3f1..1f8ec8cd9182 100644 --- a/arch/arm/mach-mxs/timer.c +++ b/arch/arm/mach-mxs/timer.c | |||
@@ -72,8 +72,9 @@ | |||
72 | #define BM_TIMROT_TIMCTRLn_IRQ_EN (1 << 14) | 72 | #define BM_TIMROT_TIMCTRLn_IRQ_EN (1 << 14) |
73 | #define BM_TIMROT_TIMCTRLn_IRQ (1 << 15) | 73 | #define BM_TIMROT_TIMCTRLn_IRQ (1 << 15) |
74 | #define BP_TIMROT_TIMCTRLn_SELECT 0 | 74 | #define BP_TIMROT_TIMCTRLn_SELECT 0 |
75 | #define BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL 0x8 | 75 | #define BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL 0x8 |
76 | #define BV_TIMROTv2_TIMCTRLn_SELECT__32KHZ_XTAL 0xb | 76 | #define BV_TIMROTv2_TIMCTRLn_SELECT__32KHZ_XTAL 0xb |
77 | #define BV_TIMROTv2_TIMCTRLn_SELECT__TICK_ALWAYS 0xf | ||
77 | 78 | ||
78 | static struct clock_event_device mxs_clockevent_device; | 79 | static struct clock_event_device mxs_clockevent_device; |
79 | static enum clock_event_mode mxs_clockevent_mode = CLOCK_EVT_MODE_UNUSED; | 80 | static enum clock_event_mode mxs_clockevent_mode = CLOCK_EVT_MODE_UNUSED; |
@@ -274,7 +275,7 @@ void __init mxs_timer_init(void) | |||
274 | /* one for clock_event */ | 275 | /* one for clock_event */ |
275 | __raw_writel((timrot_is_v1() ? | 276 | __raw_writel((timrot_is_v1() ? |
276 | BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL : | 277 | BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL : |
277 | BV_TIMROTv2_TIMCTRLn_SELECT__32KHZ_XTAL) | | 278 | BV_TIMROTv2_TIMCTRLn_SELECT__TICK_ALWAYS) | |
278 | BM_TIMROT_TIMCTRLn_UPDATE | | 279 | BM_TIMROT_TIMCTRLn_UPDATE | |
279 | BM_TIMROT_TIMCTRLn_IRQ_EN, | 280 | BM_TIMROT_TIMCTRLn_IRQ_EN, |
280 | mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); | 281 | mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); |
@@ -282,7 +283,7 @@ void __init mxs_timer_init(void) | |||
282 | /* another for clocksource */ | 283 | /* another for clocksource */ |
283 | __raw_writel((timrot_is_v1() ? | 284 | __raw_writel((timrot_is_v1() ? |
284 | BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL : | 285 | BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL : |
285 | BV_TIMROTv2_TIMCTRLn_SELECT__32KHZ_XTAL) | | 286 | BV_TIMROTv2_TIMCTRLn_SELECT__TICK_ALWAYS) | |
286 | BM_TIMROT_TIMCTRLn_RELOAD, | 287 | BM_TIMROT_TIMCTRLn_RELOAD, |
287 | mxs_timrot_base + HW_TIMROT_TIMCTRLn(1)); | 288 | mxs_timrot_base + HW_TIMROT_TIMCTRLn(1)); |
288 | 289 | ||