ARM: mxs: select STMP_DEVICE and use it for timer code
authorShawn Guo <shawn.guo@linaro.org>
Mon, 25 Mar 2013 12:04:34 +0000 (20:04 +0800)
committerShawn Guo <shawn.guo@linaro.org>
Mon, 1 Apr 2013 08:30:02 +0000 (16:30 +0800)
Select STMP_DEVICE and in timer code replace mxs_reset_block() with
stmp_reset_block(), use STMP_OFFSET_REG_SET/CLR to replace
__mxs_setl/clrl.

As the result, <mach/mxs.h> and <mach/common.h> includsion can be
removed from timer.c now.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
arch/arm/Kconfig
arch/arm/mach-mxs/timer.c

index 5a1f0c9e0ab0b8014a2baa4188bca5b5454c0119..2e4386cba23c713e967853184f095436d9d16eb4 100644 (file)
@@ -480,6 +480,7 @@ config ARCH_MXS
        select MULTI_IRQ_HANDLER
        select PINCTRL
        select SPARSE_IRQ
+       select STMP_DEVICE
        select USE_OF
        help
          Support for Freescale MXS-based family of processors
index f4dd96ff081a6145432468eb8eede37b891fb377..a4d469b21d96d089070ba8f7fb55482782319d8a 100644 (file)
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
+#include <linux/stmp_device.h>
 
 #include <asm/mach/time.h>
 #include <asm/sched_clock.h>
-#include <mach/mxs.h>
-#include <mach/common.h>
 
 /*
  * There are 2 versions of the timrot on Freescale MXS-based SoCs.
@@ -85,20 +84,20 @@ static u32 timrot_major_version;
 
 static inline void timrot_irq_disable(void)
 {
-       __mxs_clrl(BM_TIMROT_TIMCTRLn_IRQ_EN,
-                       mxs_timrot_base + HW_TIMROT_TIMCTRLn(0));
+       __raw_writel(BM_TIMROT_TIMCTRLn_IRQ_EN, mxs_timrot_base +
+                    HW_TIMROT_TIMCTRLn(0) + STMP_OFFSET_REG_CLR);
 }
 
 static inline void timrot_irq_enable(void)
 {
-       __mxs_setl(BM_TIMROT_TIMCTRLn_IRQ_EN,
-                       mxs_timrot_base + HW_TIMROT_TIMCTRLn(0));
+       __raw_writel(BM_TIMROT_TIMCTRLn_IRQ_EN, mxs_timrot_base +
+                    HW_TIMROT_TIMCTRLn(0) + STMP_OFFSET_REG_SET);
 }
 
 static void timrot_irq_acknowledge(void)
 {
-       __mxs_clrl(BM_TIMROT_TIMCTRLn_IRQ,
-                       mxs_timrot_base + HW_TIMROT_TIMCTRLn(0));
+       __raw_writel(BM_TIMROT_TIMCTRLn_IRQ, mxs_timrot_base +
+                    HW_TIMROT_TIMCTRLn(0) + STMP_OFFSET_REG_CLR);
 }
 
 static cycle_t timrotv1_get_cycles(struct clocksource *cs)
@@ -262,7 +261,7 @@ static void __init mxs_timer_init(struct device_node *np)
        /*
         * Initialize timers to a known state
         */
-       mxs_reset_block(mxs_timrot_base + HW_TIMROT_ROTCTRL);
+       stmp_reset_block(mxs_timrot_base + HW_TIMROT_ROTCTRL);
 
        /* get timrot version */
        timrot_major_version = __raw_readl(mxs_timrot_base +