Commit 7a9c39f7 authored by Shawn Guo's avatar Shawn Guo

ARM: mxs: select STMP_DEVICE and use it for timer code

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: default avatarShawn Guo <shawn.guo@linaro.org>
parent 220d2f26
...@@ -480,6 +480,7 @@ config ARCH_MXS ...@@ -480,6 +480,7 @@ config ARCH_MXS
select MULTI_IRQ_HANDLER select MULTI_IRQ_HANDLER
select PINCTRL select PINCTRL
select SPARSE_IRQ select SPARSE_IRQ
select STMP_DEVICE
select USE_OF select USE_OF
help help
Support for Freescale MXS-based family of processors Support for Freescale MXS-based family of processors
......
...@@ -28,11 +28,10 @@ ...@@ -28,11 +28,10 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/of_irq.h> #include <linux/of_irq.h>
#include <linux/stmp_device.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include <asm/sched_clock.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. * There are 2 versions of the timrot on Freescale MXS-based SoCs.
...@@ -85,20 +84,20 @@ static u32 timrot_major_version; ...@@ -85,20 +84,20 @@ static u32 timrot_major_version;
static inline void timrot_irq_disable(void) static inline void timrot_irq_disable(void)
{ {
__mxs_clrl(BM_TIMROT_TIMCTRLn_IRQ_EN, __raw_writel(BM_TIMROT_TIMCTRLn_IRQ_EN, mxs_timrot_base +
mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); HW_TIMROT_TIMCTRLn(0) + STMP_OFFSET_REG_CLR);
} }
static inline void timrot_irq_enable(void) static inline void timrot_irq_enable(void)
{ {
__mxs_setl(BM_TIMROT_TIMCTRLn_IRQ_EN, __raw_writel(BM_TIMROT_TIMCTRLn_IRQ_EN, mxs_timrot_base +
mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); HW_TIMROT_TIMCTRLn(0) + STMP_OFFSET_REG_SET);
} }
static void timrot_irq_acknowledge(void) static void timrot_irq_acknowledge(void)
{ {
__mxs_clrl(BM_TIMROT_TIMCTRLn_IRQ, __raw_writel(BM_TIMROT_TIMCTRLn_IRQ, mxs_timrot_base +
mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); HW_TIMROT_TIMCTRLn(0) + STMP_OFFSET_REG_CLR);
} }
static cycle_t timrotv1_get_cycles(struct clocksource *cs) static cycle_t timrotv1_get_cycles(struct clocksource *cs)
...@@ -262,7 +261,7 @@ static void __init mxs_timer_init(struct device_node *np) ...@@ -262,7 +261,7 @@ static void __init mxs_timer_init(struct device_node *np)
/* /*
* Initialize timers to a known state * 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 */ /* get timrot version */
timrot_major_version = __raw_readl(mxs_timrot_base + timrot_major_version = __raw_readl(mxs_timrot_base +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment