Skip to contentSkip to conversation

ARM: shmobile: KZM9D legacy board code removal

PATCH Superseded Magnus Damm 2 participants 9 messages Nov 6, 2013 – Nov 8, 2013

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

cover ARM: shmobile: KZM9D legacy board code removal

ARM: shmobile: KZM9D legacy board code removal

[PATCH 01/04] ARM: shmobile: Add shared EMEV2 code for ->init_machine() [PATCH 02/04] ARM: shmobile: Use ->init_late() in shared EMEV2 case [PATCH 03/04] ARM: shmobile: Remove legacy KZM9D board code
[PATCH 04/04] ARM: shmobile: Remove legacy platform devices from EMEV2 SoC code

With this patch set applied it is possible to use DT for KZM9D board support. Because of this is the KZM9D legacy C board code removed together with EMEV2 platform devices. All these devices are available via DT anyway, so there is no need to keep the C version. This saves some lines of code and shows where mach-shmobile is heading in the future for all the SoCs.

---

Written against renesas.git tag renesas-devel-v3.12-rc7-20131101

 arch/arm/mach-shmobile/Kconfig              |    6 -
 arch/arm/mach-shmobile/Makefile             |    1 
 arch/arm/mach-shmobile/Makefile.boot        |    1 
 arch/arm/mach-shmobile/board-kzm9d.c        |   92 ---------------
 arch/arm/mach-shmobile/include/mach/emev2.h |    5 
 arch/arm/mach-shmobile/setup-emev2.c        |  161 ++-------------------------
 6 files changed, 13 insertions(+), 253 deletions(-)
author maintainer
#1 lore raw

PATCH 1/4 ARM: shmobile: Add shared EMEV2 code for ->init_machine()

From: Magnus Damm <[email protected]>

Add a SoC specific function that initializes clocks and starts DT probing in case of EMEV2.

This EMEV2 SoC support code may be built for either legacy SHMOBILE or SMOBILE_MULTI.

The change allows us to support existing board specific KZM9D DTB with these SoC specific DT_MACHINE_START() callbacks.

---

 arch/arm/mach-shmobile/setup-emev2.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/mach-shmobile/setup-emev2.c +12 -0
@@ -16,6 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
+#include <linux/clk-provider.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -197,6 +198,16 @@ void __init emev2_init_delay(void)
 
 #ifdef CONFIG_USE_OF
 
+static void __init emev2_add_standard_devices_dt(void)
+{
+#ifdef CONFIG_COMMON_CLK
+	of_clk_init(NULL);
+#else
+	emev2_clock_init();
+#endif
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
 static const char *emev2_boards_compat_dt[] __initdata = {
 	"renesas,emev2",
 	NULL,
@@ -206,6 +217,7 @@ DT_MACHINE_START(EMEV2_DT, "Generic Emma
 	.smp		= smp_ops(emev2_smp_ops),
 	.map_io		= emev2_map_io,
 	.init_early	= emev2_init_delay,
+	.init_machine	= emev2_add_standard_devices_dt,
 	.dt_compat	= emev2_boards_compat_dt,
 MACHINE_END
 
author maintainer
#2 lore raw

PATCH 2/4 ARM: shmobile: Use ->init_late() in shared EMEV2 case

In reply to Magnus Damm

From: Magnus Damm <[email protected]>

Hook up shmobile_init_late() to enable various
code such as suspend-to-RAM and CPUIdle.

---

 arch/arm/mach-shmobile/setup-emev2.c |    1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/setup-emev2.c +1 -0
@@ -79,6 +79,7 @@ DT_MACHINE_START(EMEV2_DT, "Generic Emma
 	.map_io		= emev2_map_io,
 	.init_early	= emev2_init_delay,
 	.init_machine	= emev2_add_standard_devices_dt,
+	.init_late	= shmobile_init_late,
 	.dt_compat	= emev2_boards_compat_dt,
 MACHINE_END
 
author maintainer
#3 lore raw

PATCH 3/4 ARM: shmobile: Remove legacy KZM9D board code

In reply to Magnus Damm

From: Magnus Damm <[email protected]>

Remove the C and platform device version of KZM9D.

The DT version of KZM9D board support can now instead directly be used with SoC specific code in setup-emev2.c.

---

 arch/arm/mach-shmobile/Kconfig       |    6 --
 arch/arm/mach-shmobile/Makefile      |    1 
 arch/arm/mach-shmobile/Makefile.boot |    1 
 arch/arm/mach-shmobile/board-kzm9d.c |   92 ----------------------------------
 4 files changed, 100 deletions(-)
arch/arm/mach-shmobile/Kconfig +0 -6
@@ -245,12 +245,6 @@ config MACH_KOELSCH_REFERENCE
 
 	   This is intended to aid developers
 
-config MACH_KZM9D
-	bool "KZM9D board"
-	depends on ARCH_EMEV2
-	select REGULATOR_FIXED_VOLTAGE if REGULATOR
-	select USE_OF
-
 config MACH_KZM9G
 	bool "KZM-A9-GT board"
 	depends on ARCH_SH73A0
arch/arm/mach-shmobile/Makefile +0 -1
@@ -72,7 +72,6 @@ obj-$(CONFIG_MACH_ARMADILLO800EVA)	+= bo
 obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE)	+= board-armadillo800eva-reference.o
 obj-$(CONFIG_MACH_KOELSCH)	+= board-koelsch.o
 obj-$(CONFIG_MACH_KOELSCH_REFERENCE)	+= board-koelsch-reference.o
-obj-$(CONFIG_MACH_KZM9D)	+= board-kzm9d.o
 obj-$(CONFIG_MACH_KZM9G)	+= board-kzm9g.o
 obj-$(CONFIG_MACH_KZM9G_REFERENCE)	+= board-kzm9g-reference.o
 endif
arch/arm/mach-shmobile/Makefile.boot +0 -1
@@ -9,7 +9,6 @@ loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE)
 loadaddr-$(CONFIG_MACH_GENMAI) += 0x8008000
 loadaddr-$(CONFIG_MACH_KOELSCH) += 0x40008000
 loadaddr-$(CONFIG_MACH_KOELSCH_REFERENCE) += 0x40008000
-loadaddr-$(CONFIG_MACH_KZM9D) += 0x40008000
 loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000
 loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000
 loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000
arch/arm/mach-shmobile/board-kzm9d.c deleted +0 -92

92 lines not on this page · raw message

author maintainer
#7 lore raw

PATCH 4/4 ARM: shmobile: Remove legacy platform devices from EMEV2 SoC code

In reply to Magnus Damm

From: Magnus Damm <[email protected]>

Now when KZM9D legacy C board support code is
gone then remove emev2_add_standard_devices()
and all the platform devices from setup-emev2.c.

---

 arch/arm/mach-shmobile/include/mach/emev2.h |    5 
 arch/arm/mach-shmobile/setup-emev2.c        |  148 ---------------------------
 2 files changed, 153 deletions(-)
arch/arm/mach-shmobile/include/mach/emev2.h +0 -5
@@ -3,12 +3,7 @@
 
 extern void emev2_map_io(void);
 extern void emev2_init_delay(void);
-extern void emev2_add_standard_devices(void);
 extern void emev2_clock_init(void);
-
-#define EMEV2_GPIO_BASE 200
-#define EMEV2_GPIO_IRQ(n) (EMEV2_GPIO_BASE + (n))
-
 extern struct smp_operations emev2_smp_ops;
 
 #endif /* __ASM_EMEV2_H__ */
arch/arm/mach-shmobile/setup-emev2.c +0 -148

166 lines not on this page · raw message

#8 lore raw

cover ARM: shmobile: KZM9D legacy board code removal

In reply to Magnus Damm
Quoted 7 lines · Magnus Damm

ARM: shmobile: KZM9D legacy board code removal

[PATCH 01/04] ARM: shmobile: Add shared EMEV2 code for ->init_machine() [PATCH 02/04] ARM: shmobile: Use ->init_late() in shared EMEV2 case [PATCH 03/04] ARM: shmobile: Remove legacy KZM9D board code
[PATCH 04/04] ARM: shmobile: Remove legacy platform devices from EMEV2 SoC code

Quoted 5 lines

With this patch set applied it is possible to use DT for KZM9D board support. Because of this is the KZM9D legacy C board code removed together with EMEV2 platform devices. All these devices are available via DT anyway, so there is no need to keep the C version. This saves some lines of code and shows where mach-shmobile is heading in the future for all the SoCs.

Thanks, I have queued these up.

#4 lore raw

PATCH 3/4 ARM: shmobile: Remove legacy KZM9D board code

In reply to Magnus Damm
Quoted 6 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Remove the C and platform device version of KZM9D.

The DT version of KZM9D board support can now instead directly be used with SoC specific code in setup-emev2.c.

Am I right in thinking that with this change in place we need the following change to the defconfig in order for it to compile.

arch/arm/configs/kzm9d_defconfig +1 -1
index 6c37f4a..002488a 100644
@@ -13,7 +13,7 @@ CONFIG_SLAB=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_IOSCHED_DEADLINE is not set
 # CONFIG_IOSCHED_CFQ is not set
-CONFIG_ARCH_SHMOBILE=y
+CONFIG_ARCH_SHMOBILE_MULTI=y
 CONFIG_ARCH_EMEV2=y
 CONFIG_MACH_KZM9D=y
 CONFIG_MEMORY_START=0x40000000

I am holding off on pushing the patches I queued up today until this can be resolved one way or another.

author maintainer
#5 lore raw

PATCH 3/4 ARM: shmobile: Remove legacy KZM9D board code

Quoted 26 lines · Simon Horman
Quoted 6 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Remove the C and platform device version of KZM9D.

The DT version of KZM9D board support can now instead directly be used with SoC specific code in setup-emev2.c.

Am I right in thinking that with this change in place we need the following change to the defconfig in order for it to compile.

arch/arm/configs/kzm9d_defconfig +1 -1
index 6c37f4a..002488a 100644
@@ -13,7 +13,7 @@ CONFIG_SLAB=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_IOSCHED_DEADLINE is not set
 # CONFIG_IOSCHED_CFQ is not set
-CONFIG_ARCH_SHMOBILE=y
+CONFIG_ARCH_SHMOBILE_MULTI=y
 CONFIG_ARCH_EMEV2=y
 CONFIG_MACH_KZM9D=y
 CONFIG_MEMORY_START=0x40000000
Quoted 2 lines

I am holding off on pushing the patches I queued up today until this can be resolved one way or another.

Oh, right, I guess it doesn't know the link address now when the C bits are gone. Sorry about that, I totally forgot about the defconfig.

At this point I think we should fix up the defconfig to build for kzm9d with single platform. So instead of enabling MULTI in the kzmd_defconfig, how about this?

CONFIG_AUTO_ZRELADDR=y

Also, it seems that the "select USE_OF" went away with the board code Kconfig bits. I will send a patch for that right away.

Cheers,

/ magnus

#6 lore raw

PATCH 3/4 ARM: shmobile: Remove legacy KZM9D board code

Quoted 33 lines · Magnus Damm
Quoted 26 lines · Simon Horman
Quoted 6 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Remove the C and platform device version of KZM9D.

The DT version of KZM9D board support can now instead directly be used with SoC specific code in setup-emev2.c.

Am I right in thinking that with this change in place we need the following change to the defconfig in order for it to compile.

arch/arm/configs/kzm9d_defconfig +1 -1
index 6c37f4a..002488a 100644
@@ -13,7 +13,7 @@ CONFIG_SLAB=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_IOSCHED_DEADLINE is not set
 # CONFIG_IOSCHED_CFQ is not set
-CONFIG_ARCH_SHMOBILE=y
+CONFIG_ARCH_SHMOBILE_MULTI=y
 CONFIG_ARCH_EMEV2=y
 CONFIG_MACH_KZM9D=y
 CONFIG_MEMORY_START=0x40000000
Quoted 2 lines

I am holding off on pushing the patches I queued up today until this can be resolved one way or another.

Oh, right, I guess it doesn't know the link address now when the C bits are gone. Sorry about that, I totally forgot about the defconfig.

Quoted 8 lines

At this point I think we should fix up the defconfig to build for kzm9d with single platform. So instead of enabling MULTI in the kzmd_defconfig, how about this?

CONFIG_AUTO_ZRELADDR=y

Also, it seems that the "select USE_OF" went away with the board code Kconfig bits. I will send a patch for that right away.

Thanks. USE_OF + CONFIG_AUTO_ZRELADDR appears to work :)