diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2010-06-21 15:19:26 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-06-24 11:36:53 +0200 |
commit | c38883953df6cc8f233ebf07d8a96f04fdbee443 (patch) | |
tree | 28efd00c7145cdd04e6a2dcd2d3a8fa02fbe90d1 | |
parent | 1996f64c4dd5684873d220ad923d26b4bd814960 (diff) | |
download | barebox-c38883953df6cc8f233ebf07d8a96f04fdbee443.tar.gz barebox-c38883953df6cc8f233ebf07d8a96f04fdbee443.tar.xz |
i.MX clocksource: Use readl/writel instead of pointer deref
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/mach-imx/clocksource.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/arch/arm/mach-imx/clocksource.c b/arch/arm/mach-imx/clocksource.c index 4b400a0ca7..a16603854d 100644 --- a/arch/arm/mach-imx/clocksource.c +++ b/arch/arm/mach-imx/clocksource.c @@ -35,12 +35,14 @@ #include <notifier.h> #include <mach/imx-regs.h> #include <mach/clock.h> +#include <asm/io.h> #define GPT(x) __REG(IMX_TIM1_BASE + (x)) +#define timer_base (IMX_TIM1_BASE) uint64_t imx_clocksource_read(void) { - return GPT(GPT_TCN); + return readl(timer_base + GPT_TCN); } static struct clocksource cs = { @@ -62,8 +64,10 @@ static struct notifier_block imx_clock_notifier = { static int clocksource_init (void) { int i; + uint32_t val; + /* setup GP Timer 1 */ - GPT(GPT_TCTL) = TCTL_SWR; + writel(TCTL_SWR, timer_base + GPT_TCTL); #ifdef CONFIG_ARCH_IMX21 PCCR1 |= PCCR1_GPT1_EN; @@ -74,12 +78,12 @@ static int clocksource_init (void) #endif for (i = 0; i < 100; i++) - GPT(GPT_TCTL) = 0; /* We have no udelay by now */ + writel(0, timer_base + GPT_TCTL); /* We have no udelay by now */ - GPT(GPT_TPRER) = 0; - GPT(GPT_TCTL) |= TCTL_FRR | (1<<TCTL_CLKSOURCE); /* Freerun Mode, PERCLK1 input */ - GPT(GPT_TCTL) &= ~TCTL_TEN; - GPT(GPT_TCTL) |= TCTL_TEN; /* Enable timer */ + writel(0, timer_base + GPT_TPRER); + val = readl(timer_base + GPT_TCTL); + val |= TCTL_FRR | (1 << TCTL_CLKSOURCE) | TCTL_TEN; /* Freerun Mode, PERCLK1 input */ + writel(val, timer_base + GPT_TCTL); cs.mult = clocksource_hz2mult(imx_get_gptclk(), cs.shift); |