public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Subject: [PATCH 2/4] ARM: OMAP: Avoid cpu_is_omapxxxx usage until map_io is done
Date: Tue, 04 Oct 2011 17:45:42 -0700	[thread overview]
Message-ID: <20111005004542.26980.98554.stgit@kaulin.local> (raw)
In-Reply-To: <20111005004339.26980.31149.stgit@kaulin.local>

This way we don't need to initialize SoC detection early
and can start using generic map_io.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/board-omap3beagle.c  |    7 --
 arch/arm/mach-omap2/io.c                 |   91 ++++++++++++++++--------------
 arch/arm/plat-omap/include/plat/common.h |    1 
 3 files changed, 50 insertions(+), 49 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index e085371..4e5605d 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -444,11 +444,6 @@ static struct platform_device keys_gpio = {
 	},
 };
 
-static void __init omap3_beagle_init_early(void)
-{
-	omap2_init_common_infrastructure();
-}
-
 static struct platform_device *omap3_beagle_devices[] __initdata = {
 	&leds_gpio,
 	&keys_gpio,
@@ -555,7 +550,7 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
 	.boot_params	= 0x80000100,
 	.reserve	= omap_reserve,
 	.map_io		= omap3_map_io,
-	.init_early	= omap3_beagle_init_early,
+	.init_early	= omap3_init_early,
 	.init_irq	= omap3_init_irq,
 	.init_machine	= omap3_beagle_init,
 	.timer		= &omap3_secure_timer,
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 1a13b79..82230e1 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -247,9 +247,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
@@ -336,29 +333,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()) {
-		omap242x_powerdomains_init();
-		omap242x_clockdomains_init();
-		omap2420_hwmod_init();
-	} else if (cpu_is_omap243x()) {
-		omap243x_powerdomains_init();
-		omap243x_clockdomains_init();
-		omap2430_hwmod_init();
-	} else if (cpu_is_omap34xx()) {
-		omap3xxx_powerdomains_init();
-		omap3xxx_clockdomains_init();
-		omap3xxx_hwmod_init();
-	} else if (cpu_is_omap44xx()) {
-		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
@@ -387,57 +370,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,
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index abda2c7..5eac355 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -50,6 +50,7 @@ void omap2430_init_early(void);
 void omap3430_init_early(void);
 void omap35xx_init_early(void);
 void omap3630_init_early(void);
+void omap3_init_early(void);	/* Do not use this one */
 void am35xx_init_early(void);
 void ti816x_init_early(void);
 void omap4430_init_early(void);


  parent reply	other threads:[~2011-10-05  0:45 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-05  0:45 [PATCH 0/4] initialize omap SRAM later on with __arm_ioremap_exec() Tony Lindgren
2011-10-05  0:45 ` [PATCH 1/4] ARM: Add __arm_ioremap_exec for mapping external memory as MT_MEMORY Tony Lindgren
2011-10-05  1:00   ` Nicolas Pitre
2011-10-05 22:06     ` Tony Lindgren
2011-10-05 22:08       ` [PATCH 1.5/4] ARM: OMAP1: Use generic map_io, init_early and init_irq Tony Lindgren
2011-10-07  6:40       ` [PATCH 1/4] ARM: Add __arm_ioremap_exec for mapping external memory as MT_MEMORY Santosh Shilimkar
2011-10-07 14:43         ` Tony Lindgren
2011-10-07 15:03           ` Santosh Shilimkar
2011-10-07 15:11             ` Tony Lindgren
2011-10-07 17:39               ` Santosh Shilimkar
2011-10-07 18:16                 ` Tony Lindgren
2011-10-07 18:20                   ` Santosh Shilimkar
2011-10-07 18:27                     ` Tony Lindgren
2011-10-05  0:45 ` Tony Lindgren [this message]
2011-10-07  6:47   ` [PATCH 2/4] ARM: OMAP: Avoid cpu_is_omapxxxx usage until map_io is done Santosh Shilimkar
2011-10-05  0:45 ` [PATCH 3/4] ARM: OMAP: Remove calls to SRAM allocations for framebuffer Tony Lindgren
2011-10-05  6:45   ` Tomi Valkeinen
2011-10-05 22:41     ` Tony Lindgren
2011-10-06  8:38       ` Tomi Valkeinen
2011-10-06 16:22         ` Tony Lindgren
2011-10-05  0:45 ` [PATCH 4/4] ARM: OMAP: Map SRAM later on with ioremap_exec() Tony Lindgren
2011-10-05  1:07   ` Nicolas Pitre
2011-10-05 22:13     ` Tony Lindgren
2011-10-05 23:01       ` Nicolas Pitre
2011-10-07  6:52       ` Santosh Shilimkar
2011-10-07 14:55         ` Tony Lindgren
2011-10-05  1:40 ` [PATCH 5/4] ARM: OMAP: Move set_globals initialization to happen in init_early Tony Lindgren
2011-10-05  1:51   ` Nicolas Pitre
2011-10-06  1:36     ` Tony Lindgren
2011-10-07  6:56       ` Santosh Shilimkar
2011-10-07 14:54         ` Tony Lindgren
2011-10-07 23:26           ` Nicolas Pitre
2011-10-05  7:03 ` [PATCH 0/4] initialize omap SRAM later on with __arm_ioremap_exec() Santosh Shilimkar
2011-10-06  1:42   ` Tony Lindgren
2011-10-07  6:59     ` Santosh Shilimkar
2011-10-07 14:45       ` Tony Lindgren
2011-10-07 20:23       ` Nicolas Pitre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111005004542.26980.98554.stgit@kaulin.local \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox