aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-mxs
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2013-03-25 14:57:41 +0800
committerShawn Guo <shawn.guo@linaro.org>2013-04-01 16:30:02 +0800
commitbe35bd2bcd4fc5d67a24ad134138e606f69d11a4 (patch)
treed8dc56d09b4163ef3200b05371ba7a99098daad2 /arch/arm/mach-mxs
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')
-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 f5142aa234a..c8cda183465 100644
--- a/arch/arm/mach-mxs/timer.c
+++ b/arch/arm/mach-mxs/timer.c
@@ -26,6 +26,7 @@
#include <linux/clockchips.h>
#include <linux/clk.h>
#include <linux/of.h>
+#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <asm/mach/time.h>
@@ -79,7 +80,7 @@
static struct clock_event_device mxs_clockevent_device;
static enum clock_event_mode mxs_clockevent_mode = CLOCK_EVT_MODE_UNUSED;
-static void __iomem *mxs_timrot_base = MXS_IO_ADDRESS(MXS_TIMROT_BASE_ADDR);
+static void __iomem *mxs_timrot_base;
static u32 timrot_major_version;
static inline void timrot_irq_disable(void)
@@ -247,6 +248,9 @@ static void __init mxs_timer_init(struct device_node *np)
struct clk *timer_clk;
int irq;
+ mxs_timrot_base = of_iomap(np, 0);
+ WARN_ON(!mxs_timrot_base);
+
timer_clk = of_clk_get(np, 0);
if (IS_ERR(timer_clk)) {
pr_err("%s: failed to get clk\n", __func__);