ARM: plat-nomadik: get rid of global mtu base pointer
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 11 Jan 2012 08:46:59 +0000 (09:46 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 30 Jan 2012 23:05:24 +0000 (00:05 +0100)
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>
arch/arm/mach-nomadik/board-nhk8815.c
arch/arm/mach-nomadik/include/mach/setup.h [deleted file]
arch/arm/mach-ux500/include/mach/setup.h
arch/arm/mach-ux500/timer.c
arch/arm/plat-nomadik/include/plat/mtu.h
arch/arm/plat-nomadik/timer.c

index 7c878bf0034094fbbc8e31a933f9d091b4ae95f0..b77cb8465d313e7fb19d7ffb8ac29d08c6130843 100644 (file)
 #include <asm/mach/arch.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/flash.h>
+#include <asm/mach/time.h>
 
 #include <plat/gpio-nomadik.h>
 #include <plat/mtu.h>
 
-#include <mach/setup.h>
 #include <mach/nand.h>
 #include <mach/fsmc.h>
 
@@ -255,10 +255,7 @@ static void __init nomadik_timer_init(void)
        src_cr |= SRC_CR_INIT_VAL;
        writel(src_cr, io_p2v(NOMADIK_SRC_BASE));
 
-       /* Save global pointer to mtu, used by platform timer code */
-       mtu_base = io_p2v(NOMADIK_MTU0_BASE);
-
-       nmdk_timer_init();
+       nmdk_timer_init(io_p2v(NOMADIK_MTU0_BASE));
 }
 
 static 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 (file)
index bcaeaf4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-
-/*
- * These symbols are needed for board-specific files to call their
- * own cpu-specific files
- */
-
-#ifndef __ASM_ARCH_SETUP_H
-#define __ASM_ARCH_SETUP_H
-
-#include <asm/mach/time.h>
-#include <linux/init.h>
-
-#ifdef CONFIG_NOMADIK_8815
-
-extern void nmdk_timer_init(void);
-
-#endif /* NOMADIK_8815 */
-
-#endif /*  __ASM_ARCH_SETUP_H */
index a7d363fdb4cd7ba3f88591ffa7222f156e3c6a27..93d403955eaa5d452c9456cb17672d0936518658 100644 (file)
@@ -27,9 +27,6 @@ extern void __init u5500_sdi_init(void);
 
 extern void __init db5500_dma_init(void);
 
-/* We re-use nomadik_timer for this platform */
-extern void nmdk_timer_init(void);
-
 struct amba_device;
 extern void __init amba_add_devices(struct amba_device *devs[], int num);
 
index aea467d04ff7399506d92594dd9ecbc2adc81765..fd000243112257cafd29fc46e8f0f565842c6974 100644 (file)
 
 static void __init ux500_timer_init(void)
 {
+       void __iomem *mtu_timer_base;
        void __iomem *prcmu_timer_base;
 
        if (cpu_is_u5500()) {
 #ifdef CONFIG_LOCAL_TIMERS
                twd_base = __io_address(U5500_TWD_BASE);
 #endif
-               mtu_base = __io_address(U5500_MTU0_BASE);
+               mtu_timer_base = __io_address(U5500_MTU0_BASE);
                prcmu_timer_base = __io_address(U5500_PRCMU_TIMER_3_BASE);
        } else if (cpu_is_u8500()) {
 #ifdef CONFIG_LOCAL_TIMERS
                twd_base = __io_address(U8500_TWD_BASE);
 #endif
-               mtu_base = __io_address(U8500_MTU0_BASE);
+               mtu_timer_base = __io_address(U8500_MTU0_BASE);
                prcmu_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE);
        } else {
                ux500_unknown_soc();
@@ -52,7 +53,7 @@ static void __init ux500_timer_init(void)
         *
         */
 
-       nmdk_timer_init();
+       nmdk_timer_init(mtu_timer_base);
        clksrc_dbx500_prcmu_init(prcmu_timer_base);
 }
 
index 6508e7694a4b2275f2510ce25cea55028c02467e..582641f3dc01acf611f34edb846f741ded736d8c 100644 (file)
@@ -1,9 +1,7 @@
 #ifndef __PLAT_MTU_H
 #define __PLAT_MTU_H
 
-/* should be set by the platform code */
-extern void __iomem *mtu_base;
-
+void nmdk_timer_init(void __iomem *base);
 void nmdk_clkevt_reset(void);
 void nmdk_clksrc_reset(void);
 
index ad1b45b605a42b9441eb4b9d3d7a38485ba9ca9c..46f50f24205fb91df212b36bf10ab78f6d4fc401 100644 (file)
 #define MTU_PCELL2     0xff8
 #define MTU_PCELL3     0xffC
 
+static void __iomem *mtu_base;
 static bool clkevt_periodic;
 static u32 clk_prescale;
 static u32 nmdk_cycle;         /* write-once */
 
-void __iomem *mtu_base; /* Assigned by machine code */
-
 #ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK
 /*
  * Override the global weak sched_clock symbol with this
@@ -183,11 +182,12 @@ void nmdk_clksrc_reset(void)
               mtu_base + MTU_CR(0));
 }
 
-void __init nmdk_timer_init(void)
+void __init nmdk_timer_init(void __iomem *base)
 {
        unsigned long rate;
        struct clk *clk0;
 
+       mtu_base = base;
        clk0 = clk_get_sys("mtu0", NULL);
        BUG_ON(IS_ERR(clk0));
 
This page took 0.034636 seconds and 5 git commands to generate.