aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-01-11 03:46:59 -0500
committerLinus Walleij <linus.walleij@linaro.org>2012-01-30 18:05:24 -0500
commitb9576623c4217a5d753c272158e1e108c25a1a57 (patch)
tree0c6e4b503990c4b1fe6f48d50623603f0fddbf65 /arch/arm
parentdcd6c92267155e70a94b3927bce681ce74b80d1f (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')
-rw-r--r--arch/arm/mach-nomadik/board-nhk8815.c7
-rw-r--r--arch/arm/mach-nomadik/include/mach/setup.h19
-rw-r--r--arch/arm/mach-ux500/include/mach/setup.h3
-rw-r--r--arch/arm/mach-ux500/timer.c7
-rw-r--r--arch/arm/plat-nomadik/include/plat/mtu.h4
-rw-r--r--arch/arm/plat-nomadik/timer.c6
6 files changed, 10 insertions, 36 deletions
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c
index 7c878bf0034..b77cb8465d3 100644
--- a/arch/arm/mach-nomadik/board-nhk8815.c
+++ b/arch/arm/mach-nomadik/board-nhk8815.c
@@ -27,11 +27,11 @@
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include <asm/mach/irq.h> 28#include <asm/mach/irq.h>
29#include <asm/mach/flash.h> 29#include <asm/mach/flash.h>
30#include <asm/mach/time.h>
30 31
31#include <plat/gpio-nomadik.h> 32#include <plat/gpio-nomadik.h>
32#include <plat/mtu.h> 33#include <plat/mtu.h>
33 34
34#include <mach/setup.h>
35#include <mach/nand.h> 35#include <mach/nand.h>
36#include <mach/fsmc.h> 36#include <mach/fsmc.h>
37 37
@@ -255,10 +255,7 @@ static void __init nomadik_timer_init(void)
255 src_cr |= SRC_CR_INIT_VAL; 255 src_cr |= SRC_CR_INIT_VAL;
256 writel(src_cr, io_p2v(NOMADIK_SRC_BASE)); 256 writel(src_cr, io_p2v(NOMADIK_SRC_BASE));
257 257
258 /* Save global pointer to mtu, used by platform timer code */ 258 nmdk_timer_init(io_p2v(NOMADIK_MTU0_BASE));
259 mtu_base = io_p2v(NOMADIK_MTU0_BASE);
260
261 nmdk_timer_init();
262} 259}
263 260
264static struct sys_timer nomadik_timer = { 261static struct sys_timer nomadik_timer = {
diff --git a/arch/arm/mach-nomadik/include/mach/setup.h b/arch/arm/mach-nomadik/include/mach/setup.h
deleted file mode 100644
index bcaeaf41c05..00000000000
--- a/arch/arm/mach-nomadik/include/mach/setup.h
+++ /dev/null
@@ -1,19 +0,0 @@
1
2/*
3 * These symbols are needed for board-specific files to call their
4 * own cpu-specific files
5 */
6
7#ifndef __ASM_ARCH_SETUP_H
8#define __ASM_ARCH_SETUP_H
9
10#include <asm/mach/time.h>
11#include <linux/init.h>
12
13#ifdef CONFIG_NOMADIK_8815
14
15extern void nmdk_timer_init(void);
16
17#endif /* NOMADIK_8815 */
18
19#endif /* __ASM_ARCH_SETUP_H */
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h
index a7d363fdb4c..93d403955ea 100644
--- a/arch/arm/mach-ux500/include/mach/setup.h
+++ b/arch/arm/mach-ux500/include/mach/setup.h
@@ -27,9 +27,6 @@ extern void __init u5500_sdi_init(void);
27 27
28extern void __init db5500_dma_init(void); 28extern void __init db5500_dma_init(void);
29 29
30/* We re-use nomadik_timer for this platform */
31extern void nmdk_timer_init(void);
32
33struct amba_device; 30struct amba_device;
34extern void __init amba_add_devices(struct amba_device *devs[], int num); 31extern void __init amba_add_devices(struct amba_device *devs[], int num);
35 32
diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c
index aea467d04ff..fd000243112 100644
--- a/arch/arm/mach-ux500/timer.c
+++ b/arch/arm/mach-ux500/timer.c
@@ -17,19 +17,20 @@
17 17
18static void __init ux500_timer_init(void) 18static void __init ux500_timer_init(void)
19{ 19{
20 void __iomem *mtu_timer_base;
20 void __iomem *prcmu_timer_base; 21 void __iomem *prcmu_timer_base;
21 22
22 if (cpu_is_u5500()) { 23 if (cpu_is_u5500()) {
23#ifdef CONFIG_LOCAL_TIMERS 24#ifdef CONFIG_LOCAL_TIMERS
24 twd_base = __io_address(U5500_TWD_BASE); 25 twd_base = __io_address(U5500_TWD_BASE);
25#endif 26#endif
26 mtu_base = __io_address(U5500_MTU0_BASE); 27 mtu_timer_base = __io_address(U5500_MTU0_BASE);
27 prcmu_timer_base = __io_address(U5500_PRCMU_TIMER_3_BASE); 28 prcmu_timer_base = __io_address(U5500_PRCMU_TIMER_3_BASE);
28 } else if (cpu_is_u8500()) { 29 } else if (cpu_is_u8500()) {
29#ifdef CONFIG_LOCAL_TIMERS 30#ifdef CONFIG_LOCAL_TIMERS
30 twd_base = __io_address(U8500_TWD_BASE); 31 twd_base = __io_address(U8500_TWD_BASE);
31#endif 32#endif
32 mtu_base = __io_address(U8500_MTU0_BASE); 33 mtu_timer_base = __io_address(U8500_MTU0_BASE);
33 prcmu_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE); 34 prcmu_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE);
34 } else { 35 } else {
35 ux500_unknown_soc(); 36 ux500_unknown_soc();
@@ -52,7 +53,7 @@ static void __init ux500_timer_init(void)
52 * 53 *
53 */ 54 */
54 55
55 nmdk_timer_init(); 56 nmdk_timer_init(mtu_timer_base);
56 clksrc_dbx500_prcmu_init(prcmu_timer_base); 57 clksrc_dbx500_prcmu_init(prcmu_timer_base);
57} 58}
58 59
diff --git a/arch/arm/plat-nomadik/include/plat/mtu.h b/arch/arm/plat-nomadik/include/plat/mtu.h
index 6508e7694a4..582641f3dc0 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 */ 4void nmdk_timer_init(void __iomem *base);
5extern void __iomem *mtu_base;
6
7void nmdk_clkevt_reset(void); 5void nmdk_clkevt_reset(void);
8void nmdk_clksrc_reset(void); 6void nmdk_clksrc_reset(void);
9 7
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c
index ad1b45b605a..46f50f24205 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
69static void __iomem *mtu_base;
69static bool clkevt_periodic; 70static bool clkevt_periodic;
70static u32 clk_prescale; 71static u32 clk_prescale;
71static u32 nmdk_cycle; /* write-once */ 72static u32 nmdk_cycle; /* write-once */
72 73
73void __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
186void __init nmdk_timer_init(void) 185void __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