diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-08 10:35:22 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-23 13:04:52 -0400 |
commit | c5039f52329ff796d7fea9024e5615abee02dbfb (patch) | |
tree | 2434fede52e85f2a2315cfce76600fa777d98715 /arch/arm/mach-integrator | |
parent | 6fa5d5f764469daf3c4d21f94cbc1839b3857bbd (diff) |
clocksource: convert Integrator/AP 16-bit down counting clocksource
Convert the Integrator/AP 16-bit down-counting clocksource to the
generic clocksource infrastructure.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-integrator')
-rw-r--r-- | arch/arm/mach-integrator/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-integrator/integrator_ap.c | 21 |
2 files changed, 4 insertions, 18 deletions
diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig index d701d32a07f1..dfd18f3b50e8 100644 --- a/arch/arm/mach-integrator/Kconfig +++ b/arch/arm/mach-integrator/Kconfig | |||
@@ -4,6 +4,7 @@ menu "Integrator Options" | |||
4 | 4 | ||
5 | config ARCH_INTEGRATOR_AP | 5 | config ARCH_INTEGRATOR_AP |
6 | bool "Support Integrator/AP and Integrator/PP2 platforms" | 6 | bool "Support Integrator/AP and Integrator/PP2 platforms" |
7 | select CLKSRC_MMIO | ||
7 | select MIGHT_HAVE_PCI | 8 | select MIGHT_HAVE_PCI |
8 | help | 9 | help |
9 | Include support for the ARM(R) Integrator/AP and | 10 | Include support for the ARM(R) Integrator/AP and |
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index d3e96451529c..6b151288f66c 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c | |||
@@ -335,25 +335,9 @@ static void __init ap_init(void) | |||
335 | 335 | ||
336 | static unsigned long timer_reload; | 336 | static unsigned long timer_reload; |
337 | 337 | ||
338 | static void __iomem * const clksrc_base = (void __iomem *)TIMER2_VA_BASE; | ||
339 | |||
340 | static cycle_t timersp_read(struct clocksource *cs) | ||
341 | { | ||
342 | return ~(readl(clksrc_base + TIMER_VALUE) & 0xffff); | ||
343 | } | ||
344 | |||
345 | static struct clocksource clocksource_timersp = { | ||
346 | .name = "timer2", | ||
347 | .rating = 200, | ||
348 | .read = timersp_read, | ||
349 | .mask = CLOCKSOURCE_MASK(16), | ||
350 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
351 | }; | ||
352 | |||
353 | static void integrator_clocksource_init(u32 khz) | 338 | static void integrator_clocksource_init(u32 khz) |
354 | { | 339 | { |
355 | struct clocksource *cs = &clocksource_timersp; | 340 | void __iomem *base = (void __iomem *)TIMER2_VA_BASE; |
356 | void __iomem *base = clksrc_base; | ||
357 | u32 ctrl = TIMER_CTRL_ENABLE; | 341 | u32 ctrl = TIMER_CTRL_ENABLE; |
358 | 342 | ||
359 | if (khz >= 1500) { | 343 | if (khz >= 1500) { |
@@ -364,7 +348,8 @@ static void integrator_clocksource_init(u32 khz) | |||
364 | writel(ctrl, base + TIMER_CTRL); | 348 | writel(ctrl, base + TIMER_CTRL); |
365 | writel(0xffff, base + TIMER_LOAD); | 349 | writel(0xffff, base + TIMER_LOAD); |
366 | 350 | ||
367 | clocksource_register_khz(cs, khz); | 351 | clocksource_mmio_init(base + TIMER_VALUE, "timer2", |
352 | khz * 1000, 200, 16, clocksource_mmio_readl_down); | ||
368 | } | 353 | } |
369 | 354 | ||
370 | static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE; | 355 | static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE; |