linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] omap: hwmod: Populate _mpu_rt_va later on in omap_hwmod_late_init
Date: Tue, 25 Jan 2011 11:27:20 -0800	[thread overview]
Message-ID: <20110125192719.GO13589@atomide.com> (raw)
In-Reply-To: <20110125022119.GG13589@atomide.com>

Otherwise ioremap can fail with early_init patch unless we have
a static mapping for everything.

Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index eacdfd3..9e89a58 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1467,12 +1467,10 @@ static int __init _register(struct omap_hwmod *oh)
 		return -EEXIST;
 
 	ms_id = _find_mpu_port_index(oh);
-	if (!IS_ERR_VALUE(ms_id)) {
+	if (!IS_ERR_VALUE(ms_id))
 		oh->_mpu_port_index = ms_id;
-		oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index);
-	} else {
+	else
 		oh->_int_flags |= _HWMOD_NO_MPU_PORT;
-	}
 
 	list_add_tail(&oh->node, &omap_hwmod_list);
 
@@ -1621,6 +1619,26 @@ int __init omap_hwmod_init(struct omap_hwmod **ohs)
 	return 0;
 }
 
+/*
+ * _populate_mpu_rt_base - populate the virtual address for a hwmod
+ *
+ * Must be called only from omap_hwmod_late_init so ioremap works properly.
+ * Assumes the caller takes care of locking if needed.
+ *
+ */
+static int __init _populate_mpu_rt_base(struct omap_hwmod *oh, void *data)
+{
+	if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
+		return 0;
+
+	oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index);
+	if (!oh->_mpu_rt_va)
+		pr_warning("omap_hwmod: %s found no _mpu_rt_va for %s\n",
+				__func__, oh->name);
+
+	return 0;
+}
+
 /**
  * omap_hwmod_late_init - do some post-clock framework initialization
  *
@@ -1632,6 +1650,8 @@ static int __init omap_hwmod_late_init(void)
 {
 	int r;
 
+	r = omap_hwmod_for_each(_populate_mpu_rt_base, NULL);
+
 	/* XXX check return value */
 	r = omap_hwmod_for_each(_init_clocks, NULL);
 	WARN(r, "omap_hwmod: omap_hwmod_late_init(): _init_clocks failed\n");

  parent reply	other threads:[~2011-01-25 19:27 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-23 17:13 [PATCH] ARM: OMAP2: use early init hook Russell King - ARM Linux
2011-01-23 17:48 ` Russell King - ARM Linux
2011-01-24 20:17   ` Tony Lindgren
2011-01-24 20:26     ` Tony Lindgren
2011-01-24 21:52       ` Russell King - ARM Linux
2011-01-25  2:21         ` Tony Lindgren
2011-01-25  2:24           ` [PATCH] omap2+: Make omap_hwmod_late_init into core_initcall Tony Lindgren
2011-01-25  2:25           ` [PATCH] omap2+: Fix omap_serial_early_init to work with init_early hook Tony Lindgren
2011-01-27 18:01             ` Kevin Hilman
2011-01-25 19:27           ` Tony Lindgren [this message]
2011-01-25 19:29           ` [PATCH] ARM: OMAP2: use early init hook Tony Lindgren
2011-01-25 15:46     ` Poddar, Sourav
2011-01-25 19:28       ` Tony Lindgren
2011-01-26 10:16         ` Poddar, Sourav
2011-02-14 23:45     ` Tony Lindgren
2011-02-14 23:52       ` [PATCH] omap: Move omap2_check_revision and omap_sram_init out of map_io Tony Lindgren
2011-02-15  1:53         ` Tony Lindgren
2011-02-16 17:20           ` Tony Lindgren
2011-01-24 20:19 ` [PATCH] ARM: OMAP2: use early init hook Tony Lindgren
2011-01-26  8:46 ` Uwe Kleine-König
2011-01-26  8:52   ` Russell King - ARM Linux
2011-01-26  9:11     ` Uwe Kleine-König
2011-01-26 10:31       ` Russell King - ARM Linux
2011-02-07 15:35         ` [PATCH 1/4] ARM: imx: use .init_early to initialize cpu type and reset address Uwe Kleine-König
2011-02-07 15:35         ` [PATCH 2/4] ARM: mx3: use .init_early to initialize cpu type, reset address and iomuxer Uwe Kleine-König
2011-02-07 15:35         ` [PATCH 3/4] ARM: mx5: " Uwe Kleine-König
2011-02-07 15:35         ` [PATCH 4/4] ARM: mxc91231: use .init_early to initialize cpu type Uwe Kleine-König

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=20110125192719.GO13589@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).