mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2 3+0/3] retry on simplification of init code flow
@ 2017-02-25 20:40 Uwe Kleine-König
  2017-02-25 20:40 ` [PATCH v2 4/3] mvebu: armada-370-xp: simplify soc " Uwe Kleine-König
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2017-02-25 20:40 UTC (permalink / raw)
  To: barebox

Hello,

this series is v2 of [4-6]/3 from Feb 15 and is supposed to superseed
(implicit) v1 which is already in next.

The difference is that patch "mvebu: Fix fixup of mbus device-tree
ranges" is squashed into them and the commit log adapted accordingly.

Best regards
Uwe

Uwe Kleine-König (3):
  mvebu: armada-370-xp: simplify soc init code flow
  mvebu: dove: simplify soc init code flow
  mvebu: kirkwood: simplify soc init code flow

 arch/arm/mach-mvebu/armada-370-xp.c | 31 ++++++++-----------------------
 arch/arm/mach-mvebu/dove.c          | 13 ++-----------
 arch/arm/mach-mvebu/kirkwood.c      | 11 ++---------
 drivers/bus/mvebu-mbus.c            | 22 +++++++++++++++++++++-
 4 files changed, 33 insertions(+), 44 deletions(-)

-- 
2.11.0


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 4/3] mvebu: armada-370-xp: simplify soc init code flow
  2017-02-25 20:40 [PATCH v2 3+0/3] retry on simplification of init code flow Uwe Kleine-König
@ 2017-02-25 20:40 ` Uwe Kleine-König
  2017-02-25 20:40 ` [PATCH v2 5/3] mvebu: dove: " Uwe Kleine-König
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2017-02-25 20:40 UTC (permalink / raw)
  To: barebox

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/armada-370-xp.c | 31 ++++++++-----------------------
 drivers/bus/mvebu-mbus.c            |  9 ++++++++-
 2 files changed, 16 insertions(+), 24 deletions(-)

diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c
index 5fb207594fd4..93ad955a6e49 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.c
+++ b/arch/arm/mach-mvebu/armada-370-xp.c
@@ -83,19 +83,7 @@ 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;
 
@@ -116,16 +104,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);
diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index df5f7a32d346..b95c071d57a4 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -59,6 +59,7 @@
 #include <of.h>
 #include <of_address.h>
 #include <linux/mbus.h>
+#include <mach/common.h>
 
 /* DDR target is the same on all platforms */
 #define TARGET_DDR		0
@@ -810,7 +811,13 @@ static int mvebu_mbus_of_fixup(struct device_node *root, void *context)
 	return 0;
 }
 
-static int mvebu_mbus_fixup_register(void) {
+static int mvebu_mbus_fixup_register(void)
+{
+	if (IS_ENABLED(CONFIG_ARCH_ARMADA_370) ||
+	    IS_ENABLED(CONFIG_ARCH_ARMADA_XP))
+		mvebu_mbus_add_range("marvell,armada-370-xp", 0xf0, 0x01,
+				     MVEBU_REMAP_INT_REG_BASE);
+
 	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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 5/3] mvebu: dove: simplify soc init code flow
  2017-02-25 20:40 [PATCH v2 3+0/3] retry on simplification of init code flow 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
  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
  3 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2017-02-25 20:40 UTC (permalink / raw)
  To: barebox

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 6/3] mvebu: kirkwood: simplify soc init code flow
  2017-02-25 20:40 [PATCH v2 3+0/3] retry on simplification of init code flow 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 ` [PATCH v2 5/3] mvebu: dove: " Uwe Kleine-König
@ 2017-02-25 20:40 ` Uwe Kleine-König
  2017-02-28  6:49 ` [PATCH v2 3+0/3] retry on simplification of " Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2017-02-25 20:40 UTC (permalink / raw)
  To: barebox

Similar to the two previous commits, 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/kirkwood.c | 11 ++---------
 drivers/bus/mvebu-mbus.c       |  4 ++++
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-mvebu/kirkwood.c b/arch/arm/mach-mvebu/kirkwood.c
index d5ddf05e3447..59fb95ff4adf 100644
--- a/arch/arm/mach-mvebu/kirkwood.c
+++ b/arch/arm/mach-mvebu/kirkwood.c
@@ -29,7 +29,7 @@ static void __noreturn kirkwood_restart_soc(struct restart_handler *rst)
 	hang();
 }
 
-static int kirkwood_init_soc(struct device_node *root, void *context)
+static int kirkwood_init_soc(void)
 {
 	if (!of_machine_is_compatible("marvell,kirkwood"))
 		return 0;
@@ -43,11 +43,4 @@ static int kirkwood_init_soc(struct device_node *root, void *context)
 
 	return 0;
 }
-
-static int kirkwood_register_soc_fixup(void)
-{
-	mvebu_mbus_add_range("marvell,kirkwood", 0xf0, 0x01,
-			     MVEBU_REMAP_INT_REG_BASE);
-	return of_register_fixup(kirkwood_init_soc, NULL);
-}
-pure_initcall(kirkwood_register_soc_fixup);
+postcore_initcall(kirkwood_init_soc);
diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index fc940e3b541d..965a221d3ba4 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -827,6 +827,10 @@ static int mvebu_mbus_fixup_register(void)
 				     DOVE_REMAP_MC_REGS);
 	}
 
+	if (IS_ENABLED(CONFIG_ARCH_KIRKWOOD))
+		mvebu_mbus_add_range("marvell,kirkwood", 0xf0, 0x01,
+				     MVEBU_REMAP_INT_REG_BASE);
+
 	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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 3+0/3] retry on simplification of init code flow
  2017-02-25 20:40 [PATCH v2 3+0/3] retry on simplification of init code flow Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2017-02-25 20:40 ` [PATCH v2 6/3] mvebu: kirkwood: " Uwe Kleine-König
@ 2017-02-28  6:49 ` Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2017-02-28  6:49 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: barebox

On Sat, Feb 25, 2017 at 09:40:19PM +0100, Uwe Kleine-König wrote:
> Hello,
> 
> this series is v2 of [4-6]/3 from Feb 15 and is supposed to superseed
> (implicit) v1 which is already in next.
> 
> The difference is that patch "mvebu: Fix fixup of mbus device-tree
> ranges" is squashed into them and the commit log adapted accordingly.

Ok, applied. Please check if the result is correct in -next.

Sascha

> 
> Best regards
> Uwe
> 
> Uwe Kleine-König (3):
>   mvebu: armada-370-xp: simplify soc init code flow
>   mvebu: dove: simplify soc init code flow
>   mvebu: kirkwood: simplify soc init code flow
> 
>  arch/arm/mach-mvebu/armada-370-xp.c | 31 ++++++++-----------------------
>  arch/arm/mach-mvebu/dove.c          | 13 ++-----------
>  arch/arm/mach-mvebu/kirkwood.c      | 11 ++---------
>  drivers/bus/mvebu-mbus.c            | 22 +++++++++++++++++++++-
>  4 files changed, 33 insertions(+), 44 deletions(-)
> 
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-28  6:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-25 20:40 [PATCH v2 3+0/3] retry on simplification of init code flow 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 ` [PATCH v2 5/3] mvebu: dove: " Uwe Kleine-König
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox