diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-12-15 16:50:14 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-12-22 17:44:47 -0500 |
commit | 5c21b7ca2c1cca3758a1d357dd57987c96ad1aa0 (patch) | |
tree | 4b2883e118d67534e139f7508bedb656abb63812 /arch | |
parent | e3f4c0ab916334e861fc49eeb2673a8c13e978e7 (diff) |
ARM: u300: convert sched_clock() to use new infrastructure
Convert u300 to use the new sched_clock() infrastructure for extending
32bit counters to full 64-bit nanoseconds.
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-u300/timer.c | 17 |
2 files changed, 14 insertions, 4 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ec7b0274d46a..d5bd266ee565 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -790,6 +790,7 @@ config ARCH_U300 | |||
790 | bool "ST-Ericsson U300 Series" | 790 | bool "ST-Ericsson U300 Series" |
791 | depends on MMU | 791 | depends on MMU |
792 | select CPU_ARM926T | 792 | select CPU_ARM926T |
793 | select HAVE_SCHED_CLOCK | ||
793 | select HAVE_TCM | 794 | select HAVE_TCM |
794 | select ARM_AMBA | 795 | select ARM_AMBA |
795 | select ARM_VIC | 796 | select ARM_VIC |
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c index 6c68fe797903..3ec58bd2d6e4 100644 --- a/arch/arm/mach-u300/timer.c +++ b/arch/arm/mach-u300/timer.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
23 | 23 | ||
24 | /* Generic stuff */ | 24 | /* Generic stuff */ |
25 | #include <asm/sched_clock.h> | ||
25 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
26 | #include <asm/mach/time.h> | 27 | #include <asm/mach/time.h> |
27 | #include <asm/mach/irq.h> | 28 | #include <asm/mach/irq.h> |
@@ -353,12 +354,18 @@ static struct clocksource clocksource_u300_1mhz = { | |||
353 | * this wraps around for now, since it is just a relative time | 354 | * this wraps around for now, since it is just a relative time |
354 | * stamp. (Inspired by OMAP implementation.) | 355 | * stamp. (Inspired by OMAP implementation.) |
355 | */ | 356 | */ |
357 | static DEFINE_CLOCK_DATA(cd); | ||
358 | |||
356 | unsigned long long notrace sched_clock(void) | 359 | unsigned long long notrace sched_clock(void) |
357 | { | 360 | { |
358 | return clocksource_cyc2ns(clocksource_u300_1mhz.read( | 361 | u32 cyc = readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC); |
359 | &clocksource_u300_1mhz), | 362 | return cyc_to_sched_clock(&cd, cyc, (u32)~0); |
360 | clocksource_u300_1mhz.mult, | 363 | } |
361 | clocksource_u300_1mhz.shift); | 364 | |
365 | static void notrace u300_update_sched_clock(void) | ||
366 | { | ||
367 | u32 cyc = readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC); | ||
368 | update_sched_clock(&cd, cyc, (u32)~0); | ||
362 | } | 369 | } |
363 | 370 | ||
364 | 371 | ||
@@ -376,6 +383,8 @@ static void __init u300_timer_init(void) | |||
376 | clk_enable(clk); | 383 | clk_enable(clk); |
377 | rate = clk_get_rate(clk); | 384 | rate = clk_get_rate(clk); |
378 | 385 | ||
386 | init_sched_clock(&cd, u300_update_sched_clock, 32, rate); | ||
387 | |||
379 | /* | 388 | /* |
380 | * Disable the "OS" and "DD" timers - these are designed for Symbian! | 389 | * Disable the "OS" and "DD" timers - these are designed for Symbian! |
381 | * Example usage in cnh1601578 cpu subsystem pd_timer_app.c | 390 | * Example usage in cnh1601578 cpu subsystem pd_timer_app.c |