From b42055fb5c1712348a757d766dbd7c09140cfe66 Mon Sep 17 00:00:00 2001
From: Tero Kristo <t-kristo@ti.com>
Date: Thu, 23 Jan 2014 14:24:57 +0200
Subject: [PATCH] ARM: OMAP3: change all omap3 boards to use common early_init
early_init now checks the cpu type for the corresponding clock init
function. Mainly needed by the overo board which can have almost
any OMAP3 subtype installed on it.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
arch/arm/mach-omap2/board-3430sdp.c | 2 +-
arch/arm/mach-omap2/board-am3517crane.c | 2 +-
arch/arm/mach-omap2/board-am3517evm.c | 2 +-
arch/arm/mach-omap2/board-cm-t35.c | 4 ++--
arch/arm/mach-omap2/board-cm-t3517.c | 2 +-
arch/arm/mach-omap2/board-devkit8000.c | 2 +-
arch/arm/mach-omap2/board-generic.c | 8 +++----
arch/arm/mach-omap2/board-ldp.c | 2 +-
arch/arm/mach-omap2/board-omap3logic.c | 4 ++--
arch/arm/mach-omap2/board-omap3pandora.c | 2 +-
arch/arm/mach-omap2/board-omap3stalker.c | 2 +-
arch/arm/mach-omap2/board-omap3touchbook.c | 2 +-
arch/arm/mach-omap2/board-overo.c | 2 +-
arch/arm/mach-omap2/board-rx51.c | 2 +-
arch/arm/mach-omap2/io.c | 35 +++++++---------------------
15 files changed, 27 insertions(+), 46 deletions(-)
@@ -623,7 +623,7 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = omap3430_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap3_init_irq,
.handle_irq = omap3_intc_handle_irq,
.init_machine = omap_3430sdp_init,
@@ -140,7 +140,7 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = am35xx_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap3_init_irq,
.handle_irq = omap3_intc_handle_irq,
.init_machine = am3517_crane_init,
@@ -369,7 +369,7 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = am35xx_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap3_init_irq,
.handle_irq = omap3_intc_handle_irq,
.init_machine = am3517_evm_init,
@@ -748,7 +748,7 @@ MACHINE_START(CM_T35, "Compulab CM-T35")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = omap35xx_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap3_init_irq,
.handle_irq = omap3_intc_handle_irq,
.init_machine = cm_t35_init,
@@ -761,7 +761,7 @@ MACHINE_START(CM_T3730, "Compulab CM-T3730")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = omap3630_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap3_init_irq,
.handle_irq = omap3_intc_handle_irq,
.init_machine = cm_t3730_init,
@@ -327,7 +327,7 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = am35xx_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap3_init_irq,
.handle_irq = omap3_intc_handle_irq,
.init_machine = cm_t3517_init,
@@ -645,7 +645,7 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = omap35xx_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap3_init_irq,
.handle_irq = omap3_intc_handle_irq,
.init_machine = devkit8000_init,
@@ -85,7 +85,7 @@ static const char *omap3_boards_compat[] __initdata = {
DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = omap3430_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap_intc_of_init,
.handle_irq = omap3_intc_handle_irq,
.init_machine = omap_generic_init,
@@ -103,7 +103,7 @@ static const char *omap36xx_boards_compat[] __initdata = {
DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened Device Tree)")
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = omap3630_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap_intc_of_init,
.handle_irq = omap3_intc_handle_irq,
.init_machine = omap_generic_init,
@@ -122,7 +122,7 @@ static const char *omap3_gp_boards_compat[] __initdata = {
DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)")
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = omap3430_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap_intc_of_init,
.handle_irq = omap3_intc_handle_irq,
.init_machine = omap_generic_init,
@@ -140,7 +140,7 @@ static const char *am3517_boards_compat[] __initdata = {
DT_MACHINE_START(AM3517_DT, "Generic AM3517 (Flattened Device Tree)")
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = am35xx_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap_intc_of_init,
.handle_irq = omap3_intc_handle_irq,
.init_machine = omap_generic_init,
@@ -420,7 +420,7 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = omap3430_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap3_init_irq,
.handle_irq = omap3_intc_handle_irq,
.init_machine = omap_ldp_init,
@@ -228,7 +228,7 @@ MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = omap35xx_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap3_init_irq,
.handle_irq = omap3_intc_handle_irq,
.init_machine = omap3logic_init,
@@ -241,7 +241,7 @@ MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = omap35xx_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap3_init_irq,
.handle_irq = omap3_intc_handle_irq,
.init_machine = omap3logic_init,
@@ -620,7 +620,7 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = omap35xx_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap3_init_irq,
.handle_irq = omap3_intc_handle_irq,
.init_machine = omap3pandora_init,
@@ -428,7 +428,7 @@ MACHINE_START(SBC3530, "OMAP3 STALKER")
/* Maintainer: Jason Lam -lzg@ema-tech.com */
.atag_offset = 0x100,
.map_io = omap3_map_io,
- .init_early = omap35xx_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap3_init_irq,
.handle_irq = omap3_intc_handle_irq,
.init_machine = omap3_stalker_init,
@@ -386,7 +386,7 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = omap3430_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap3_init_irq,
.handle_irq = omap3_intc_handle_irq,
.init_machine = omap3_touchbook_init,
@@ -562,7 +562,7 @@ MACHINE_START(OVERO, "Gumstix Overo")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap3_map_io,
- .init_early = omap35xx_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap3_init_irq,
.handle_irq = omap3_intc_handle_irq,
.init_machine = overo_init,
@@ -132,7 +132,7 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
.atag_offset = 0x100,
.reserve = rx51_reserve,
.map_io = omap3_map_io,
- .init_early = omap3430_init_early,
+ .init_early = omap3_init_early,
.init_irq = omap3_init_irq,
.handle_irq = omap3_intc_handle_irq,
.init_machine = rx51_init,
@@ -483,34 +483,15 @@ void __init omap3_init_early(void)
omap3xxx_hwmod_init();
omap_hwmod_init_postsetup();
omap_clk_soc_init = omap3xxx_clk_init;
-}
-
-void __init omap3430_init_early(void)
-{
- omap3_init_early();
- if (of_have_populated_dt())
- omap_clk_soc_init = omap3430_dt_clk_init;
-}
-
-void __init omap35xx_init_early(void)
-{
- omap3_init_early();
- if (of_have_populated_dt())
- omap_clk_soc_init = omap3430_dt_clk_init;
-}
-
-void __init omap3630_init_early(void)
-{
- omap3_init_early();
- if (of_have_populated_dt())
- omap_clk_soc_init = omap3630_dt_clk_init;
-}
-void __init am35xx_init_early(void)
-{
- omap3_init_early();
- if (of_have_populated_dt())
- omap_clk_soc_init = am35xx_dt_clk_init;
+ if (of_have_populated_dt()) {
+ if (soc_is_am35xx())
+ omap_clk_soc_init = am35xx_dt_clk_init;
+ else if (cpu_is_omap3630())
+ omap_clk_soc_init = omap3630_dt_clk_init;
+ else if (cpu_is_omap34xx())
+ omap_clk_soc_init = omap3430_dt_clk_init;
+ }
}
void __init ti81xx_init_early(void)
--
1.7.9.5