aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mxs/timer.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2013-03-25 02:57:41 -0400
committerShawn Guo <shawn.guo@linaro.org>2013-04-01 04:30:02 -0400
commitbe35bd2bcd4fc5d67a24ad134138e606f69d11a4 (patch)
treed8dc56d09b4163ef3200b05371ba7a99098daad2 /arch/arm/mach-mxs/timer.c
parent2efb950465e9180c3ff657a755b8a973f7b9ae42 (diff)
ARM: mxs: get timrot base address from device tree
Instead of using static defines, it gets timrot base address with mapping from device tree. Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-mxs/timer.c')
-rw-r--r--arch/arm/mach-mxs/timer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c
index f5142aa234a3..c8cda1834655 100644
--- a/arch/arm/mach-mxs/timer.c
+++ b/arch/arm/mach-mxs/timer.c
@@ -26,6 +26,7 @@
26#include <linux/clockchips.h> 26#include <linux/clockchips.h>
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/of.h> 28#include <linux/of.h>
29#include <linux/of_address.h>
29#include <linux/of_irq.h> 30#include <linux/of_irq.h>
30 31
31#include <asm/mach/time.h> 32#include <asm/mach/time.h>
@@ -79,7 +80,7 @@
79static struct clock_event_device mxs_clockevent_device; 80static struct clock_event_device mxs_clockevent_device;
80static enum clock_event_mode mxs_clockevent_mode = CLOCK_EVT_MODE_UNUSED; 81static enum clock_event_mode mxs_clockevent_mode = CLOCK_EVT_MODE_UNUSED;
81 82
82static void __iomem *mxs_timrot_base = MXS_IO_ADDRESS(MXS_TIMROT_BASE_ADDR); 83static void __iomem *mxs_timrot_base;
83static u32 timrot_major_version; 84static u32 timrot_major_version;
84 85
85static inline void timrot_irq_disable(void) 86static inline void timrot_irq_disable(void)
@@ -247,6 +248,9 @@ static void __init mxs_timer_init(struct device_node *np)
247 struct clk *timer_clk; 248 struct clk *timer_clk;
248 int irq; 249 int irq;
249 250
251 mxs_timrot_base = of_iomap(np, 0);
252 WARN_ON(!mxs_timrot_base);
253
250 timer_clk = of_clk_get(np, 0); 254 timer_clk = of_clk_get(np, 0);
251 if (IS_ERR(timer_clk)) { 255 if (IS_ERR(timer_clk)) {
252 pr_err("%s: failed to get clk\n", __func__); 256 pr_err("%s: failed to get clk\n", __func__);