diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-03-08 03:51:13 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-03-08 03:51:13 -0500 |
commit | 6c634726352f0d796a4b5e6aa9849ee5b45712ce (patch) | |
tree | 5364dd0ce0aceaa1f4f096641800a6e878c553a2 /arch/arm | |
parent | dc38d82676d87a21a0f924cb1728f869412749a9 (diff) | |
parent | f8e56c42e4e3527f629682ca123f881c1bea8500 (diff) |
Merge branch 'sched_clock-for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into devel-stable
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-msm/timer.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c index 11d0d8f2656c..61983daa7bba 100644 --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm/mach/time.h> | 24 | #include <asm/mach/time.h> |
25 | #include <asm/hardware/gic.h> | 25 | #include <asm/hardware/gic.h> |
26 | #include <asm/localtimer.h> | 26 | #include <asm/localtimer.h> |
27 | #include <asm/sched_clock.h> | ||
27 | 28 | ||
28 | #include <mach/msm_iomap.h> | 29 | #include <mach/msm_iomap.h> |
29 | #include <mach/cpu.h> | 30 | #include <mach/cpu.h> |
@@ -105,12 +106,12 @@ static union { | |||
105 | 106 | ||
106 | static void __iomem *source_base; | 107 | static void __iomem *source_base; |
107 | 108 | ||
108 | static cycle_t msm_read_timer_count(struct clocksource *cs) | 109 | static notrace cycle_t msm_read_timer_count(struct clocksource *cs) |
109 | { | 110 | { |
110 | return readl_relaxed(source_base + TIMER_COUNT_VAL); | 111 | return readl_relaxed(source_base + TIMER_COUNT_VAL); |
111 | } | 112 | } |
112 | 113 | ||
113 | static cycle_t msm_read_timer_count_shift(struct clocksource *cs) | 114 | static notrace cycle_t msm_read_timer_count_shift(struct clocksource *cs) |
114 | { | 115 | { |
115 | /* | 116 | /* |
116 | * Shift timer count down by a constant due to unreliable lower bits | 117 | * Shift timer count down by a constant due to unreliable lower bits |
@@ -127,6 +128,11 @@ static struct clocksource msm_clocksource = { | |||
127 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 128 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
128 | }; | 129 | }; |
129 | 130 | ||
131 | static notrace u32 msm_sched_clock_read(void) | ||
132 | { | ||
133 | return msm_clocksource.read(&msm_clocksource); | ||
134 | } | ||
135 | |||
130 | static void __init msm_timer_init(void) | 136 | static void __init msm_timer_init(void) |
131 | { | 137 | { |
132 | struct clock_event_device *ce = &msm_clockevent; | 138 | struct clock_event_device *ce = &msm_clockevent; |
@@ -189,6 +195,8 @@ err: | |||
189 | res = clocksource_register_hz(cs, dgt_hz); | 195 | res = clocksource_register_hz(cs, dgt_hz); |
190 | if (res) | 196 | if (res) |
191 | pr_err("clocksource_register failed\n"); | 197 | pr_err("clocksource_register failed\n"); |
198 | setup_sched_clock(msm_sched_clock_read, | ||
199 | cpu_is_msm7x01() ? 32 - MSM_DGT_SHIFT : 32, dgt_hz); | ||
192 | } | 200 | } |
193 | 201 | ||
194 | #ifdef CONFIG_LOCAL_TIMERS | 202 | #ifdef CONFIG_LOCAL_TIMERS |