ARM: shmobile: kzm9g reference SMP and cleanup
v2 cover ARM: shmobile: kzm9g reference SMP and cleanup
Hi,
this series:
* Tweaks the defconfig to allow SMP kzm9g reference to successfully boot.
* Removes the use of early devices from reference kzm9g reference DT
* Makes various other minor cleanups to kzm9g reference DT
Clarification of SMP fix:
* Diabling CONFIG_PREEMPT is sufficent to allow the existing kzm9g reference DT code to boot SMP.
Merge:
My plan to merge this is:
* Add the defconfig change to a defconfig branch.
* Add the sh73a0 patches to an soc branch.
* Then rebase the existing boards-kzm9g-reference breanch on top of the soc branch.
* Then apply the kzm9g patches in this series to boards-kzm9g-reference, squashing the "ARM: shmobile: kzm9g: Do not use early devices" change to avoid breaking bisection.
Difference to v1:
* Added "shmobile: sh73a0: Do not use early devices with DT reference"
* Added "shmobile: sh73a0: Remove warning about SMP"
* Added "shmobile: kzm9g: Do not use early devices"
Simon Horman (8):
ARM: shmobile: kzm9g: defconfig: do not enable PREEMPT
ARM: shmobile: sh73a0: Remove sh73a0_init_irq_dt()
ARM: shmobile: sh73a0: Add smp ops to DT_MACHINE_START
ARM: shmobile: sh73a0: Remove warning about SMP
ARM: shmobile: sh73a0: Do not use early devices with DT reference
ARM: shmobile: kzm9g: Do not use early devices
ARM: shmobile: kzm9g: Remove warning about SMP
ARM: shmobile: kzm9g: Trim reference DT_MACHINE_START
arch/arm/configs/kzm9g_defconfig | 1 - arch/arm/mach-shmobile/board-kzm9g-reference.c | 21 ++------------ arch/arm/mach-shmobile/include/mach/common.h | 2 +- arch/arm/mach-shmobile/intc-sh73a0.c | 8 ------ arch/arm/mach-shmobile/setup-sh73a0.c | 36 ++++++++---------------- 5 files changed, 16 insertions(+), 52 deletions(-)
Signature · 1 line
1.7.10.4
PATCH v2 1/8 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
@@ -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
PATCH v2 2/8 ARM: shmobile: sh73a0: Remove sh73a0_init_irq_dt()
In reply to Simon HormanThis 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
@@ -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>
@@ -110,7 +111,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
@@ -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
@@ -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
PATCH v2 3/8 ARM: shmobile: sh73a0: Add smp ops to DT_MACHINE_START
In reply to Simon HormanThis 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
@@ -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
PATCH v2 4/8 ARM: shmobile: sh73a0: Remove warning about SMP
In reply to Simon HormanRemove warning about SMP not working with the
clock initialisation sheme used for reference DT.
This is resolved by not selecting CONFIG_PREEMPT.
--- arch/arm/mach-shmobile/setup-sh73a0.c | 8 -------- 1 file changed, 8 deletions(-)
arch/arm/mach-shmobile/setup-sh73a0.c +0 -8
@@ -823,14 +823,6 @@ void __init sh73a0_add_early_devices(void)#ifdef CONFIG_USE_OF -/* 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. -*/ -void __init sh73a0_add_early_devices_dt (void ) {shmobile_setup_delay (1196 ,44 ,46 );/* Cortex-A9 @ 1196MHz */
Signature · 1 line
1.7.10.4
PATCH v2 5/8 ARM: shmobile: sh73a0: Do not use early devices with DT reference
In reply to Simon HormanDo not initialise any early devices when using the minimal DT reference code. Only the delay needs to be initialised.
--- arch/arm/mach-shmobile/include/mach/common.h | 2 +- arch/arm/mach-shmobile/setup-sh73a0.c | 24 +++++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-)
arch/arm/mach-shmobile/include/mach/common.h +1 -1
@@ -33,12 +33,12 @@ extern int sh7372_do_idle_sysc(unsigned long sleep_mode);extern struct clk sh7372_extal1_clk;extern struct clk sh7372_extal2_clk; +extern void sh73a0_init_delay (void );extern void sh73a0_init_irq (void );extern void sh73a0_init_irq_dt (void );extern void sh73a0_map_io (void );extern void sh73a0_earlytimer_init (void );extern void sh73a0_add_early_devices (void ); -extern void sh73a0_add_early_devices_dt (void );extern void sh73a0_add_standard_devices (void );extern void sh73a0_add_standard_devices_dt (void );extern void sh73a0_clock_init (void );
arch/arm/mach-shmobile/setup-sh73a0.c +9 -15
@@ -756,7 +756,7 @@ static struct platform_device pmu_device = { .resource = pmu_resources, }; -static struct platform_device *sh73a0_early_devices_dt[]__initdata = { +static struct platform_device *sh73a0_devices_dt[]__initdata = { &scif0_device, &scif1_device, &scif2_device,
@@ -792,8 +792,8 @@ void __init sh73a0_add_standard_devices(void)/* Clear software reset bit on SY-DMAC module */ __raw_writel (__raw_readl (SRCR2 ) & ~(1 <<18 ),SRCR2 ); -platform_add_devices (sh73a0_early_devices_dt, -ARRAY_SIZE (sh73a0_early_devices_dt)); +platform_add_devices (sh73a0_devices_dt, +ARRAY_SIZE (sh73a0_devices_dt));platform_add_devices (sh73a0_early_devices,ARRAY_SIZE (sh73a0_early_devices)); platform_add_devices(sh73a0_late_devices,
@@ -812,8 +812,8 @@ void __init sh73a0_earlytimer_init(void)void __init sh73a0_add_early_devices (void ) { -early_platform_add_devices (sh73a0_early_devices_dt, -ARRAY_SIZE (sh73a0_early_devices_dt)); +early_platform_add_devices (sh73a0_devices_dt, +ARRAY_SIZE (sh73a0_devices_dt));early_platform_add_devices (sh73a0_early_devices,ARRAY_SIZE (sh73a0_early_devices));
@@ -823,15 +823,9 @@ void __init sh73a0_add_early_devices(void)#ifdef CONFIG_USE_OF -void __init sh73a0_add_early_devices_dt (void ) +void __init sh73a0_init_delay (void ) {shmobile_setup_delay (1196 ,44 ,46 );/* Cortex-A9 @ 1196MHz */ - -early_platform_add_devices (sh73a0_early_devices_dt, -ARRAY_SIZE (sh73a0_early_devices_dt)); - -/* setup early console here as well */ -shmobile_setup_console (); } static const struct of_dev_auxdata sh73a0_auxdata_lookup[] __initconst = {
@@ -843,8 +837,8 @@ void __init sh73a0_add_standard_devices_dt(void)/* clocks are setup late during boot in the case of DT */ sh73a0_clock_init (); -platform_add_devices (sh73a0_early_devices_dt, -ARRAY_SIZE (sh73a0_early_devices_dt)); +platform_add_devices (sh73a0_devices_dt, +ARRAY_SIZE (sh73a0_devices_dt));of_platform_populate (NULL , of_default_bus_match_table, sh73a0_auxdata_lookup,NULL ); }
@@ -857,7 +851,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, + .init_early = sh73a0_init_delay, .nr_irqs = NR_IRQS_LEGACY, .init_irq = irqchip_init, .init_machine = sh73a0_add_standard_devices_dt,
Signature · 1 line
1.7.10.4
PATCH v2 6/8 ARM: shmobile: kzm9g: Do not use early devices
In reply to Simon HormanDo not initialise any early devices when using the minimal DT reference code. Only the delay needs to be initialised.
--- arch/arm/mach-shmobile/board-kzm9g-reference.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-shmobile/board-kzm9g-reference.c +1 -1
@@ -109,7 +109,7 @@ static const char *kzm9g_boards_compat_dt[] __initdata = {DT_MACHINE_START (KZM9G_DT ,"kzm9g-reference" ) .smp = smp_ops(sh73a0_smp_ops), .map_io = sh73a0_map_io, - .init_early = sh73a0_add_early_devices_dt, + .init_early = sh73a0_init_delay, .nr_irqs = NR_IRQS_LEGACY, .init_irq = irqchip_init, .init_machine = kzm_init,
Signature · 1 line
1.7.10.4
PATCH v2 7/8 ARM: shmobile: kzm9g: Remove warning about SMP
In reply to Simon HormanRemove 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
@@ -99,13 +99,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
PATCH v2 8/8 ARM: shmobile: kzm9g: Trim reference DT_MACHINE_START
In reply to Simon HormanRemove .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
@@ -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
v2 cover ARM: shmobile: kzm9g reference SMP and cleanup
In reply to Simon HormanQuoted 14 lines · Simon Horman
Hi,
this series:
* Tweaks the defconfig to allow SMP kzm9g reference to successfully boot.
* Removes the use of early devices from reference kzm9g reference DT
* Makes various other minor cleanups to kzm9g reference DTClarification of SMP fix:
* DiablingCONFIG_PREEMPTis sufficent to allow the existing kzm9g reference DT code to boot SMP.Merge:
Quoted 8 lines
My plan to merge this is:
* Add the defconfig change to a defconfig branch.
* Add the sh73a0 patches to an soc branch.
* Then rebase the existing boards-kzm9g-reference breanch on top of the soc branch.
* Then apply the kzm9g patches in this series to boards-kzm9g-reference, squashing the "ARM: shmobile: kzm9g: Do not use early devices" change to avoid breaking bisection.
I have applied these changes as described above. The soc branch used was soc5.
I also rebased the boards3 branch on top of the new soc5 branch and then cherry-picked boards-kzm9g-reference into the boards3 branch. I will remove the boards-kzm9g-reference branch accordingly.
Quoted 25 lines
Difference to v1:
* Added "shmobile: sh73a0: Do not use early devices with DT reference"
* Added "shmobile: sh73a0: Remove warning about SMP"
* Added "shmobile: kzm9g: Do not use early devices"Simon Horman (8):
ARM: shmobile: kzm9g: defconfig: do not enable PREEMPT
ARM: shmobile: sh73a0: Removesh73a0_init_irq_dt()
ARM: shmobile: sh73a0: Add smp ops toDT_MACHINE_START
ARM: shmobile: sh73a0: Remove warning about SMP
ARM: shmobile: sh73a0: Do not use early devices with DT reference
ARM: shmobile: kzm9g: Do not use early devices
ARM: shmobile: kzm9g: Remove warning about SMP
ARM: shmobile: kzm9g: Trim referenceDT_MACHINE_STARTarch/arm/configs/kzm9g_defconfig | 1 - arch/arm/mach-shmobile/board-kzm9g-reference.c | 21 ++------------ arch/arm/mach-shmobile/include/mach/common.h | 2 +- arch/arm/mach-shmobile/intc-sh73a0.c | 8 ------ arch/arm/mach-shmobile/setup-sh73a0.c | 36 ++++++++---------------- 5 files changed, 16 insertions(+), 52 deletions(-)Signature · 1 line
1.7.10.4