ARM: davinci: use machine specific hook for late init
authorShawn Guo <shawn.guo@linaro.org>
Thu, 26 Apr 2012 01:45:39 +0000 (09:45 +0800)
committerShawn Guo <shawn.guo@linaro.org>
Sat, 5 May 2012 06:20:01 +0000 (14:20 +0800)
Cc: Kevin Hilman <khilman@ti.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Sekhar Nori <nsekhar@ti.com>
17 files changed:
arch/arm/mach-davinci/board-da830-evm.c
arch/arm/mach-davinci/board-da850-evm.c
arch/arm/mach-davinci/board-dm355-evm.c
arch/arm/mach-davinci/board-dm355-leopard.c
arch/arm/mach-davinci/board-dm365-evm.c
arch/arm/mach-davinci/board-dm644x-evm.c
arch/arm/mach-davinci/board-dm646x-evm.c
arch/arm/mach-davinci/board-mityomapl138.c
arch/arm/mach-davinci/board-neuros-osd2.c
arch/arm/mach-davinci/board-omapl138-hawk.c
arch/arm/mach-davinci/board-sffsdr.c
arch/arm/mach-davinci/board-tnetv107x-evm.c
arch/arm/mach-davinci/clock.c
arch/arm/mach-davinci/common.c
arch/arm/mach-davinci/cpufreq.c
arch/arm/mach-davinci/include/mach/common.h
arch/arm/mach-davinci/pm.c

index dc1afe5be20cc3d305c178faaec0bfd1633e4e3f..0031864e7f116908b23b94a0a7a1df8d13e33b69 100644 (file)
@@ -681,6 +681,7 @@ MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM")
        .init_irq       = cp_intc_init,
        .timer          = &davinci_timer,
        .init_machine   = da830_evm_init,
+       .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
        .restart        = da8xx_restart,
 MACHINE_END
index a70de24d1cbc5ea112e43c54db3b2183d5f53ba1..280cbeda708c38c56de0ef9ea20ebc48a77f6ef5 100644 (file)
@@ -1411,6 +1411,7 @@ MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM")
        .init_irq       = cp_intc_init,
        .timer          = &davinci_timer,
        .init_machine   = da850_evm_init,
+       .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
        .restart        = da8xx_restart,
 MACHINE_END
index 82ed753fb36088936014a434c85378890647aefa..1c7b1f46a8f3c3c42284c6e954526fe8b555fa2b 100644 (file)
@@ -357,6 +357,7 @@ MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM")
        .init_irq     = davinci_irq_init,
        .timer        = &davinci_timer,
        .init_machine = dm355_evm_init,
+       .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
        .restart        = davinci_restart,
 MACHINE_END
index d74a8b3445fbc2cfd6958248cadf6fd04398000c..8e7703213b0822102c8475afe9405865ec6ba8f6 100644 (file)
@@ -276,6 +276,7 @@ MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard")
        .init_irq     = davinci_irq_init,
        .timer        = &davinci_timer,
        .init_machine = dm355_leopard_init,
+       .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
        .restart        = davinci_restart,
 MACHINE_END
index 5bce2b83bb4fcde59938104b12f76caae6de8594..688a9c556dc9081e518627095ad94f62724a98ad 100644 (file)
@@ -618,6 +618,7 @@ MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM")
        .init_irq       = davinci_irq_init,
        .timer          = &davinci_timer,
        .init_machine   = dm365_evm_init,
+       .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
        .restart        = davinci_restart,
 MACHINE_END
index 3683306e02453e4d0bf5feb8b943c79a031745b8..d34ed55912b2efd1217a0cb8d5a84bc5b271e232 100644 (file)
@@ -825,6 +825,7 @@ MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
        .init_irq     = davinci_irq_init,
        .timer        = &davinci_timer,
        .init_machine = davinci_evm_init,
+       .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
        .restart        = davinci_restart,
 MACHINE_END
index d72ab948d6309a26f7b79fdef5208d7e0ca6f88a..958679a20e13d3ec018e5b974ae35e1e17d400c0 100644 (file)
@@ -788,6 +788,7 @@ MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
        .init_irq     = davinci_irq_init,
        .timer        = &davinci_timer,
        .init_machine = evm_init,
+       .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
        .restart        = davinci_restart,
 MACHINE_END
@@ -798,6 +799,7 @@ MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
        .init_irq     = davinci_irq_init,
        .timer        = &davinci_timer,
        .init_machine = evm_init,
+       .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
        .restart        = davinci_restart,
 MACHINE_END
index 672d820e2aa4c73d93fe128cd233d99ae2fa8eaa..beecde3a1d2f9a830362cb89aa9d6e7a249b9ae6 100644 (file)
@@ -572,6 +572,7 @@ MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808")
        .init_irq       = cp_intc_init,
        .timer          = &davinci_timer,
        .init_machine   = mityomapl138_init,
+       .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
        .restart        = da8xx_restart,
 MACHINE_END
index a772bb45570a7e92de29de7aa70a1a2f4250951f..5de69f2fcca9fec965fc300b506056c4a1f29e01 100644 (file)
@@ -278,6 +278,7 @@ MACHINE_START(NEUROS_OSD2, "Neuros OSD2")
        .init_irq       = davinci_irq_init,
        .timer          = &davinci_timer,
        .init_machine = davinci_ntosd2_init,
+       .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
        .restart        = davinci_restart,
 MACHINE_END
index 45e815760a27fd0cfc0f2965590eb90a1779b240..dc1208e9e664649718f2e2f4935cd5e9cc5dc86e 100644 (file)
@@ -343,6 +343,7 @@ MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard")
        .init_irq       = cp_intc_init,
        .timer          = &davinci_timer,
        .init_machine   = omapl138_hawk_init,
+       .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
        .restart        = da8xx_restart,
 MACHINE_END
index 76e675096104d8edc85c664d776bf341327909a6..9078acf94bacfe211c8ec3ff24a427eae6f11895 100644 (file)
@@ -157,6 +157,7 @@ MACHINE_START(SFFSDR, "Lyrtech SFFSDR")
        .init_irq     = davinci_irq_init,
        .timer        = &davinci_timer,
        .init_machine = davinci_sffsdr_init,
+       .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
        .restart        = davinci_restart,
 MACHINE_END
index 5f14e30b00d896a79c83ded76929543c956fb93f..ac4e003ad86336e61cb4774a0934f437bbfdfaca 100644 (file)
@@ -282,6 +282,7 @@ MACHINE_START(TNETV107X, "TNETV107X EVM")
        .init_irq       = cp_intc_init,
        .timer          = &davinci_timer,
        .init_machine   = tnetv107x_evm_board_init,
+       .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
        .restart        = tnetv107x_restart,
 MACHINE_END
index 008772e3b84321463c850c272065f4b0bc2d341a..34668ead53c73b1c70ee0b09261ba74ff8a3627b 100644 (file)
@@ -213,7 +213,7 @@ EXPORT_SYMBOL(clk_unregister);
 /*
  * Disable any unused clocks left on by the bootloader
  */
-static int __init clk_disable_unused(void)
+int __init davinci_clk_disable_unused(void)
 {
        struct clk *ck;
 
@@ -237,7 +237,6 @@ static int __init clk_disable_unused(void)
 
        return 0;
 }
-late_initcall(clk_disable_unused);
 #endif
 
 static unsigned long clk_sysclk_recalc(struct clk *clk)
index cb9b2e47510c8de2118bd80364f4b60b4308e07b..64b0f65a8639aa919173b597c8134e55192972b6 100644 (file)
@@ -117,3 +117,10 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info)
 err:
        panic("davinci_common_init: SoC Initialization failed\n");
 }
+
+void __init davinci_init_late(void)
+{
+       davinci_cpufreq_init();
+       davinci_pm_init();
+       davinci_clk_disable_unused();
+}
index 031048fec9f5e2d175707eea2c4ed0d2edd395a2..4729eaab0f403e90c83ae2799d37b1521831efb1 100644 (file)
@@ -240,10 +240,9 @@ static struct platform_driver davinci_cpufreq_driver = {
        .remove = __exit_p(davinci_cpufreq_remove),
 };
 
-static int __init davinci_cpufreq_init(void)
+int __init davinci_cpufreq_init(void)
 {
        return platform_driver_probe(&davinci_cpufreq_driver,
                                                        davinci_cpufreq_probe);
 }
-late_initcall(davinci_cpufreq_init);
 
index 5cd39a4e0c966d4823d2c438edf8376216f35ae6..bdc4aa8e672ac98349d10c9059e063b1294e40dc 100644 (file)
@@ -84,6 +84,25 @@ extern struct davinci_soc_info davinci_soc_info;
 extern void davinci_common_init(struct davinci_soc_info *soc_info);
 extern void davinci_init_ide(void);
 void davinci_restart(char mode, const char *cmd);
+void davinci_init_late(void);
+
+#ifdef CONFIG_DAVINCI_RESET_CLOCKS
+int davinci_clk_disable_unused(void);
+#else
+static inline int davinci_clk_disable_unused(void) { return 0; }
+#endif
+
+#ifdef CONFIG_CPU_FREQ
+int davinci_cpufreq_init(void);
+#else
+static inline int davinci_cpufreq_init(void) { return 0; }
+#endif
+
+#ifdef CONFIG_SUSPEND
+int davinci_pm_init(void);
+#else
+static inline int davinci_pm_init(void) { return 0; }
+#endif
 
 /* standard place to map on-chip SRAMs; they *may* support DMA */
 #define SRAM_VIRT      0xfffe0000
index 04c49f7543ef0df4a30a52c5c862f623222a93cd..eb8360b33aa9d4528a73562c585186949fe38657 100644 (file)
@@ -152,8 +152,7 @@ static struct platform_driver davinci_pm_driver = {
        .remove = __exit_p(davinci_pm_remove),
 };
 
-static int __init davinci_pm_init(void)
+int __init davinci_pm_init(void)
 {
        return platform_driver_probe(&davinci_pm_driver, davinci_pm_probe);
 }
-late_initcall(davinci_pm_init);