diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2011-07-18 02:07:14 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-07-20 13:10:10 -0400 |
commit | 0665ccc4c3f229abe3eabe49f3f99763515cf0af (patch) | |
tree | c6f32e3ec871993207093f5cddac93c951019e0f | |
parent | 65f5eaa27a0c18ab79489b2fcbaf28d97c45101a (diff) |
clocksource: convert 32-bit down counting clocksource on S5PV210/S5P64X0
Convert the S5PV210/S5P64X0 32-bit down-counting clocksource to
the generic mmio clocksource infrastructure
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r-- | arch/arm/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/plat-s5p/s5p-time.c | 20 |
2 files changed, 5 insertions, 17 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 2b5f82f34a7e..d39f5324d626 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -726,6 +726,7 @@ config ARCH_S5P64X0 | |||
726 | select GENERIC_GPIO | 726 | select GENERIC_GPIO |
727 | select HAVE_CLK | 727 | select HAVE_CLK |
728 | select CLKDEV_LOOKUP | 728 | select CLKDEV_LOOKUP |
729 | select CLKSRC_MMIO | ||
729 | select HAVE_S3C2410_WATCHDOG if WATCHDOG | 730 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
730 | select GENERIC_CLOCKEVENTS | 731 | select GENERIC_CLOCKEVENTS |
731 | select HAVE_SCHED_CLOCK | 732 | select HAVE_SCHED_CLOCK |
@@ -756,6 +757,7 @@ config ARCH_S5PV210 | |||
756 | select GENERIC_GPIO | 757 | select GENERIC_GPIO |
757 | select HAVE_CLK | 758 | select HAVE_CLK |
758 | select CLKDEV_LOOKUP | 759 | select CLKDEV_LOOKUP |
760 | select CLKSRC_MMIO | ||
759 | select ARM_L1_CACHE_SHIFT_6 | 761 | select ARM_L1_CACHE_SHIFT_6 |
760 | select ARCH_HAS_CPUFREQ | 762 | select ARCH_HAS_CPUFREQ |
761 | select GENERIC_CLOCKEVENTS | 763 | select GENERIC_CLOCKEVENTS |
diff --git a/arch/arm/plat-s5p/s5p-time.c b/arch/arm/plat-s5p/s5p-time.c index 7c82f06baf57..c833e7b57599 100644 --- a/arch/arm/plat-s5p/s5p-time.c +++ b/arch/arm/plat-s5p/s5p-time.c | |||
@@ -314,13 +314,6 @@ static void __iomem *s5p_timer_reg(void) | |||
314 | return S3C_TIMERREG(offset); | 314 | return S3C_TIMERREG(offset); |
315 | } | 315 | } |
316 | 316 | ||
317 | static cycle_t s5p_timer_read(struct clocksource *cs) | ||
318 | { | ||
319 | void __iomem *reg = s5p_timer_reg(); | ||
320 | |||
321 | return (cycle_t) (reg ? ~__raw_readl(reg) : 0); | ||
322 | } | ||
323 | |||
324 | /* | 317 | /* |
325 | * Override the global weak sched_clock symbol with this | 318 | * Override the global weak sched_clock symbol with this |
326 | * local implementation which uses the clocksource to get some | 319 | * local implementation which uses the clocksource to get some |
@@ -350,14 +343,6 @@ static void notrace s5p_update_sched_clock(void) | |||
350 | update_sched_clock(&cd, ~__raw_readl(reg), (u32)~0); | 343 | update_sched_clock(&cd, ~__raw_readl(reg), (u32)~0); |
351 | } | 344 | } |
352 | 345 | ||
353 | struct clocksource time_clocksource = { | ||
354 | .name = "s5p_clocksource_timer", | ||
355 | .rating = 250, | ||
356 | .read = s5p_timer_read, | ||
357 | .mask = CLOCKSOURCE_MASK(32), | ||
358 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
359 | }; | ||
360 | |||
361 | static void __init s5p_clocksource_init(void) | 346 | static void __init s5p_clocksource_init(void) |
362 | { | 347 | { |
363 | unsigned long pclk; | 348 | unsigned long pclk; |
@@ -375,8 +360,9 @@ static void __init s5p_clocksource_init(void) | |||
375 | 360 | ||
376 | init_sched_clock(&cd, s5p_update_sched_clock, 32, clock_rate); | 361 | init_sched_clock(&cd, s5p_update_sched_clock, 32, clock_rate); |
377 | 362 | ||
378 | if (clocksource_register_hz(&time_clocksource, clock_rate)) | 363 | if (clocksource_mmio_init(s5p_timer_reg(), "s5p_clocksource_timer", |
379 | panic("%s: can't register clocksource\n", time_clocksource.name); | 364 | clock_rate, 250, 32, clocksource_mmio_readl_down)) |
365 | panic("s5p_clocksource_timer: can't register clocksource\n"); | ||
380 | } | 366 | } |
381 | 367 | ||
382 | static void __init s5p_timer_resources(void) | 368 | static void __init s5p_timer_resources(void) |