diff options
author | Mattias Wallin <mattias.wallin@stericsson.com> | 2011-05-27 04:29:25 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2011-09-22 09:42:33 -0400 |
commit | cba13830d3fcb1e025e224c496a10515a39a7f80 (patch) | |
tree | 57598cebc2aeba64659f0d2b5fcab42e69624787 /arch/arm/plat-nomadik | |
parent | d93dc5c4478c1fd5de85a3e8aece9aad7bbae044 (diff) |
ARM: plat-nomadik: MTU sched_clock as an option
This patch makes it possible to configure away the sched_clock
part of the MTU timer.
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com>
Signed-off-by: Jonas Aberg <jonas.aberg@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/plat-nomadik')
-rw-r--r-- | arch/arm/plat-nomadik/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/plat-nomadik/timer.c | 8 |
2 files changed, 11 insertions, 5 deletions
diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig index ce659015535e..bca4914b4b9d 100644 --- a/arch/arm/plat-nomadik/Kconfig +++ b/arch/arm/plat-nomadik/Kconfig | |||
@@ -15,10 +15,16 @@ if PLAT_NOMADIK | |||
15 | 15 | ||
16 | config HAS_MTU | 16 | config HAS_MTU |
17 | bool | 17 | bool |
18 | select HAVE_SCHED_CLOCK | ||
19 | help | 18 | help |
20 | Support for Multi Timer Unit. MTU provides access | 19 | Support for Multi Timer Unit. MTU provides access |
21 | to multiple interrupt generating programmable | 20 | to multiple interrupt generating programmable |
22 | 32-bit free running decrementing counters. | 21 | 32-bit free running decrementing counters. |
23 | 22 | ||
23 | config NOMADIK_MTU_SCHED_CLOCK | ||
24 | bool | ||
25 | depends on HAS_MTU | ||
26 | select HAVE_SCHED_CLOCK | ||
27 | help | ||
28 | Use the Multi Timer Unit as the sched_clock. | ||
29 | |||
24 | endif | 30 | endif |
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c index ef74e157a9d5..bd638c552f04 100644 --- a/arch/arm/plat-nomadik/timer.c +++ b/arch/arm/plat-nomadik/timer.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <plat/mtu.h> | 24 | #include <plat/mtu.h> |
25 | 25 | ||
26 | void __iomem *mtu_base; /* Assigned by machine code */ | 26 | void __iomem *mtu_base; /* Assigned by machine code */ |
27 | 27 | #ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK | |
28 | /* | 28 | /* |
29 | * Override the global weak sched_clock symbol with this | 29 | * Override the global weak sched_clock symbol with this |
30 | * local implementation which uses the clocksource to get some | 30 | * local implementation which uses the clocksource to get some |
@@ -48,7 +48,7 @@ static void notrace nomadik_update_sched_clock(void) | |||
48 | u32 cyc = -readl(mtu_base + MTU_VAL(0)); | 48 | u32 cyc = -readl(mtu_base + MTU_VAL(0)); |
49 | update_sched_clock(&cd, cyc, (u32)~0); | 49 | update_sched_clock(&cd, cyc, (u32)~0); |
50 | } | 50 | } |
51 | 51 | #endif | |
52 | /* Clockevent device: use one-shot mode */ | 52 | /* Clockevent device: use one-shot mode */ |
53 | static void nmdk_clkevt_mode(enum clock_event_mode mode, | 53 | static void nmdk_clkevt_mode(enum clock_event_mode mode, |
54 | struct clock_event_device *dev) | 54 | struct clock_event_device *dev) |
@@ -153,9 +153,9 @@ void __init nmdk_timer_init(void) | |||
153 | rate, 200, 32, clocksource_mmio_readl_down)) | 153 | rate, 200, 32, clocksource_mmio_readl_down)) |
154 | pr_err("timer: failed to initialize clock source %s\n", | 154 | pr_err("timer: failed to initialize clock source %s\n", |
155 | "mtu_0"); | 155 | "mtu_0"); |
156 | 156 | #ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK | |
157 | init_sched_clock(&cd, nomadik_update_sched_clock, 32, rate); | 157 | init_sched_clock(&cd, nomadik_update_sched_clock, 32, rate); |
158 | 158 | #endif | |
159 | /* Timer 1 is used for events */ | 159 | /* Timer 1 is used for events */ |
160 | 160 | ||
161 | clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE); | 161 | clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE); |