diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-01-11 03:46:59 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-01-30 18:05:24 -0500 |
commit | b9576623c4217a5d753c272158e1e108c25a1a57 (patch) | |
tree | 0c6e4b503990c4b1fe6f48d50623603f0fddbf65 /arch/arm/plat-nomadik | |
parent | dcd6c92267155e70a94b3927bce681ce74b80d1f (diff) |
ARM: plat-nomadik: get rid of global mtu base pointer
Pass the base offset to the Nomadik MTU timer in the init call
instead of keeping a global pointer to be assigned.
Acked-by: Alessandro Rubini <rubini@unipv.it>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/plat-nomadik')
-rw-r--r-- | arch/arm/plat-nomadik/include/plat/mtu.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-nomadik/timer.c | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/arch/arm/plat-nomadik/include/plat/mtu.h b/arch/arm/plat-nomadik/include/plat/mtu.h index 6508e7694a4b..582641f3dc01 100644 --- a/arch/arm/plat-nomadik/include/plat/mtu.h +++ b/arch/arm/plat-nomadik/include/plat/mtu.h | |||
@@ -1,9 +1,7 @@ | |||
1 | #ifndef __PLAT_MTU_H | 1 | #ifndef __PLAT_MTU_H |
2 | #define __PLAT_MTU_H | 2 | #define __PLAT_MTU_H |
3 | 3 | ||
4 | /* should be set by the platform code */ | 4 | void nmdk_timer_init(void __iomem *base); |
5 | extern void __iomem *mtu_base; | ||
6 | |||
7 | void nmdk_clkevt_reset(void); | 5 | void nmdk_clkevt_reset(void); |
8 | void nmdk_clksrc_reset(void); | 6 | void nmdk_clksrc_reset(void); |
9 | 7 | ||
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c index ad1b45b605a4..46f50f24205f 100644 --- a/arch/arm/plat-nomadik/timer.c +++ b/arch/arm/plat-nomadik/timer.c | |||
@@ -66,12 +66,11 @@ | |||
66 | #define MTU_PCELL2 0xff8 | 66 | #define MTU_PCELL2 0xff8 |
67 | #define MTU_PCELL3 0xffC | 67 | #define MTU_PCELL3 0xffC |
68 | 68 | ||
69 | static void __iomem *mtu_base; | ||
69 | static bool clkevt_periodic; | 70 | static bool clkevt_periodic; |
70 | static u32 clk_prescale; | 71 | static u32 clk_prescale; |
71 | static u32 nmdk_cycle; /* write-once */ | 72 | static u32 nmdk_cycle; /* write-once */ |
72 | 73 | ||
73 | void __iomem *mtu_base; /* Assigned by machine code */ | ||
74 | |||
75 | #ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK | 74 | #ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK |
76 | /* | 75 | /* |
77 | * Override the global weak sched_clock symbol with this | 76 | * Override the global weak sched_clock symbol with this |
@@ -183,11 +182,12 @@ void nmdk_clksrc_reset(void) | |||
183 | mtu_base + MTU_CR(0)); | 182 | mtu_base + MTU_CR(0)); |
184 | } | 183 | } |
185 | 184 | ||
186 | void __init nmdk_timer_init(void) | 185 | void __init nmdk_timer_init(void __iomem *base) |
187 | { | 186 | { |
188 | unsigned long rate; | 187 | unsigned long rate; |
189 | struct clk *clk0; | 188 | struct clk *clk0; |
190 | 189 | ||
190 | mtu_base = base; | ||
191 | clk0 = clk_get_sys("mtu0", NULL); | 191 | clk0 = clk_get_sys("mtu0", NULL); |
192 | BUG_ON(IS_ERR(clk0)); | 192 | BUG_ON(IS_ERR(clk0)); |
193 | 193 | ||