mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH v2 5/3] mvebu: dove: simplify soc init code flow
Date: Sat, 25 Feb 2017 21:40:21 +0100	[thread overview]
Message-ID: <20170225204022.12815-3-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20170225204022.12815-1-u.kleine-koenig@pengutronix.de>

Similar to the previous commit, this gets rid of a of-fixup which is
strange because the soc init stuff is rerun then when a new dt for
booting into Linux is loaded.

The initcall must be postponed to post-core to ensure
of_machine_is_compatible is working correctly.

The call to mvebu_mbus_add_range is moved to drivers/bus/mvebu-mbus.c to
ensure it's registered early enough.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/mach-mvebu/dove.c | 13 ++-----------
 drivers/bus/mvebu-mbus.c   |  9 +++++++++
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-mvebu/dove.c b/arch/arm/mach-mvebu/dove.c
index 9a3b05d004d5..1cdb7e1b8296 100644
--- a/arch/arm/mach-mvebu/dove.c
+++ b/arch/arm/mach-mvebu/dove.c
@@ -52,7 +52,7 @@ static void __noreturn dove_restart_soc(struct restart_handler *rst)
 	hang();
 }
 
-static int dove_init_soc(struct device_node *root, void *context)
+static int dove_init_soc(void)
 {
 	if (!of_machine_is_compatible("marvell,dove"))
 		return 0;
@@ -67,13 +67,4 @@ static int dove_init_soc(struct device_node *root, void *context)
 
 	return 0;
 }
-
-static int dove_register_soc_fixup(void)
-{
-	mvebu_mbus_add_range("marvell,dove", 0xf0, 0x01,
-			     MVEBU_REMAP_INT_REG_BASE);
-	mvebu_mbus_add_range("marvell,dove", 0xf0, 0x02,
-			     DOVE_REMAP_MC_REGS);
-	return of_register_fixup(dove_init_soc, NULL);
-}
-pure_initcall(dove_register_soc_fixup);
+postcore_initcall(dove_init_soc);
diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index b95c071d57a4..fc940e3b541d 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -811,6 +811,8 @@ static int mvebu_mbus_of_fixup(struct device_node *root, void *context)
 	return 0;
 }
 
+#define DOVE_REMAP_MC_REGS      0xf1800000
+
 static int mvebu_mbus_fixup_register(void)
 {
 	if (IS_ENABLED(CONFIG_ARCH_ARMADA_370) ||
@@ -818,6 +820,13 @@ static int mvebu_mbus_fixup_register(void)
 		mvebu_mbus_add_range("marvell,armada-370-xp", 0xf0, 0x01,
 				     MVEBU_REMAP_INT_REG_BASE);
 
+	if (IS_ENABLED(CONFIG_ARCH_DOVE)) {
+		mvebu_mbus_add_range("marvell,dove", 0xf0, 0x01,
+				     MVEBU_REMAP_INT_REG_BASE);
+		mvebu_mbus_add_range("marvell,dove", 0xf0, 0x02,
+				     DOVE_REMAP_MC_REGS);
+	}
+
 	return of_register_fixup(mvebu_mbus_of_fixup, NULL);
 }
 pure_initcall(mvebu_mbus_fixup_register);
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2017-02-25 20:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-25 20:40 [PATCH v2 3+0/3] retry on simplification of " Uwe Kleine-König
2017-02-25 20:40 ` [PATCH v2 4/3] mvebu: armada-370-xp: simplify soc " Uwe Kleine-König
2017-02-25 20:40 ` Uwe Kleine-König [this message]
2017-02-25 20:40 ` [PATCH v2 6/3] mvebu: kirkwood: " Uwe Kleine-König
2017-02-28  6:49 ` [PATCH v2 3+0/3] retry on simplification of " Sascha Hauer

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=20170225204022.12815-3-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=barebox@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