From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/3] mvebu: armada-370-xp: simplify soc init code flow
Date: Wed, 15 Feb 2017 17:42:46 +0100 [thread overview]
Message-ID: <20170215164248.31952-1-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20170214105358.6666-1-u.kleine-koenig@pengutronix.de>
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. It also only calls
mvebu_mbus_add_range if we're running on an Armada 370 or XP and inlines
a simple function.
The initcall must be postponed to post-core to ensure
of_machine_is_compatible is working correctly.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
arch/arm/mach-mvebu/armada-370-xp.c | 34 +++++++++++-----------------------
1 file changed, 11 insertions(+), 23 deletions(-)
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c
index 5fb207594fd4..196b770277f3 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.c
+++ b/arch/arm/mach-mvebu/armada-370-xp.c
@@ -83,25 +83,16 @@ static void __noreturn armada_370_xp_restart_soc(struct restart_handler *rst)
hang();
}
-static int armada_xp_init_soc(struct device_node *root)
-{
- u32 reg;
-
- /* Enable GBE0, GBE1, LCD and NFC PUP */
- reg = readl(ARMADA_XP_PUP_ENABLE);
- reg |= GE0_PUP_EN | GE1_PUP_EN | LCD_PUP_EN | NAND_PUP_EN | SPI_PUP_EN;
- writel(reg, ARMADA_XP_PUP_ENABLE);
-
- return 0;
-}
-
-static int armada_370_xp_init_soc(struct device_node *root, void *context)
+static int armada_370_xp_init_soc(void)
{
u32 reg;
if (!of_machine_is_compatible("marvell,armada-370-xp"))
return 0;
+ mvebu_mbus_add_range("marvell,armada-370-xp", 0xf0, 0x01,
+ MVEBU_REMAP_INT_REG_BASE);
+
restart_handler_register_fn(armada_370_xp_restart_soc);
barebox_set_model("Marvell Armada 370/XP");
@@ -116,16 +107,13 @@ static int armada_370_xp_init_soc(struct device_node *root, void *context)
armada_xp_soc_id_fixup();
- if (of_machine_is_compatible("marvell,armadaxp"))
- armada_xp_init_soc(root);
+ if (of_machine_is_compatible("marvell,armadaxp")) {
+ /* Enable GBE0, GBE1, LCD and NFC PUP */
+ reg = readl(ARMADA_XP_PUP_ENABLE);
+ reg |= GE0_PUP_EN | GE1_PUP_EN | LCD_PUP_EN | NAND_PUP_EN | SPI_PUP_EN;
+ writel(reg, ARMADA_XP_PUP_ENABLE);
+ }
return 0;
}
-
-static int armada_370_xp_register_soc_fixup(void)
-{
- mvebu_mbus_add_range("marvell,armada-370-xp", 0xf0, 0x01,
- MVEBU_REMAP_INT_REG_BASE);
- return of_register_fixup(armada_370_xp_init_soc, NULL);
-}
-pure_initcall(armada_370_xp_register_soc_fixup);
+postcore_initcall(armada_370_xp_init_soc);
--
2.11.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2017-02-15 16:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-14 10:53 [PATCH 1/3] mvebu: simplify detection and fixup of MV78230-A0 Uwe Kleine-König
2017-02-14 10:53 ` [PATCH 2/3] mvebu: remove unused function barebox_arm_reset_vector Uwe Kleine-König
2017-02-14 10:53 ` [PATCH 3/3] mvebu: rework how memory is detected Uwe Kleine-König
2017-02-15 16:31 ` [PATCH 3/3] fixup! " Uwe Kleine-König
2017-02-15 16:42 ` Uwe Kleine-König [this message]
2017-02-15 16:42 ` [PATCH 5/3] mvebu: dove: simplify soc init code flow Uwe Kleine-König
2017-02-15 16:42 ` [PATCH 6/3] mvebu: kirkwood: " Uwe Kleine-König
2017-02-16 7:17 ` 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=20170215164248.31952-1-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