Skip to contentSkip to conversation

ARM: shmobile: kzm9g reference SMP and cleanup

PATCH New Simon Horman 3 participants 10 messages Feb 15, 2013 – Feb 18, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover ARM: shmobile: kzm9g reference SMP and cleanup

Hi,

this series tweaks the defconfig to allow SMP kzm9g reference to successfully boot. The series also contains a number of cleanups.

The series is based on the boards-kzm9g-reference branch in the renesas tree.

Simon Horman (5):
ARM: shmobile: kzm9g: defconfig: do not enable PREEMPT
ARM: shmobile: kzm9g: Remove warning about SMP
ARM: shmobile: sh73a0: Remove sh73a0_init_irq_dt()
ARM: shmobile: sh73a0: Add smp ops to DT_MACHINE_START
ARM: shmobile: kzm9g: Trim reference DT_MACHINE_START

 arch/arm/configs/kzm9g_defconfig               |    1 -
 arch/arm/mach-shmobile/board-kzm9g-reference.c |   19 ++-----------------
 arch/arm/mach-shmobile/intc-sh73a0.c           |    8 --------
 arch/arm/mach-shmobile/setup-sh73a0.c          |    4 +++-
 4 files changed, 5 insertions(+), 27 deletions(-)
#1 lore raw

PATCH 1/5 ARM: shmobile: kzm9g: defconfig: do not enable PREEMPT

The motivation for this change is:

* It is consistent with all other shmobile boards and;
* Allows the kzm9g-reference code to work with CONFIG_SMP and thus the new defconfig

---
 arch/arm/configs/kzm9g_defconfig |    1 -
 1 file changed, 1 deletion(-)
arch/arm/configs/kzm9g_defconfig +0 -1
index afbae28..da7672e 100644
@@ -33,7 +33,6 @@ CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_SMP=y
 CONFIG_SCHED_MC=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 # CONFIG_OABI_COMPAT is not set
 CONFIG_HIGHMEM=y
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/5 ARM: shmobile: kzm9g: Remove warning about SMP

In reply to Simon Horman

Remove warning about SMP not working with the
clock initialisation used for kzm9g reference.

This is resolved by not selecting CONFIG_PREEMPT.

---
 arch/arm/mach-shmobile/board-kzm9g-reference.c |    7 -------
 1 file changed, 7 deletions(-)
arch/arm/mach-shmobile/board-kzm9g-reference.c +0 -7
index a677d61..bce2a49 100644
@@ -98,13 +98,6 @@ static const char *kzm9g_boards_compat_dt[] __initdata = {
 	NULL,
 };
 
-/* Please note that the clock initialisation shcheme used in
- * sh73a0_add_early_devices_dt() and sh73a0_add_standard_devices_dt()
- * does not work with SMP as there is a yet to be resolved lock-up in
- * workqueue initialisation.
- *
- * CONFIG_SMP should be disabled when using this code.
- */
 DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
 	.smp		= smp_ops(sh73a0_smp_ops),
 	.map_io		= sh73a0_map_io,
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 3/5 ARM: shmobile: sh73a0: Remove sh73a0_init_irq_dt()

In reply to Simon Horman

This is not needed as irq_set_wake is only used for suspend to ram which is not a requirement for bringing up boards using DT.

---
 arch/arm/mach-shmobile/board-kzm9g-reference.c |    3 ++-
 arch/arm/mach-shmobile/intc-sh73a0.c           |    8 --------
 arch/arm/mach-shmobile/setup-sh73a0.c          |    3 ++-
 3 files changed, 4 insertions(+), 10 deletions(-)
arch/arm/mach-shmobile/board-kzm9g-reference.c +2 -1
index bce2a49..b9e40b6 100644
@@ -24,6 +24,7 @@
 #include <linux/gpio.h>
 #include <linux/io.h>
 #include <linux/irq.h>
+#include <linux/irqchip.h>
 #include <linux/input.h>
 #include <linux/of_platform.h>
 #include <mach/sh73a0.h>
@@ -103,7 +104,7 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
 	.map_io		= sh73a0_map_io,
 	.init_early	= sh73a0_add_early_devices_dt,
 	.nr_irqs	= NR_IRQS_LEGACY,
-	.init_irq	= sh73a0_init_irq_dt,
+	.init_irq	= irqchip_init,
 	.init_machine	= kzm_init,
 	.init_late	= shmobile_init_late,
 	.init_time	= shmobile_timer_init,
arch/arm/mach-shmobile/intc-sh73a0.c +0 -8
index 91faba6..a81a1d8 100644
@@ -460,11 +460,3 @@ void __init sh73a0_init_irq(void)
 	sh73a0_pint1_cascade.handler = sh73a0_pint1_demux;
 	setup_irq(gic_spi(34), &sh73a0_pint1_cascade);
 }
-
-#ifdef CONFIG_OF
-void __init sh73a0_init_irq_dt(void)
-{
-	irqchip_init();
-	gic_arch_extn.irq_set_wake = sh73a0_set_wake;
-}
-#endif
arch/arm/mach-shmobile/setup-sh73a0.c +2 -1
index f7ecb0b..fc0c73c 100644
@@ -22,6 +22,7 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
+#include <linux/irqchip.h>
 #include <linux/platform_device.h>
 #include <linux/of_platform.h>
 #include <linux/delay.h>
@@ -865,7 +866,7 @@ DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)")
 	.map_io		= sh73a0_map_io,
 	.init_early	= sh73a0_add_early_devices_dt,
 	.nr_irqs	= NR_IRQS_LEGACY,
-	.init_irq	= sh73a0_init_irq_dt,
+	.init_irq	= irqchip_init,
 	.init_machine	= sh73a0_add_standard_devices_dt,
 	.init_time	= shmobile_timer_init,
 	.dt_compat	= sh73a0_boards_compat_dt,
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH 4/5 ARM: shmobile: sh73a0: Add smp ops to DT_MACHINE_START

In reply to Simon Horman

This a board to be brought up with SMP enabled
without a board file present.

---
 arch/arm/mach-shmobile/setup-sh73a0.c |    1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/setup-sh73a0.c +1 -0
index fc0c73c..8f00f3a 100644
@@ -863,6 +863,7 @@ static const char *sh73a0_boards_compat_dt[] __initdata = {
 };
 
 DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)")
+	.smp		= smp_ops(sh73a0_smp_ops),
 	.map_io		= sh73a0_map_io,
 	.init_early	= sh73a0_add_early_devices_dt,
 	.nr_irqs	= NR_IRQS_LEGACY,
Signature · 1 line
1.7.10.4
#5 lore raw

PATCH 5/5 ARM: shmobile: kzm9g: Trim reference DT_MACHINE_START

In reply to Simon Horman

Remove .init_late and .restart from DT_MACHINE_START for kzm9g reference as these are not necessary to bring the board up which is the main aim of kzm9g reference.

---
 arch/arm/mach-shmobile/board-kzm9g-reference.c |    9 ---------
 1 file changed, 9 deletions(-)
arch/arm/mach-shmobile/board-kzm9g-reference.c +0 -9
index b9e40b6..836070a 100644
@@ -87,13 +87,6 @@ static void __init kzm_init(void)
 #endif
 }
 
-static void kzm9g_restart(char mode, const char *cmd)
-{
-#define RESCNT2 IOMEM(0xe6188020)
-	/* Do soft power on reset */
-	writel((1 << 31), RESCNT2);
-}
-
 static const char *kzm9g_boards_compat_dt[] __initdata = {
 	"renesas,kzm9g-reference",
 	NULL,
@@ -106,8 +99,6 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
 	.nr_irqs	= NR_IRQS_LEGACY,
 	.init_irq	= irqchip_init,
 	.init_machine	= kzm_init,
-	.init_late	= shmobile_init_late,
 	.init_time	= shmobile_timer_init,
-	.restart	= kzm9g_restart,
 	.dt_compat	= kzm9g_boards_compat_dt,
 MACHINE_END
Signature · 1 line
1.7.10.4
#6 lore raw

PATCH 5/5 ARM: shmobile: kzm9g: Trim reference DT_MACHINE_START

Hi Simon

Quoted 3 lines

Remove .init_late and .restart from DT_MACHINE_START for kzm9g reference as these are not necessary to bring the board up which is the main aim of kzm9g reference.

Does this mean that we will have "full spec kzm9g DT base" code in the future, and then, "kzm9g reference" code will be deleted ?

Quoted 39 lines
---
 arch/arm/mach-shmobile/board-kzm9g-reference.c |    9 ---------
 1 file changed, 9 deletions(-)
arch/arm/mach-shmobile/board-kzm9g-reference.c +0 -9
index b9e40b6..836070a 100644
@@ -87,13 +87,6 @@ static void __init kzm_init(void)
 #endif
 }
 
-static void kzm9g_restart(char mode, const char *cmd)
-{
-#define RESCNT2 IOMEM(0xe6188020)
-	/* Do soft power on reset */
-	writel((1 << 31), RESCNT2);
-}
-
 static const char *kzm9g_boards_compat_dt[] __initdata = {
 	"renesas,kzm9g-reference",
 	NULL,
@@ -106,8 +99,6 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
 	.nr_irqs	= NR_IRQS_LEGACY,
 	.init_irq	= irqchip_init,
 	.init_machine	= kzm_init,
-	.init_late	= shmobile_init_late,
 	.init_time	= shmobile_timer_init,
-	.restart	= kzm9g_restart,
 	.dt_compat	= kzm9g_boards_compat_dt,
 MACHINE_END
Signature · 6 lines
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Best regards
---
Kuninori Morimoto

#7 lore raw

PATCH 5/5 ARM: shmobile: kzm9g: Trim reference DT_MACHINE_START

Quoted 9 lines · Kuninori Morimoto

Hi Simon

Quoted 3 lines

Remove .init_late and .restart from DT_MACHINE_START for kzm9g reference as these are not necessary to bring the board up which is the main aim of kzm9g reference.

Does this mean that we will have "full spec kzm9g DT base" code in the future, and then, "kzm9g reference" code will be deleted ?

Yes, I think that is the plan.

#8 lore raw

PATCH 5/5 ARM: shmobile: kzm9g: Trim reference DT_MACHINE_START

Hi Simon

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Remove .init_late and .restart from DT_MACHINE_START for kzm9g reference as these are not necessary to bring the board up which is the main aim of kzm9g reference.

Does this mean that we will have "full spec kzm9g DT base" code in the future, and then, "kzm9g reference" code will be deleted ?

Yes, I think that is the plan.

I see, Thank you.

Best regards
---
Kuninori Morimoto

#9 lore raw

cover ARM: shmobile: kzm9g reference SMP and cleanup

In reply to Simon Horman
Quoted 7 lines · Simon Horman

Hi,

this series tweaks the defconfig to allow SMP kzm9g reference to successfully boot. The series also contains a number of cleanups.

The series is based on the boards-kzm9g-reference branch in the renesas tree.

Magnus asked me to detail the changes that I needed to make to make SMP kzm9g reference work. I can do so in two words: disable CONFIG_PREEMPT.

The first patch in this series makes that changes.

The 4th patch in the series adds SMP ops to the sh73a0 DT_MACHINE_START which adds SMP support when booting an sh73a0 based board using DT without a board file compiled into the kernel. This has been tested with the kzm9g board.

I consider the remaining patches clean-ups.

Quoted 18 lines

Simon Horman (5):
ARM: shmobile: kzm9g: defconfig: do not enable PREEMPT
ARM: shmobile: kzm9g: Remove warning about SMP
ARM: shmobile: sh73a0: Remove sh73a0_init_irq_dt()
ARM: shmobile: sh73a0: Add smp ops to DT_MACHINE_START
ARM: shmobile: kzm9g: Trim reference DT_MACHINE_START

 arch/arm/configs/kzm9g_defconfig               |    1 -
 arch/arm/mach-shmobile/board-kzm9g-reference.c |   19 ++-----------------
 arch/arm/mach-shmobile/intc-sh73a0.c           |    8 --------
 arch/arm/mach-shmobile/setup-sh73a0.c          |    4 +++-
 4 files changed, 5 insertions(+), 27 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html