aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/io.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2011-10-04 18:26:28 -0700
committerTony Lindgren <tony@atomide.com>2011-10-19 16:34:10 -0700
commit7b250aff1ce346b6c7bc0329a2350334d1c66525 (patch)
tree8508301ab376f1f95e30b5a63414dc52337bc906 /arch/arm/mach-omap2/io.c
parent7b88e62f5d219a86d81bdf4388012c97dc42e8f8 (diff)
ARM: OMAP: Avoid cpu_is_omapxxxx usage until map_io is done
This way we don't need to initialize SoC detection early and can start using generic map_io. Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/io.c')
-rw-r--r--arch/arm/mach-omap2/io.c95
1 files changed, 48 insertions, 47 deletions
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 15f91c42be6..e8123d01030 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -248,9 +248,6 @@ static void __init _omap2_map_common_io(void)
*/
local_flush_tlb_all();
flush_cache_all();
-
- omap2_check_revision();
- omap_sram_init();
}
#ifdef CONFIG_SOC_OMAP2420
@@ -337,33 +334,15 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
/* See irq.c, omap4-common.c and entry-macro.S */
void __iomem *omap_irq_base;
-void __init omap2_init_common_infrastructure(void)
+static void __init omap_common_init_early(void)
{
- u8 postsetup_state;
+ omap2_check_revision();
+ omap_sram_init();
+}
- if (cpu_is_omap242x()) {
- omap2xxx_voltagedomains_init();
- omap242x_powerdomains_init();
- omap242x_clockdomains_init();
- omap2420_hwmod_init();
- } else if (cpu_is_omap243x()) {
- omap2xxx_voltagedomains_init();
- omap243x_powerdomains_init();
- omap243x_clockdomains_init();
- omap2430_hwmod_init();
- } else if (cpu_is_omap34xx()) {
- omap3xxx_voltagedomains_init();
- omap3xxx_powerdomains_init();
- omap3xxx_clockdomains_init();
- omap3xxx_hwmod_init();
- } else if (cpu_is_omap44xx()) {
- omap44xx_voltagedomains_init();
- omap44xx_powerdomains_init();
- omap44xx_clockdomains_init();
- omap44xx_hwmod_init();
- } else {
- pr_err("Could not init hwmod data - unknown SoC\n");
- }
+static void __init omap_hwmod_init_postsetup(void)
+{
+ u8 postsetup_state;
/* Set the default postsetup state for all hwmods */
#ifdef CONFIG_PM_RUNTIME
@@ -392,57 +371,79 @@ void __init omap2_init_common_infrastructure(void)
&postsetup_state);
omap_pm_if_early_init();
-
- if (cpu_is_omap2420())
- omap2420_clk_init();
- else if (cpu_is_omap2430())
- omap2430_clk_init();
- else if (cpu_is_omap34xx())
- omap3xxx_clk_init();
- else if (cpu_is_omap44xx())
- omap4xxx_clk_init();
- else
- pr_err("Could not init clock framework - unknown SoC\n");
}
void __init omap2420_init_early(void)
{
- omap2_init_common_infrastructure();
+ omap_common_init_early();
+ omap2xxx_voltagedomains_init();
+ omap242x_powerdomains_init();
+ omap242x_clockdomains_init();
+ omap2420_hwmod_init();
+ omap_hwmod_init_postsetup();
+ omap2420_clk_init();
}
void __init omap2430_init_early(void)
{
- omap2_init_common_infrastructure();
+ omap_common_init_early();
+ omap2xxx_voltagedomains_init();
+ omap243x_powerdomains_init();
+ omap243x_clockdomains_init();
+ omap2430_hwmod_init();
+ omap_hwmod_init_postsetup();
+ omap2430_clk_init();
+}
+
+/*
+ * Currently only board-omap3beagle.c should call this because of the
+ * same machine_id for 34xx and 36xx beagle.. Will get fixed with DT.
+ */
+void __init omap3_init_early(void)
+{
+ omap_common_init_early();
+ omap3xxx_voltagedomains_init();
+ omap3xxx_powerdomains_init();
+ omap3xxx_clockdomains_init();
+ omap3xxx_hwmod_init();
+ omap_hwmod_init_postsetup();
+ omap3xxx_clk_init();
}
void __init omap3430_init_early(void)
{
- omap2_init_common_infrastructure();
+ omap3_init_early();
}
void __init omap35xx_init_early(void)
{
- omap2_init_common_infrastructure();
+ omap3_init_early();
}
void __init omap3630_init_early(void)
{
- omap2_init_common_infrastructure();
+ omap3_init_early();
}
void __init am35xx_init_early(void)
{
- omap2_init_common_infrastructure();
+ omap3_init_early();
}
void __init ti816x_init_early(void)
{
- omap2_init_common_infrastructure();
+ omap3_init_early();
}
void __init omap4430_init_early(void)
{
- omap2_init_common_infrastructure();
+ omap_common_init_early();
+ omap44xx_voltagedomains_init();
+ omap44xx_powerdomains_init();
+ omap44xx_clockdomains_init();
+ omap44xx_hwmod_init();
+ omap_hwmod_init_postsetup();
+ omap4xxx_clk_init();
}
void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,