Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Weitzel <J.Weitzel@phytec.de>2011-04-04 19:42:02 +0200
committerThomas Gleixner <tglx@linutronix.de>2011-04-04 19:42:02 +0200
commita5a2b75c0c11b5c8c6f9f87a4d43417f172345a8 (patch)
tree1d78e7b234b9e30c8ec93a270371caa6782f2b0f
parentc1d6834fcedd0d997344b7db7798cb2c01fb75f8 (diff)
arm: mxc: Add add dummy_get_cycles()
ARM mxc platform: Add dummy_get_cycles to avoid access before init is done. Signed-off-by: Jan Weitzel <J.Weitzel@phytec.de> Signed-off-by: Carsten Emde <cbe@osadl.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/arm/plat-mxc/time.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c
index 844567ee35fe..cfa7437d04e1 100644
--- a/arch/arm/plat-mxc/time.c
+++ b/arch/arm/plat-mxc/time.c
@@ -104,10 +104,16 @@ static cycle_t mx3_get_cycles(struct clocksource *cs)
return __raw_readl(timer_base + MX3_TCN);
}
+/* dummy used before clocks are enabled*/
+static cycle_t get_cycles_dummy(struct clocksource *cs)
+{
+ return 0;
+}
+
static struct clocksource clocksource_mxc = {
.name = "mxc_timer1",
.rating = 200,
- .read = mx1_2_get_cycles,
+ .read = get_cycles_dummy,
.mask = CLOCKSOURCE_MASK(32),
.shift = 20,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
@@ -119,6 +125,8 @@ static int __init mxc_clocksource_init(struct clk *timer_clk)
if (cpu_is_mx3() || cpu_is_mx25())
clocksource_mxc.read = mx3_get_cycles;
+ else
+ clocksource_mxc.read = mx1_2_get_cycles;
clocksource_mxc.mult = clocksource_hz2mult(c,
clocksource_mxc.shift);