diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-05-27 12:09:54 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-08-14 06:40:40 -0400 |
commit | fc2a9f0bc7f6dd4966dc57fb98b8697c83b6d035 (patch) | |
tree | 6af6f2ebbf386987a1bddebec7111bec4f5925cd | |
parent | 12b8eb865285c95d6e2c02555f066e3f949e090d (diff) |
MXC: i.MX25 timer support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/plat-mxc/time.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c index 7e71bb6270eb..59e33a3bf7f3 100644 --- a/arch/arm/plat-mxc/time.c +++ b/arch/arm/plat-mxc/time.c | |||
@@ -47,7 +47,7 @@ | |||
47 | #define MX2_TSTAT_CAPT (1 << 1) | 47 | #define MX2_TSTAT_CAPT (1 << 1) |
48 | #define MX2_TSTAT_COMP (1 << 0) | 48 | #define MX2_TSTAT_COMP (1 << 0) |
49 | 49 | ||
50 | /* MX31, MX35 */ | 50 | /* MX31, MX35, MX25 */ |
51 | #define MX3_TCTL_WAITEN (1 << 3) | 51 | #define MX3_TCTL_WAITEN (1 << 3) |
52 | #define MX3_TCTL_CLK_IPG (1 << 6) | 52 | #define MX3_TCTL_CLK_IPG (1 << 6) |
53 | #define MX3_TCTL_FRR (1 << 9) | 53 | #define MX3_TCTL_FRR (1 << 9) |
@@ -66,7 +66,7 @@ static inline void gpt_irq_disable(void) | |||
66 | { | 66 | { |
67 | unsigned int tmp; | 67 | unsigned int tmp; |
68 | 68 | ||
69 | if (cpu_is_mx3()) | 69 | if (cpu_is_mx3() || cpu_is_mx25()) |
70 | __raw_writel(0, timer_base + MX3_IR); | 70 | __raw_writel(0, timer_base + MX3_IR); |
71 | else { | 71 | else { |
72 | tmp = __raw_readl(timer_base + MXC_TCTL); | 72 | tmp = __raw_readl(timer_base + MXC_TCTL); |
@@ -76,7 +76,7 @@ static inline void gpt_irq_disable(void) | |||
76 | 76 | ||
77 | static inline void gpt_irq_enable(void) | 77 | static inline void gpt_irq_enable(void) |
78 | { | 78 | { |
79 | if (cpu_is_mx3()) | 79 | if (cpu_is_mx3() || cpu_is_mx25()) |
80 | __raw_writel(1<<0, timer_base + MX3_IR); | 80 | __raw_writel(1<<0, timer_base + MX3_IR); |
81 | else { | 81 | else { |
82 | __raw_writel(__raw_readl(timer_base + MXC_TCTL) | MX1_2_TCTL_IRQEN, | 82 | __raw_writel(__raw_readl(timer_base + MXC_TCTL) | MX1_2_TCTL_IRQEN, |
@@ -90,7 +90,7 @@ static void gpt_irq_acknowledge(void) | |||
90 | __raw_writel(0, timer_base + MX1_2_TSTAT); | 90 | __raw_writel(0, timer_base + MX1_2_TSTAT); |
91 | if (cpu_is_mx2()) | 91 | if (cpu_is_mx2()) |
92 | __raw_writel(MX2_TSTAT_CAPT | MX2_TSTAT_COMP, timer_base + MX1_2_TSTAT); | 92 | __raw_writel(MX2_TSTAT_CAPT | MX2_TSTAT_COMP, timer_base + MX1_2_TSTAT); |
93 | if (cpu_is_mx3()) | 93 | if (cpu_is_mx3() || cpu_is_mx25()) |
94 | __raw_writel(MX3_TSTAT_OF1, timer_base + MX3_TSTAT); | 94 | __raw_writel(MX3_TSTAT_OF1, timer_base + MX3_TSTAT); |
95 | } | 95 | } |
96 | 96 | ||
@@ -117,7 +117,7 @@ static int __init mxc_clocksource_init(struct clk *timer_clk) | |||
117 | { | 117 | { |
118 | unsigned int c = clk_get_rate(timer_clk); | 118 | unsigned int c = clk_get_rate(timer_clk); |
119 | 119 | ||
120 | if (cpu_is_mx3()) | 120 | if (cpu_is_mx3() || cpu_is_mx25()) |
121 | clocksource_mxc.read = mx3_get_cycles; | 121 | clocksource_mxc.read = mx3_get_cycles; |
122 | 122 | ||
123 | clocksource_mxc.mult = clocksource_hz2mult(c, | 123 | clocksource_mxc.mult = clocksource_hz2mult(c, |
@@ -180,7 +180,7 @@ static void mxc_set_mode(enum clock_event_mode mode, | |||
180 | 180 | ||
181 | if (mode != clockevent_mode) { | 181 | if (mode != clockevent_mode) { |
182 | /* Set event time into far-far future */ | 182 | /* Set event time into far-far future */ |
183 | if (cpu_is_mx3()) | 183 | if (cpu_is_mx3() || cpu_is_mx25()) |
184 | __raw_writel(__raw_readl(timer_base + MX3_TCN) - 3, | 184 | __raw_writel(__raw_readl(timer_base + MX3_TCN) - 3, |
185 | timer_base + MX3_TCMP); | 185 | timer_base + MX3_TCMP); |
186 | else | 186 | else |
@@ -233,7 +233,7 @@ static irqreturn_t mxc_timer_interrupt(int irq, void *dev_id) | |||
233 | struct clock_event_device *evt = &clockevent_mxc; | 233 | struct clock_event_device *evt = &clockevent_mxc; |
234 | uint32_t tstat; | 234 | uint32_t tstat; |
235 | 235 | ||
236 | if (cpu_is_mx3()) | 236 | if (cpu_is_mx3() || cpu_is_mx25()) |
237 | tstat = __raw_readl(timer_base + MX3_TSTAT); | 237 | tstat = __raw_readl(timer_base + MX3_TSTAT); |
238 | else | 238 | else |
239 | tstat = __raw_readl(timer_base + MX1_2_TSTAT); | 239 | tstat = __raw_readl(timer_base + MX1_2_TSTAT); |
@@ -264,7 +264,7 @@ static int __init mxc_clockevent_init(struct clk *timer_clk) | |||
264 | { | 264 | { |
265 | unsigned int c = clk_get_rate(timer_clk); | 265 | unsigned int c = clk_get_rate(timer_clk); |
266 | 266 | ||
267 | if (cpu_is_mx3()) | 267 | if (cpu_is_mx3() || cpu_is_mx25()) |
268 | clockevent_mxc.set_next_event = mx3_set_next_event; | 268 | clockevent_mxc.set_next_event = mx3_set_next_event; |
269 | 269 | ||
270 | clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC, | 270 | clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC, |
@@ -296,7 +296,7 @@ void __init mxc_timer_init(struct clk *timer_clk, void __iomem *base, int irq) | |||
296 | __raw_writel(0, timer_base + MXC_TCTL); | 296 | __raw_writel(0, timer_base + MXC_TCTL); |
297 | __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */ | 297 | __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */ |
298 | 298 | ||
299 | if (cpu_is_mx3()) | 299 | if (cpu_is_mx3() || cpu_is_mx25()) |
300 | tctl_val = MX3_TCTL_CLK_IPG | MX3_TCTL_FRR | MX3_TCTL_WAITEN | MXC_TCTL_TEN; | 300 | tctl_val = MX3_TCTL_CLK_IPG | MX3_TCTL_FRR | MX3_TCTL_WAITEN | MXC_TCTL_TEN; |
301 | else | 301 | else |
302 | tctl_val = MX1_2_TCTL_FRR | MX1_2_TCTL_CLK_PCLK1 | MXC_TCTL_TEN; | 302 | tctl_val = MX1_2_TCTL_FRR | MX1_2_TCTL_CLK_PCLK1 | MXC_TCTL_TEN; |