Commit 3aa3e840 authored by Shawn Guo's avatar Shawn Guo

ARM: davinci: use machine specific hook for late init

Cc: Kevin Hilman <khilman@ti.com>
Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
Acked-by: default avatarSekhar Nori <nsekhar@ti.com>
parent 90de4137
...@@ -681,6 +681,7 @@ MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM") ...@@ -681,6 +681,7 @@ MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM")
.init_irq = cp_intc_init, .init_irq = cp_intc_init,
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = da830_evm_init, .init_machine = da830_evm_init,
.init_late = davinci_init_late,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = da8xx_restart, .restart = da8xx_restart,
MACHINE_END MACHINE_END
...@@ -1411,6 +1411,7 @@ MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM") ...@@ -1411,6 +1411,7 @@ MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM")
.init_irq = cp_intc_init, .init_irq = cp_intc_init,
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = da850_evm_init, .init_machine = da850_evm_init,
.init_late = davinci_init_late,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = da8xx_restart, .restart = da8xx_restart,
MACHINE_END MACHINE_END
...@@ -357,6 +357,7 @@ MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM") ...@@ -357,6 +357,7 @@ MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM")
.init_irq = davinci_irq_init, .init_irq = davinci_irq_init,
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = dm355_evm_init, .init_machine = dm355_evm_init,
.init_late = davinci_init_late,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart, .restart = davinci_restart,
MACHINE_END MACHINE_END
...@@ -276,6 +276,7 @@ MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard") ...@@ -276,6 +276,7 @@ MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard")
.init_irq = davinci_irq_init, .init_irq = davinci_irq_init,
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = dm355_leopard_init, .init_machine = dm355_leopard_init,
.init_late = davinci_init_late,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart, .restart = davinci_restart,
MACHINE_END MACHINE_END
...@@ -618,6 +618,7 @@ MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM") ...@@ -618,6 +618,7 @@ MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM")
.init_irq = davinci_irq_init, .init_irq = davinci_irq_init,
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = dm365_evm_init, .init_machine = dm365_evm_init,
.init_late = davinci_init_late,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart, .restart = davinci_restart,
MACHINE_END MACHINE_END
......
...@@ -825,6 +825,7 @@ MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM") ...@@ -825,6 +825,7 @@ MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
.init_irq = davinci_irq_init, .init_irq = davinci_irq_init,
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = davinci_evm_init, .init_machine = davinci_evm_init,
.init_late = davinci_init_late,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart, .restart = davinci_restart,
MACHINE_END MACHINE_END
...@@ -788,6 +788,7 @@ MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM") ...@@ -788,6 +788,7 @@ MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
.init_irq = davinci_irq_init, .init_irq = davinci_irq_init,
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = evm_init, .init_machine = evm_init,
.init_late = davinci_init_late,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart, .restart = davinci_restart,
MACHINE_END MACHINE_END
...@@ -798,6 +799,7 @@ MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM") ...@@ -798,6 +799,7 @@ MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
.init_irq = davinci_irq_init, .init_irq = davinci_irq_init,
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = evm_init, .init_machine = evm_init,
.init_late = davinci_init_late,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart, .restart = davinci_restart,
MACHINE_END MACHINE_END
......
...@@ -572,6 +572,7 @@ MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808") ...@@ -572,6 +572,7 @@ MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808")
.init_irq = cp_intc_init, .init_irq = cp_intc_init,
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = mityomapl138_init, .init_machine = mityomapl138_init,
.init_late = davinci_init_late,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = da8xx_restart, .restart = da8xx_restart,
MACHINE_END MACHINE_END
...@@ -278,6 +278,7 @@ MACHINE_START(NEUROS_OSD2, "Neuros OSD2") ...@@ -278,6 +278,7 @@ MACHINE_START(NEUROS_OSD2, "Neuros OSD2")
.init_irq = davinci_irq_init, .init_irq = davinci_irq_init,
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = davinci_ntosd2_init, .init_machine = davinci_ntosd2_init,
.init_late = davinci_init_late,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart, .restart = davinci_restart,
MACHINE_END MACHINE_END
...@@ -343,6 +343,7 @@ MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard") ...@@ -343,6 +343,7 @@ MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard")
.init_irq = cp_intc_init, .init_irq = cp_intc_init,
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = omapl138_hawk_init, .init_machine = omapl138_hawk_init,
.init_late = davinci_init_late,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = da8xx_restart, .restart = da8xx_restart,
MACHINE_END MACHINE_END
...@@ -157,6 +157,7 @@ MACHINE_START(SFFSDR, "Lyrtech SFFSDR") ...@@ -157,6 +157,7 @@ MACHINE_START(SFFSDR, "Lyrtech SFFSDR")
.init_irq = davinci_irq_init, .init_irq = davinci_irq_init,
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = davinci_sffsdr_init, .init_machine = davinci_sffsdr_init,
.init_late = davinci_init_late,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart, .restart = davinci_restart,
MACHINE_END MACHINE_END
...@@ -282,6 +282,7 @@ MACHINE_START(TNETV107X, "TNETV107X EVM") ...@@ -282,6 +282,7 @@ MACHINE_START(TNETV107X, "TNETV107X EVM")
.init_irq = cp_intc_init, .init_irq = cp_intc_init,
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = tnetv107x_evm_board_init, .init_machine = tnetv107x_evm_board_init,
.init_late = davinci_init_late,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = tnetv107x_restart, .restart = tnetv107x_restart,
MACHINE_END MACHINE_END
...@@ -213,7 +213,7 @@ EXPORT_SYMBOL(clk_unregister); ...@@ -213,7 +213,7 @@ EXPORT_SYMBOL(clk_unregister);
/* /*
* Disable any unused clocks left on by the bootloader * 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; struct clk *ck;
...@@ -237,7 +237,6 @@ static int __init clk_disable_unused(void) ...@@ -237,7 +237,6 @@ static int __init clk_disable_unused(void)
return 0; return 0;
} }
late_initcall(clk_disable_unused);
#endif #endif
static unsigned long clk_sysclk_recalc(struct clk *clk) static unsigned long clk_sysclk_recalc(struct clk *clk)
......
...@@ -117,3 +117,10 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info) ...@@ -117,3 +117,10 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info)
err: err:
panic("davinci_common_init: SoC Initialization failed\n"); panic("davinci_common_init: SoC Initialization failed\n");
} }
void __init davinci_init_late(void)
{
davinci_cpufreq_init();
davinci_pm_init();
davinci_clk_disable_unused();
}
...@@ -240,10 +240,9 @@ static struct platform_driver davinci_cpufreq_driver = { ...@@ -240,10 +240,9 @@ static struct platform_driver davinci_cpufreq_driver = {
.remove = __exit_p(davinci_cpufreq_remove), .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, return platform_driver_probe(&davinci_cpufreq_driver,
davinci_cpufreq_probe); davinci_cpufreq_probe);
} }
late_initcall(davinci_cpufreq_init);
...@@ -84,6 +84,25 @@ extern struct davinci_soc_info davinci_soc_info; ...@@ -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_common_init(struct davinci_soc_info *soc_info);
extern void davinci_init_ide(void); extern void davinci_init_ide(void);
void davinci_restart(char mode, const char *cmd); 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 */ /* standard place to map on-chip SRAMs; they *may* support DMA */
#define SRAM_VIRT 0xfffe0000 #define SRAM_VIRT 0xfffe0000
......
...@@ -152,8 +152,7 @@ static struct platform_driver davinci_pm_driver = { ...@@ -152,8 +152,7 @@ static struct platform_driver davinci_pm_driver = {
.remove = __exit_p(davinci_pm_remove), .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); return platform_driver_probe(&davinci_pm_driver, davinci_pm_probe);
} }
late_initcall(davinci_pm_init);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment