ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2
Magnus Damm
maintainercover ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2
ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2
[PATCH 01/08] ARM: shmobile: Fix base address readout in headsmp-scu.S [PATCH 02/08] ARM: shmobile: Rework SH73A0_SCU_BASE IOMEM() usage [PATCH 03/08] ARM: shmobile: Use R8A7779_SCU_BASE with TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to use scu_power_mode() [PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unused hotplug.c
Finalize the SCU rework by performing minor fixes and converting the r8a7779 SMP code to make use of common scu_power_mode() code and the early SCU setup code in headsmp-scu.S.
Also, to save a few line remove hotplug.c while at it.
The only remaining itch to scratch here is to fix up CPU Hotplug of CPU0 on r8a7779, but for that to happen we first need to start accounting for spurious interrupts during shut down.
---
No known dependencies apart from previous SMP cleanup series "[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework" Written against -next in renesas.git.
arch/arm/mach-shmobile/Makefile | 1 arch/arm/mach-shmobile/headsmp-scu.S | 3 arch/arm/mach-shmobile/hotplug.c | 64 --------- arch/arm/mach-shmobile/include/mach/common.h | 10 - arch/arm/mach-shmobile/smp-r8a7779.c | 173 +++++++++++++------------- arch/arm/mach-shmobile/smp-sh73a0.c | 11 + 6 files changed, 99 insertions(+), 163 deletions(-)
Magnus Damm
maintainerPATCH 1/8 ARM: shmobile: Fix base address readout in headsmp-scu.S
From: Magnus Damm <[email protected]>
Rework the early SCU setup code in headsmp-scu.S to read the base address in the same way as we use to fetch the address of the invalidation function.
---
Tested on r8a7779. Feel free to add incrementally or fold into:
[PATCH 05/06] ARM: shmobile: Common shmobile_scu_base in headsmp-scu.S
Bastian, does this solve your problem?
arch/arm/mach-shmobile/headsmp-scu.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/headsmp-scu.S +2 -1
@@ -39,7 +39,7 @@ ENTRY(shmobile_secondary_vector_scu) mrc p15, 0, r0, c0, c0, 5 @ read MIPDR and r0, r0, #3 @ mask out cpu ID lsl r0, r0, #3 @ we will shift by cpu_id * 8 bits - ldr r1, =shmobile_scu_base + ldr r1, 2f ldr r1, [r1] @ SCU base address ldr r2, [r1, #8] @ SCU Power Status Register mov r3, #3
@@ -48,6 +48,7 @@ ENTRY(shmobile_secondary_vector_scu) ldr pc, 1f 1: .long shmobile_invalidate_start - PAGE_OFFSET + PLAT_PHYS_OFFSET +2: .long shmobile_scu_base - PAGE_OFFSET + PLAT_PHYS_OFFSET ENDPROC(shmobile_secondary_vector_scu) .text
Magnus Damm
maintainerPATCH 2/8 ARM: shmobile: Rework SH73A0_SCU_BASE IOMEM() usage
In reply to Magnus DammFrom: Magnus Damm <[email protected]>
Rework the IOMEM() usage for the SCU base address in the case of sh73a0. Removes recently introduced build warnings:
arch/arm/mach-shmobile/smp-sh73a0.c:45:15: warning: initialization makes integer from pointer without a cast [enabled by default] arch/arm/mach-shmobile/smp-sh73a0.c:45:15: warning: (near initialization for 'twd_local_timer.res[0].start') [enabled by default] arch/arm/mach-shmobile/smp-sh73a0.c:45:15: warning: initialization makes integer from pointer without a cast [enabled by default] /arch/arm/mach-shmobile/smp-sh73a0.c:45:15: warning: (near initialization for 'twd_local_timer.res[0].end') [enabled by default]
---
arch/arm/mach-shmobile/smp-sh73a0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-shmobile/smp-sh73a0.c +2 -2
@@ -39,7 +39,7 @@#define PSTR_SHUTDOWN_MODE 3 -#define SH73A0_SCU_BASE IOMEM(0xf0000000) +#define SH73A0_SCU_BASE 0xf0000000#ifdef CONFIG_HAVE_ARM_TWD static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, SH73A0_SCU_BASE + 0x600, 29);
@@ -81,7 +81,7 @@ static void __init sh73a0_smp_prepare_cpstatic void __init sh73a0_smp_init_cpus (void ) {/* setup sh73a0 specific SCU base */ - shmobile_scu_base =SH73A0_SCU_BASE ; + shmobile_scu_base =IOMEM (SH73A0_SCU_BASE );shmobile_smp_init_cpus (scu_get_core_count (shmobile_scu_base)); }
Magnus Damm
maintainerPATCH 3/8 ARM: shmobile: Use R8A7779_SCU_BASE with TWD
In reply to Magnus DammFrom: Magnus Damm <[email protected]>
Rework the IOMEM() usage for the SCU base address in the case of r8a7779. Adjusts the TWD to use R8A7779_SCU_BASE.
---
arch/arm/mach-shmobile/smp-r8a7779.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
arch/arm/mach-shmobile/smp-r8a7779.c +3 -4
@@ -32,7 +32,7 @@#include <asm/smp_twd.h> #define AVECR IOMEM(0xfe700040) -#define R8A7779_SCU_BASE IOMEM(0xf0000000) +#define R8A7779_SCU_BASE 0xf0000000static struct r8a7779_pm_ch r8a7779_ch_cpu1 = { .chan_offs =0x40 ,/* PWRSR0 .. PWRER0 */
@@ -59,8 +59,7 @@ static struct r8a7779_pm_ch *r8a7779_ch_ };#ifdef CONFIG_HAVE_ARM_TWD -static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); - +static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, R8A7779_SCU_BASE + 0x600, 29);void __init r8a7779_register_twd (void ) {twd_local_timer_register (&twd_local_timer);
@@ -178,7 +177,7 @@ static void __init r8a7779_smp_prepare_cstatic void __init r8a7779_smp_init_cpus (void ) {/* setup r8a7779 specific SCU base */ - shmobile_scu_base =R8A7779_SCU_BASE ; + shmobile_scu_base =IOMEM (R8A7779_SCU_BASE );shmobile_smp_init_cpus (scu_get_core_count (shmobile_scu_base)); }
Magnus Damm
maintainerPATCH 4/8 ARM: shmobile: Update r8a7779 to check SCU for hotplug
In reply to Magnus DammFrom: Magnus Damm <[email protected]>
Update the r8a7779 CPU Hotplug code to use SCU PSR to wait for the target CPU core. Previously the shared code in hotplug.c was used to let cpu_kill() wait for cpu_die(). With this change in place the r8a7779 SMP code does not depend on hotplug.c anymore.
---
arch/arm/mach-shmobile/smp-r8a7779.c | 38 ++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-)
arch/arm/mach-shmobile/smp-r8a7779.c +32 -6
@@ -26,6 +26,7 @@#include <linux/irqchip/arm-gic.h> #include <mach/common.h> #include <mach/r8a7779.h> +#include <asm/cacheflush.h> #include <asm/smp_plat.h> #include <asm/smp_scu.h> #include <asm/smp_twd.h>
@@ -68,6 +69,16 @@ void __init r8a7779_register_twd(void) }#endif +static int r8a7779_scu_psr_core_disabled (int cpu) +{ +unsigned long mask =3 << (cpu *8 ); + +if ((__raw_readl (shmobile_scu_base +8 ) & mask) == mask) +return 1 ; + +return 0 ; +} +static void modify_scu_cpu_psr (unsigned long set,unsigned long clr) {void __iomem *scu_base = shmobile_scu_base;
@@ -89,9 +100,6 @@ static int r8a7779_platform_cpu_kill(uns cpu =cpu_logical_map (cpu); -/* disable cache coherency */ -modify_scu_cpu_psr (3 << (cpu *8 ),0 ); -if (cpu <ARRAY_SIZE (r8a7779_ch_cpu)) ch = r8a7779_ch_cpu[cpu];
@@ -110,7 +118,7 @@ static int __maybe_unused r8a7779_cpu_ki* finish before asking SoC-specific code to power off the CPU core. */ for (k =0 ; k <1000 ; k++) { -if (shmobile_cpu_is_dead (cpu)) +if (r8a7779_scu_psr_core_disabled (cpu))return r8a7779_platform_cpu_kill (cpu);mdelay (1 );
@@ -119,6 +127,24 @@ static int __maybe_unused r8a7779_cpu_kireturn 0 ; } +static void __maybe_unused r8a7779_cpu_die (unsigned int cpu) +{ +dsb (); +flush_cache_all (); + +/* disable cache coherency */ +modify_scu_cpu_psr (3 << (cpu *8 ),0 ); + +/* Endless loop until power off from r8a7779_cpu_kill() */ +while (1 ) +cpu_do_idle (); +} + +static int __maybe_unused r8a7779_cpu_disable (unsigned int cpu) +{ +/* only CPU1->3 have power domains, do not allow hotplug of CPU0 */ +return cpu ==0 ? -EPERM :0 ; +}static void __cpuinit r8a7779_secondary_init (unsigned int cpu) {
@@ -179,7 +205,7 @@ struct smp_operations r8a7779_smp_ops _ .smp_boot_secondary = r8a7779_boot_secondary, #ifdef CONFIG_HOTPLUG_CPU .cpu_kill = r8a7779_cpu_kill, - .cpu_die = shmobile_cpu_die, - .cpu_disable = shmobile_cpu_disable, + .cpu_die = r8a7779_cpu_die, + .cpu_disable = r8a7779_cpu_disable, #endif };
Magnus Damm
maintainerPATCH 5/8 ARM: shmobile: Update r8a7779 to use scu_power_mode()
In reply to Magnus DammFrom: Magnus Damm <[email protected]>
Update the SMP code for R8A7779 to make use of the shared SCU function scu_power_mode() together with the early setup code in shmobile_secondary_vector_scu.
With this patch in place the secondary CPUs modify the SCU setting during early boot instead of letting other CPUs deal with the coherency setting before boot. In other words, we used to setup coherency before boot in r8a7779_boot_secondary() but that bit is now instead handled by the code in shmobile_secondary_vector_scu.
---
arch/arm/mach-shmobile/smp-r8a7779.c | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-)
arch/arm/mach-shmobile/smp-r8a7779.c +5 -27
@@ -58,9 +58,6 @@ static struct r8a7779_pm_ch *r8a7779_ch_ [3] = &r8a7779_ch_cpu3, }; -static DEFINE_SPINLOCK (scu_lock); -static unsigned long tmp; -#ifdef CONFIG_HAVE_ARM_TWD static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, R8A7779_SCU_BASE + 0x600, 29);void __init r8a7779_register_twd (void )
@@ -79,20 +76,6 @@ static int r8a7779_scu_psr_core_disabledreturn 0 ; } -static void modify_scu_cpu_psr (unsigned long set,unsigned long clr) -{ -void __iomem *scu_base = shmobile_scu_base; - -spin_lock (&scu_lock); - tmp =__raw_readl (scu_base +8 ); - tmp &= ~clr; - tmp |= set; -spin_unlock (&scu_lock); - -/* disable cache coherency after releasing the lock */ -__raw_writel (tmp, scu_base +8 ); -} -static int r8a7779_platform_cpu_kill (unsigned int cpu) {struct r8a7779_pm_ch *ch =NULL ;
@@ -133,7 +116,7 @@ static void __maybe_unused r8a7779_cpu_dflush_cache_all ();/* disable cache coherency */ -modify_scu_cpu_psr (3 << (cpu *8 ),0 ); +scu_power_mode (shmobile_scu_base,SCU_PM_POWEROFF );/* Endless loop until power off from r8a7779_cpu_kill() */ while (1 )
@@ -158,9 +141,6 @@ static int __cpuinit r8a7779_boot_second cpu =cpu_logical_map (cpu); -/* enable cache coherency */ -modify_scu_cpu_psr (0 ,3 << (cpu *8 )); -if (cpu <ARRAY_SIZE (r8a7779_ch_cpu)) ch = r8a7779_ch_cpu[cpu];
@@ -172,15 +152,13 @@ static int __cpuinit r8a7779_boot_secondstatic void __init r8a7779_smp_prepare_cpus (unsigned int max_cpus) { -int cpu =cpu_logical_map (0 ); -scu_enable (shmobile_scu_base); -/* Map the reset vector (in headsmp.S) */ -__raw_writel (__pa (shmobile_secondary_vector),AVECR ); +/* Map the reset vector (in headsmp-scu.S) */ +__raw_writel (__pa (shmobile_secondary_vector_scu),AVECR ); -/* enable cache coherency on CPU0 */ -modify_scu_cpu_psr (0 ,3 << (cpu *8 )); +/* enable cache coherency on booting CPU */ +scu_power_mode (shmobile_scu_base,SCU_PM_NORMAL );r8a7779_pm_init ();
Magnus Damm
maintainerPATCH 6/8 ARM: shmobile: Use sh73a0-specific cpu disable code
In reply to Magnus DammFrom: Magnus Damm <[email protected]>
Convert the sh73a0 CPU Hotplug code to use a local implementation of ->cpu_disable(). With this change in place the sh73a0 SMP code does no longer depend on hotplug.c.
---
arch/arm/mach-shmobile/smp-sh73a0.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/smp-sh73a0.c +6 -1
@@ -124,6 +124,11 @@ static void sh73a0_cpu_die(unsigned int/* Enter shutdown mode */ cpu_do_idle (); } + +static int sh73a0_cpu_disable (unsigned int cpu) +{ +return 0 ;/* CPU0 and CPU1 supported */ +}#endif /* CONFIG_HOTPLUG_CPU */ struct smp_operations sh73a0_smp_ops__initdata = {
@@ -134,6 +139,6 @@ struct smp_operations sh73a0_smp_ops __i#ifdef CONFIG_HOTPLUG_CPU .cpu_kill = sh73a0_cpu_kill, .cpu_die = sh73a0_cpu_die, - .cpu_disable = shmobile_cpu_disable_any, + .cpu_disable = sh73a0_cpu_disable,#endif };
Magnus Damm
maintainerPATCH 7/8 ARM: shmobile: Rearrange r8a7779 cpu hotplug code
In reply to Magnus DammFrom: Magnus Damm <[email protected]>
Update the r8a7779 SMP code and CPU Hotplug in particular to follow the same style as sh73a0. This means dropping __maybe_unused for #ifdef CONFIG_HOTPLUG_CPU.
---
arch/arm/mach-shmobile/smp-r8a7779.c | 96 +++++++++++++++++----------------- 1 file changed, 49 insertions(+), 47 deletions(-)
arch/arm/mach-shmobile/smp-r8a7779.c +49 -47
@@ -66,16 +66,6 @@ void __init r8a7779_register_twd(void) }#endif -static int r8a7779_scu_psr_core_disabled (int cpu) -{ -unsigned long mask =3 << (cpu *8 ); - -if ((__raw_readl (shmobile_scu_base +8 ) & mask) == mask) -return 1 ; - -return 0 ; -} -static int r8a7779_platform_cpu_kill (unsigned int cpu) {struct r8a7779_pm_ch *ch =NULL ;
@@ -92,43 +82,6 @@ static int r8a7779_platform_cpu_kill(unsreturn ret ? ret :1 ; } -static int __maybe_unused r8a7779_cpu_kill (unsigned int cpu) -{ -int k; - -/* this function is running on another CPU than the offline target, -* here we need wait for shutdown code in platform_cpu_die() to -* finish before asking SoC-specific code to power off the CPU core. -*/ -for (k =0 ; k <1000 ; k++) { -if (r8a7779_scu_psr_core_disabled (cpu)) -return r8a7779_platform_cpu_kill (cpu); - -mdelay (1 ); - } - -return 0 ; -} - -static void __maybe_unused r8a7779_cpu_die (unsigned int cpu) -{ -dsb (); -flush_cache_all (); - -/* disable cache coherency */ -scu_power_mode (shmobile_scu_base,SCU_PM_POWEROFF ); - -/* Endless loop until power off from r8a7779_cpu_kill() */ -while (1 ) -cpu_do_idle (); -} - -static int __maybe_unused r8a7779_cpu_disable (unsigned int cpu) -{ -/* only CPU1->3 have power domains, do not allow hotplug of CPU0 */ -return cpu ==0 ? -EPERM :0 ; -} -static void __cpuinit r8a7779_secondary_init (unsigned int cpu) {gic_secondary_init (0 );
@@ -176,6 +129,55 @@ static void __init r8a7779_smp_init_cpusshmobile_smp_init_cpus (scu_get_core_count (shmobile_scu_base)); } +#ifdef CONFIG_HOTPLUG_CPU +static int r8a7779_scu_psr_core_disabled (int cpu) +{ +unsigned long mask =3 << (cpu *8 ); + +if ((__raw_readl (shmobile_scu_base +8 ) & mask) == mask) +return 1 ; + +return 0 ; +} + +static int r8a7779_cpu_kill (unsigned int cpu) +{ +int k; + +/* this function is running on another CPU than the offline target, +* here we need wait for shutdown code in platform_cpu_die() to +* finish before asking SoC-specific code to power off the CPU core. +*/ +for (k =0 ; k <1000 ; k++) { +if (r8a7779_scu_psr_core_disabled (cpu)) +return r8a7779_platform_cpu_kill (cpu); + +mdelay (1 ); + } + +return 0 ; +} + +static void r8a7779_cpu_die (unsigned int cpu) +{ +dsb (); +flush_cache_all (); + +/* disable cache coherency */ +scu_power_mode (shmobile_scu_base,SCU_PM_POWEROFF ); + +/* Endless loop until power off from r8a7779_cpu_kill() */ +while (1 ) +cpu_do_idle (); +} + +static int r8a7779_cpu_disable (unsigned int cpu) +{ +/* only CPU1->3 have power domains, do not allow hotplug of CPU0 */ +return cpu ==0 ? -EPERM :0 ; +} +#endif /* CONFIG_HOTPLUG_CPU */ +struct smp_operations r8a7779_smp_ops__initdata = { .smp_init_cpus = r8a7779_smp_init_cpus, .smp_prepare_cpus = r8a7779_smp_prepare_cpus,
Magnus Damm
maintainerPATCH 8/8 ARM: shmobile: Remove unused hotplug.c
In reply to Magnus DammFrom: Magnus Damm <[email protected]>
Each CPU Hotplug implementation for mach-shmobile is now self-contained, so this change removes unused helper code in hotplug.c. The two CPU Hotplug capable SoCs sh73a0 and r8a7779 remain unchanged.
---
arch/arm/mach-shmobile/Makefile | 1 arch/arm/mach-shmobile/hotplug.c | 64 -------------------------- arch/arm/mach-shmobile/include/mach/common.h | 10 ---- 3 files changed, 75 deletions(-)
arch/arm/mach-shmobile/Makefile +0 -1
@@ -14,7 +14,6 @@ obj-$(CONFIG_ARCH_EMEV2) += setup-emev2. # SMP objects smp-y := platsmp.o headsmp.o -smp-$(CONFIG_HOTPLUG_CPU) += hotplug.o smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-scu.o smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o headsmp-scu.o smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o
arch/arm/mach-shmobile/hotplug.c deleted +0 -64
64 lines not on this page · raw message
arch/arm/mach-shmobile/include/mach/common.h +0 -10
@@ -85,16 +85,6 @@ int shmobile_cpuidle_init(void);static inline int shmobile_cpuidle_init (void ) {return 0 ; }#endif -extern void shmobile_cpu_die (unsigned int cpu); -extern int shmobile_cpu_disable (unsigned int cpu); -extern int shmobile_cpu_disable_any (unsigned int cpu); - -#ifdef CONFIG_HOTPLUG_CPU -extern int shmobile_cpu_is_dead (unsigned int cpu); -#else -static inline int shmobile_cpu_is_dead (unsigned int cpu) {return 1 ; } -#endif -extern void __iomem *shmobile_scu_base;extern void shmobile_smp_init_cpus (unsigned int ncores);
PATCH 2/8 ARM: shmobile: Rework SH73A0_SCU_BASE IOMEM() usage
In reply to Magnus DammQuoted 8 lines · Magnus Damm
#define
PSTR_SHUTDOWN_MODE3arch/arm/mach-shmobile/smp-sh73a0.c +1
-1-#define SH73A0_SCU_BASE IOMEM(0xf0000000) +#define SH73A0_SCU_BASE 0xf0000000#ifdef CONFIG_HAVE_ARM_TWD static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, SH73A0_SCU_BASE + 0x600, 29);
arch/arm/mach-shmobile/smp-sh73a0.c static void __init sh73a0_smp_prepare_cp · line 87
Quoted 8 lines
arch/arm/mach-shmobile/smp-sh73a0.c +1
-1@@ -81,7 +81,7 @@ static void __init sh73a0_smp_prepare_cpstatic void __init sh73a0_smp_init_cpus (void ) {/* setup sh73a0 specific SCU base */ - shmobile_scu_base =SH73A0_SCU_BASE ; + shmobile_scu_base =IOMEM (SH73A0_SCU_BASE );shmobile_smp_init_cpus (scu_get_core_count (shmobile_scu_base)); }
Ok, this gets rid of the warning, but I'm a bit worried about how it is hardwiring the fact that the SCU physical address has the same bit pattern as the __iomem token.
While I realize that you already rely on this in a lot of places in the shmobile code, I see a red light going off every time I read code like this, and it is not any more logical than the previous version.
It would be nice to keep these address spaces separate at least in new code, mostly in order to not confuse reviewers with code that is based on assumptions which are not generally true, but also to be more flexible with the virtual memory layout. On a related topic, you are using an entire 256 MB section of your virtual address space for sh73a0 and sh7372 and 160 MB for r8a7740. Putting less of that into the identity mapped area would free up space for vmalloc, but it's hard to prove that doing this is correct when you have all sorts of code using a hardcoded virtual MMIO address token.
Arnd
PATCH 2/8 ARM: shmobile: Rework SH73A0_SCU_BASE IOMEM() usage
Quoted 9 lines · Arnd Bergmann
Ok, this gets rid of the warning, but I'm a bit worried about how it is hardwiring the fact that the SCU physical address has the same bit pattern as the
__iomemtoken.While I realize that you already rely on this in a lot of places in the shmobile code, I see a red light going off every time I read code like this, and it is not any more logical than the previous version.
Quoted 10 lines
It would be nice to keep these address spaces separate at least in new code, mostly in order to not confuse reviewers with code that is based on assumptions which are not generally true, but also to be more flexible with the virtual memory layout. On a related topic, you are using an entire 256 MB section of your virtual address space for sh73a0 and sh7372 and 160 MB for r8a7740. Putting less of that into the identity mapped area would free up space for vmalloc, but it's hard to prove that doing this is correct when you have all sorts of code using a hardcoded virtual MMIO address token.
To clarify my rant: I'm absolutely fine with this code going in for now, but I'd like to see a long-term plan about what to do with the hardcoded virtual address hacks.
Arnd
PATCH 1/8 ARM: shmobile: Fix base address readout in headsmp-scu.S
In reply to Magnus DammHi Magnus,
yes using the physical address works.
Thanks,
Bastian
2013/2/18 Magnus Damm <[email protected]>:
Quoted 37 lines
From: Magnus Damm <[email protected]>
Rework the early SCU setup code in
headsmp-scu.Sto read the base address in the same way as we use to fetch the address of the invalidation function.Reported-by Bastian Hecht <[email protected]>Signed-off-by Magnus Damm <[email protected]>---
Tested on r8a7779. Feel free to add incrementally or fold into:
[PATCH 05/06] ARM: shmobile: Commonshmobile_scu_baseinheadsmp-scu.SBastian, does this solve your problem?
arch/arm/mach-shmobile/headsmp-scu.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/arm/mach-shmobile/headsmp-scu.S 2013-02-18 16:17:58.000000000 +0900 renamed from arch/arm/mach-shmobile/headsmp-scu.S +2
-1@@ -39,7 +39,7 @@ ENTRY(shmobile_secondary_vector_scu) mrc p15, 0, r0, c0, c0, 5 @ read MIPDR and r0, r0, #3 @ mask out cpu ID lsl r0, r0, #3 @ we will shift by cpu_id * 8 bits - ldr r1, =shmobile_scu_base + ldr r1, 2f ldr r1, [r1] @ SCU base address ldr r2, [r1, #8] @ SCU Power Status Register mov r3, #3@@ -48,6 +48,7 @@ ENTRY(shmobile_secondary_vector_scu) ldr pc, 1f 1: .long shmobile_invalidate_start - PAGE_OFFSET + PLAT_PHYS_OFFSET +2: .long shmobile_scu_base - PAGE_OFFSET + PLAT_PHYS_OFFSET ENDPROC(shmobile_secondary_vector_scu) .text
cover ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2
In reply to Magnus DammQuoted 21 lines · Magnus Damm
ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2
[PATCH 01/08] ARM: shmobile: Fix base address readout in
headsmp-scu.S[PATCH 02/08] ARM: shmobile: ReworkSH73A0_SCU_BASEIOMEM()usage [PATCH 03/08] ARM: shmobile: UseR8A7779_SCU_BASEwith TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to usescu_power_mode()[PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unusedhotplug.cFinalize the SCU rework by performing minor fixes and converting the r8a7779 SMP code to make use of common
scu_power_mode()code and the early SCU setup code inheadsmp-scu.S.Also, to save a few line remove
hotplug.cwhile at it.The only remaining itch to scratch here is to fix up CPU Hotplug of CPU0 on r8a7779, but for that to happen we first need to start accounting for spurious interrupts during shut down.
Quoted 6 lines
Signed-off-by Magnus Damm <[email protected]>---
No known dependencies apart from previous SMP cleanup series "[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework" Written against -next in renesas.git.
I believe those are queued up for upstream in the soc5 branch.
Please let me know when you are comfortable with me applying these patches to that branch. I'm fine with that answer being "now".
Magnus Damm
maintainercover ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2
Quoted 25 lines · Simon Horman
Quoted 24 lines · Magnus Damm
ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2
[PATCH 01/08] ARM: shmobile: Fix base address readout in
headsmp-scu.S[PATCH 02/08] ARM: shmobile: ReworkSH73A0_SCU_BASEIOMEM()usage [PATCH 03/08] ARM: shmobile: UseR8A7779_SCU_BASEwith TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to usescu_power_mode()[PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unusedhotplug.cFinalize the SCU rework by performing minor fixes and converting the r8a7779 SMP code to make use of common
scu_power_mode()code and the early SCU setup code inheadsmp-scu.S.Also, to save a few line remove
hotplug.cwhile at it.The only remaining itch to scratch here is to fix up CPU Hotplug of CPU0 on r8a7779, but for that to happen we first need to start accounting for spurious interrupts during shut down.
Signed-off-by Magnus Damm <[email protected]>---
Quoted 8 lines
Quoted 3 lines
No known dependencies apart from previous SMP cleanup series "[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework" Written against -next in renesas.git.
I believe those are queued up for upstream in the soc5 branch.
Please let me know when you are comfortable with me applying these patches to that branch. I'm fine with that answer being "now".
Now sounds wonderful. Thanks Simon.
Magnus Damm
maintainerPATCH 2/8 ARM: shmobile: Rework SH73A0_SCU_BASE IOMEM() usage
In reply to Arnd BergmannQuoted 21 lines · Arnd Bergmann
Quoted 9 lines · Arnd Bergmann
Ok, this gets rid of the warning, but I'm a bit worried about how it is hardwiring the fact that the SCU physical address has the same bit pattern as the
__iomemtoken.While I realize that you already rely on this in a lot of places in the shmobile code, I see a red light going off every time I read code like this, and it is not any more logical than the previous version.
Quoted 10 lines
It would be nice to keep these address spaces separate at least in new code, mostly in order to not confuse reviewers with code that is based on assumptions which are not generally true, but also to be more flexible with the virtual memory layout. On a related topic, you are using an entire 256 MB section of your virtual address space for sh73a0 and sh7372 and 160 MB for r8a7740. Putting less of that into the identity mapped area would free up space for vmalloc, but it's hard to prove that doing this is correct when you have all sorts of code using a hardcoded virtual MMIO address token.
Quoted 3 lines
To clarify my rant: I'm absolutely fine with this code going in for now, but I'd like to see a long-term plan about what to do with the hardcoded virtual address hacks.
Thanks for the clarification.
For mach-shmobile the three major components that rely on entity mapped memory maps are SMP, clocks and power domains. The clocks should really be moved in the common direction and I intend to get people to focus on that in the not too distant future (next 6 months). Power domains should be rather easy to convert. SMP tends to be a bit of a headache because last time I checked I couldn't use ioremap() at ->smp_init_cpus() time. What I recall is that ioremap() hanged instead of returning something.
Anyway, if I track down the ioremap() issue, would it be possible for you to check if it can be reproduced on some other sub-architecture?
Thanks,
/ magnus
Simon Horman
Appliedcover ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2
In reply to Magnus DammQuoted 30 lines · Magnus Damm
Quoted 29 lines · Simon Horman
Quoted 27 lines · Magnus Damm
ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2
[PATCH 01/08] ARM: shmobile: Fix base address readout in
headsmp-scu.S[PATCH 02/08] ARM: shmobile: ReworkSH73A0_SCU_BASEIOMEM()usage [PATCH 03/08] ARM: shmobile: UseR8A7779_SCU_BASEwith TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to usescu_power_mode()[PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unusedhotplug.cFinalize the SCU rework by performing minor fixes and converting the r8a7779 SMP code to make use of common
scu_power_mode()code and the early SCU setup code inheadsmp-scu.S.Also, to save a few line remove
hotplug.cwhile at it.The only remaining itch to scratch here is to fix up CPU Hotplug of CPU0 on r8a7779, but for that to happen we first need to start accounting for spurious interrupts during shut down.
Signed-off-by Magnus Damm <[email protected]>---
No known dependencies apart from previous SMP cleanup series "[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework" Written against -next in renesas.git.
Quoted 6 lines
Quoted 4 lines
I believe those are queued up for upstream in the soc5 branch.
Please let me know when you are comfortable with me applying these patches to that branch. I'm fine with that answer being "now".
Now sounds wonderful. Thanks Simon.
[some time passes]
Thanks, applied to the soc5 branch.
PATCH 2/8 ARM: shmobile: Rework SH73A0_SCU_BASE IOMEM() usage
In reply to Magnus DammQuoted 11 lines · Magnus Damm
For mach-shmobile the three major components that rely on entity mapped memory maps are SMP, clocks and power domains. The clocks should really be moved in the common direction and I intend to get people to focus on that in the not too distant future (next 6 months). Power domains should be rather easy to convert. SMP tends to be a bit of a headache because last time I checked I couldn't use
ioremap()at ->smp_init_cpus() time. What I recall is thatioremap()hanged instead of returning something.Anyway, if I track down the
ioremap()issue, would it be possible for you to check if it can be reproduced on some other sub-architecture?
You are right that ioremap cannot be used from ->smp_init_cpus() and any code called from there needs to use a static mapping for accessing MMIO registers. There is nothing wrong with that. There are in fact three distinct reasons why people use static MMIO mappings with iotable_init():
1. For MMIO registers that need to be accessed before ioremap works. This usually means the SMP startup and the early printk (which I believe shmobile is not using).
2. For getting hugetlb mappings of MMIO registers into the kernel address space. If you have a lot of registers in the same area, using a single TLB to map them is more efficient, even when accessing the registers through ioremap from a device driver.
3. For hardcoding the virtual address to a location that is passed to device drivers as compile-time constants.
The first two are absolutely fine, there are no objections to those. The third one is tradtitionally used on a lot of the older platforms, but with the multiplatform work, we are moving away from it, towards passing resources in the platform device (ideally from DT, but that is an orthogonal question here). AFAICT, shmobile is the only "modern" platform that still relies on fixed virtual addresses, and it is the only one I know that uses a mapping where the virtual address equals the physical address.
Arnd
Magnus Damm
maintainerPATCH 2/8 ARM: shmobile: Rework SH73A0_SCU_BASE IOMEM() usage
Quoted 19 lines · Arnd Bergmann
Quoted 11 lines · Magnus Damm
For mach-shmobile the three major components that rely on entity mapped memory maps are SMP, clocks and power domains. The clocks should really be moved in the common direction and I intend to get people to focus on that in the not too distant future (next 6 months). Power domains should be rather easy to convert. SMP tends to be a bit of a headache because last time I checked I couldn't use
ioremap()at ->smp_init_cpus() time. What I recall is thatioremap()hanged instead of returning something.Anyway, if I track down the
ioremap()issue, would it be possible for you to check if it can be reproduced on some other sub-architecture?You are right that ioremap cannot be used from ->smp_init_cpus() and any code called from there needs to use a static mapping for accessing MMIO registers. There is nothing wrong with that. There are in fact three distinct reasons why people use static MMIO mappings with
iotable_init():
Quoted 3 lines
1. For MMIO registers that need to be accessed before ioremap works. This usually means the SMP startup and the early printk (which I believe shmobile is not using).
Thanks for describing these.
Is there any particular reason why SMP startup needs to happen earlier than ioremap() is available?
Quoted 1 line
From a hardware point of view on Cortex-A9 the SCU needs to be enabled
and the number of available cores need to be determined. The SCU enabling can probably happen later and the number of cores are already limited to the kernel configuration maximum number of cores setting, so it should be possible to use that to size any early per-cpu variables if needed. So I wonder why we're not enabling SMP later than we actually do? Using maxcpus=1 and late CPU hotplug from user space is certainly working fine.
Regarding early printk, you are correct that we're not using that ARM specific debug output. Instead we are relying on earlyprintk via early platform devices. This way we are not only multi-soc and multi-subarch already, we are also multi-arch. For really early console output we rely on the clocks and pin function being initialized by the boot loader and we also require 1:1 entity mappings so we can use printouts before ioremap() is functional. So yes, we like using 1:1 virt-phys memory maps for early printouts.
We do not use early printk with DT at this point. If we would be able to move the SMP init later then perhaps we could debug SMP issues with serial ports described by DT in the future?
Quoted 4 lines
2. For getting hugetlb mappings of MMIO registers into the kernel address space. If you have a lot of registers in the same area, using a single TLB to map them is more efficient, even when accessing the registers through ioremap from a device driver.
Sure.
Quoted 4 lines
3. For hardcoding the virtual address to a location that is passed to device drivers as compile-time constants.
The first two are absolutely fine, there are no objections to those.
Ok. As you probably can tell by now - I would like to get rid of the SMP case if possible.
Quoted 7 lines
The third one is tradtitionally used on a lot of the older platforms, but with the multiplatform work, we are moving away from it, towards passing resources in the platform device (ideally from DT, but that is an orthogonal question here). AFAICT, shmobile is the only "modern" platform that still relies on fixed virtual addresses, and it is the only one I know that uses a mapping where the virtual address equals the physical address.
The 1:1 mapping is deliberately chosen to be simple. So in the case when people do register I/O without ioremap() then at least we can look up the address in the data sheet. I've seen too many examples of people not using ioremap and instead inventing their own magic mapping table with undocumented hard coded address that map to something even more unknown. Of course we should be aiming at using ioremap(). If we for some reason can't then we should use 1:1 mappings.
While I agree to move more towards using ioremap(), I can't really see how this affects our multiplatform situation. Our device drivers have always been using the driver model and we do never export any virtual addresses in any header files. If you have any particular area that you think needs work related to ioremap() then perhaps we can get together on next conference and talk it through?
As I mentioned before, from my point of view the main limiting factor for mach-shmobile multiplatform at this point is the clock framework. The SH clock framework does already support ioremap() though, so it is just a matter of making the clock code actually use it. And while we're doing that we may as well solve the multiplatform issue to and move towards common clocks.
Thanks,
/ magnus
PATCH 2/8 ARM: shmobile: Rework SH73A0_SCU_BASE IOMEM() usage
Quoted 8 lines · Magnus Damm
Quoted 7 lines · Arnd Bergmann
On Monday 25 February 2013, Magnus Damm wrote:
You are right that ioremap cannot be used from ->smp_init_cpus() and any code called from there needs to use a static mapping for accessing MMIO registers. There is nothing wrong with that. There are in fact three distinct reasons why people use static MMIO mappings withiotable_init():
Quoted 8 lines
Quoted 3 lines
1. For MMIO registers that need to be accessed before ioremap works. This usually means the SMP startup and the early printk (which I believe shmobile is not using).
Thanks for describing these.
Is there any particular reason why SMP startup needs to happen earlier than
ioremap()is available?
I think it's mostly traditional reason I think.
Quoted 8 lines
From a hardware point of view on Cortex-A9 the SCU needs to be enabled and the number of available cores need to be determined. The SCU enabling can probably happen later and the number of cores are already limited to the kernel configuration maximum number of cores setting, so it should be possible to use that to size any early per-cpu variables if needed. So I wonder why we're not enabling SMP later than we actually do? Using maxcpus=1 and late CPU hotplug from user space is certainly working fine.
AFAIK, on Cortex-A15 we already rely on getting the number of cores from the device tree, which is also available at the right time, without the need for an early mapping. It would not be hard to do the same on Cortex-A9. Then again, the static mapping there does not do harm as I said.
Quoted 8 lines
Regarding early printk, you are correct that we're not using that ARM specific debug output. Instead we are relying on earlyprintk via early platform devices. This way we are not only multi-soc and multi-subarch already, we are also multi-arch. For really early console output we rely on the clocks and pin function being initialized by the boot loader and we also require 1:1 entity mappings so we can use printouts before
ioremap()is functional. So yes, we like using 1:1 virt-phys memory maps for early printouts.
Ok.
Quoted 11 lines
We do not use early printk with DT at this point. If we would be able to move the SMP init later then perhaps we could debug SMP issues with serial ports described by DT in the future?
Quoted 4 lines
3. For hardcoding the virtual address to a location that is passed to device drivers as compile-time constants.
The first two are absolutely fine, there are no objections to those.
Ok. As you probably can tell by now - I would like to get rid of the SMP case if possible.
I would certainly welcome a patch that moves the SMP initialization to a later point. I'm not sure if it requires changes to architecture independent code, but it does sound like a good idea.
Quoted 8 lines
Quoted 7 lines
The third one is tradtitionally used on a lot of the older platforms, but with the multiplatform work, we are moving away from it, towards passing resources in the platform device (ideally from DT, but that is an orthogonal question here). AFAICT, shmobile is the only "modern" platform that still relies on fixed virtual addresses, and it is the only one I know that uses a mapping where the virtual address equals the physical address.
Quoted 7 lines
The 1:1 mapping is deliberately chosen to be simple. So in the case when people do register I/O without
ioremap()then at least we can look up the address in the data sheet. I've seen too many examples of people not using ioremap and instead inventing their own magic mapping table with undocumented hard coded address that map to something even more unknown. Of course we should be aiming at usingioremap(). If we for some reason can't then we should use 1:1 mappings.
Well, I would argue that when someone doesn't understand the basic interfaces we expose to device drivers, they probably shouldn't be writing kernel code. ;)
Quoted 6 lines
While I agree to move more towards using
ioremap(), I can't really see how this affects our multiplatform situation. Our device drivers have always been using the driver model and we do never export any virtual addresses in any header files. If you have any particular area that you think needs work related toioremap()then perhaps we can get together on next conference and talk it through?
It may not be as bad as I thought. I know that at least the intc controller is fundamentally built around this assumption (I tried changing it, and that didn't end well), but that may be the only one, following the recent cleanup of the pfc driver.
The main worry is probably that people will take the platform code as example when writing device drivers, and that uses hardcoded IOMEM() macros. There are probably a couple of instances where that is the best solution, but for those, I would suggest using offsets from a base register that gets passed into iotable_init() rather than literal numbers.
Quoted 6 lines
As I mentioned before, from my point of view the main limiting factor for mach-shmobile multiplatform at this point is the clock framework. The SH clock framework does already support
ioremap()though, so it is just a matter of making the clock code actually use it. And while we're doing that we may as well solve the multiplatform issue to and move towards common clocks.
Ok, good to hear.
Arnd
Magnus Damm
maintainerPATCH 2/8 ARM: shmobile: Rework SH73A0_SCU_BASE IOMEM() usage
Hi Arnd,
Quoted 13 lines · Arnd Bergmann
Quoted 12 lines · Magnus Damm
Quoted 10 lines · Arnd Bergmann
On Monday 25 February 2013, Magnus Damm wrote:
You are right that ioremap cannot be used from ->smp_init_cpus() and any code called from there needs to use a static mapping for accessing MMIO registers. There is nothing wrong with that. There are in fact three distinct reasons why people use static MMIO mappings withiotable_init():1. For MMIO registers that need to be accessed before ioremap works. This usually means the SMP startup and the early printk (which I believe shmobile is not using).
Quoted 6 lines
Quoted 4 lines
Thanks for describing these.
Is there any particular reason why SMP startup needs to happen earlier than
ioremap()is available?I think it's mostly traditional reason I think.
I think so too.
Quoted 9 lines
Quoted 8 lines
From a hardware point of view on Cortex-A9 the SCU needs to be enabled and the number of available cores need to be determined. The SCU enabling can probably happen later and the number of cores are already limited to the kernel configuration maximum number of cores setting, so it should be possible to use that to size any early per-cpu variables if needed. So I wonder why we're not enabling SMP later than we actually do? Using maxcpus=1 and late CPU hotplug from user space is certainly working fine.
Quoted 5 lines
AFAIK, on Cortex-A15 we already rely on getting the number of cores from the device tree, which is also available at the right time, without the need for an early mapping. It would not be hard to do the same on Cortex-A9. Then again, the static mapping there does not do harm as I said.
I understand that you feel that static mapping in the case of SMP is acceptable.
Quoted 18 lines
Quoted 8 lines
Regarding early printk, you are correct that we're not using that ARM specific debug output. Instead we are relying on earlyprintk via early platform devices. This way we are not only multi-soc and multi-subarch already, we are also multi-arch. For really early console output we rely on the clocks and pin function being initialized by the boot loader and we also require 1:1 entity mappings so we can use printouts before
ioremap()is functional. So yes, we like using 1:1 virt-phys memory maps for early printouts.Ok.
Quoted 7 lines
We do not use early printk with DT at this point. If we would be able to move the SMP init later then perhaps we could debug SMP issues with serial ports described by DT in the future?
Quoted 3 lines
3. For hardcoding the virtual address to a location that is passed to device drivers as compile-time constants.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
The first two are absolutely fine, there are no objections to those.
Ok. As you probably can tell by now - I would like to get rid of the SMP case if possible.
I would certainly welcome a patch that moves the SMP initialization to a later point. I'm not sure if it requires changes to architecture independent code, but it does sound like a good idea.
Good to hear that that this may be a move in the right direction!
Quoted 16 lines
Quoted 8 lines
Quoted 7 lines
The third one is tradtitionally used on a lot of the older platforms, but with the multiplatform work, we are moving away from it, towards passing resources in the platform device (ideally from DT, but that is an orthogonal question here). AFAICT, shmobile is the only "modern" platform that still relies on fixed virtual addresses, and it is the only one I know that uses a mapping where the virtual address equals the physical address.
Quoted 7 lines
The 1:1 mapping is deliberately chosen to be simple. So in the case when people do register I/O without
ioremap()then at least we can look up the address in the data sheet. I've seen too many examples of people not using ioremap and instead inventing their own magic mapping table with undocumented hard coded address that map to something even more unknown. Of course we should be aiming at usingioremap(). If we for some reason can't then we should use 1:1 mappings.
Quoted 3 lines
Well, I would argue that when someone doesn't understand the basic interfaces we expose to device drivers, they probably shouldn't be writing kernel code. ;)
I am not sure how this is related to device drivers actually. The example I was thinking about was snapshot-style development on some ancient kernel version. In that case the developers simply seemed to follow the at-that-point common coding style in the ARM architecture. I am happy to see that the ARM architecture code is getting cleaner bit by bit.
Quoted 11 lines
Quoted 6 lines
While I agree to move more towards using
ioremap(), I can't really see how this affects our multiplatform situation. Our device drivers have always been using the driver model and we do never export any virtual addresses in any header files. If you have any particular area that you think needs work related toioremap()then perhaps we can get together on next conference and talk it through?It may not be as bad as I thought. I know that at least the intc controller is fundamentally built around this assumption (I tried changing it, and that didn't end well), but that may be the only one, following the recent cleanup of the pfc driver.
Uhm, I am not sure where you got that idea about the INTC driver. Allow me to clarify.
Regarding the shared INTC code base I recall implementing ioremap() support there 2010, feel free to search the archives for "[PATCH] sh:
INTC ioremap support V2".
As for actual SoC support, this varies with interrupt controller and SoC. It is basically a matter of if I/O memory windows are passed to the INTC driver or not.
A typical example would be sh7372 that has two interrupt controllers:
INTCA and INTCS. In intc-sh7372.c you have the following:
INTCA (no resources - using the 0xe6xxxxxx 1:1 mapping):
static DECLARE_INTC_DESC(intca_desc, "sh7372-intca",
intca_vectors, intca_groups, intca_mask_registers, intca_prio_registers, NULL);
INTCS (resources - relies on ioremap()):
static struct resource intcs_resources[] __initdata = {
[0] = {
.start = 0xffd20000,
.end = 0xffd201ff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 0xffd50000,
.end = 0xffd501ff,
.flags = IORESOURCE_MEM,
}
};static struct intc_desc intcs_desc __initdata = {
.name = "sh7372-intcs",
.force_enable = ENABLED_INTCS,
.skip_syscore_suspend = true,
.resource = intcs_resources,
.num_resources = ARRAY_SIZE(intcs_resources),
.hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers,
intcs_prio_registers, NULL, NULL),
};
Adding I/O memory resources to the already existing INTC controllers is not a particularly difficult task. Would you like us to perform such a change?
Quoted 6 lines
The main worry is probably that people will take the platform code as example when writing device drivers, and that uses hardcoded
IOMEM()macros. There are probably a couple of instances where that is the best solution, but for those, I would suggest using offsets from a base register that gets passed intoiotable_init()rather than literal numbers.
If you look at all our regular device drivers we use a base register + offset. In such cases that kind of design makes a lot of sense.
In the case of INTC and PFC we do not follow this style. This since each version of the hardware block varies quite a bit and there often are a couple of I/O memory windows associated with each hardware block instance. So the design has been to use the same physical addresses as are described in the data sheet, and for bit fields and register width follow the same type of representation as the data sheet to allow easy development and validation.
Keep in mind that in arch/sh and arch/arm we have over 30 different variants of INTC hardware blocks.
So to summarize, INTC, PFC and CPG (clocks) have ioremap support included in the actual driver code. If the SoC makes use of it or not is a different question. =)
Quoted 8 lines
Quoted 6 lines
As I mentioned before, from my point of view the main limiting factor for mach-shmobile multiplatform at this point is the clock framework. The SH clock framework does already support
ioremap()though, so it is just a matter of making the clock code actually use it. And while we're doing that we may as well solve the multiplatform issue to and move towards common clocks.Ok, good to hear.
So how would you like to proceed with this matter?
Thanks,
/ magnus
Magnus Damm
maintainerQuoted 33 lines · Simon Horman
Quoted 32 lines · Magnus Damm
Quoted 31 lines · Simon Horman
Quoted 21 lines · Magnus Damm
ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2
[PATCH 01/08] ARM: shmobile: Fix base address readout in
headsmp-scu.S[PATCH 02/08] ARM: shmobile: ReworkSH73A0_SCU_BASEIOMEM()usage [PATCH 03/08] ARM: shmobile: UseR8A7779_SCU_BASEwith TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to usescu_power_mode()[PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unusedhotplug.cFinalize the SCU rework by performing minor fixes and converting the r8a7779 SMP code to make use of common
scu_power_mode()code and the early SCU setup code inheadsmp-scu.S.Also, to save a few line remove
hotplug.cwhile at it.The only remaining itch to scratch here is to fix up CPU Hotplug of CPU0 on r8a7779, but for that to happen we first need to start accounting for spurious interrupts during shut down.
Quoted 6 lines
Signed-off-by Magnus Damm <[email protected]>---
No known dependencies apart from previous SMP cleanup series "[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework" Written against -next in renesas.git.
I believe those are queued up for upstream in the soc5 branch.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Please let me know when you are comfortable with me applying these patches to that branch. I'm fine with that answer being "now".
Now sounds wonderful. Thanks Simon.
[some time passes]
Thanks, applied to the soc5 branch.
[more time passes]
Thanks for your help.
Here's a list of the recent SMP/SCU/CPU Hotplug patches:
[PATCH 00/06] ARM: shmobile: Trivial SMP cleanups [PATCH 01/06] ARM: shmobile: Remove unused headers from hotplug.c [PATCH 02/06] ARM: shmobile: Remove partial CPU Hotplug from EMEV2 [PATCH 03/06] ARM: shmobile: Move EMEV2 CPU boot vector setup code [PATCH 04/06] ARM: shmobile: Remove sh73a0_get_core_count() [PATCH 05/06] ARM: shmobile: Remove r8a7779_get_core_count() [PATCH 06/06] ARM: shmobile: Remove emev2_get_core_count()
[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework [PATCH 01/06] ARM: shmobile: Kill off sh73a0 scu_base_addr() function [PATCH 02/06] ARM: shmobile: Kill off r8a7779 scu_base_addr() function [PATCH 03/06] ARM: shmobile: Rework EMEV2 scu_base variable [PATCH 04/06] ARM: shmobile: Move headsmp-sh73a0.S to headsmp-scu.S [PATCH 05/06] ARM: shmobile: Common shmobile_scu_base in headsmp-scu.S [PATCH 06/06] ARM: shmobile: Update EMEV2 to use scu_power_mode()
[PATCH 00/08] ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2 [PATCH 01/08] ARM: shmobile: Fix base address readout in headsmp-scu.S [PATCH 02/08] ARM: shmobile: Rework SH73A0_SCU_BASE IOMEM() usage [PATCH 03/08] ARM: shmobile: Use R8A7779_SCU_BASE with TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to use scu_power_mode() [PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unused hotplug.c
I've now gotten around to once more test the above patches on KZM9D, and both CPU0 and CPU1 boots as expected when SMP is enabled in the kernel configuration.
To test I used renesas.git with the tag renesas-next-20130321.
Thanks,
/ magnus
Quoted 75 lines · Magnus Damm
Quoted 33 lines · Simon Horman
Quoted 32 lines · Magnus Damm
Quoted 31 lines · Simon Horman
Quoted 21 lines · Magnus Damm
ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2
[PATCH 01/08] ARM: shmobile: Fix base address readout in
headsmp-scu.S[PATCH 02/08] ARM: shmobile: ReworkSH73A0_SCU_BASEIOMEM()usage [PATCH 03/08] ARM: shmobile: UseR8A7779_SCU_BASEwith TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to usescu_power_mode()[PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unusedhotplug.cFinalize the SCU rework by performing minor fixes and converting the r8a7779 SMP code to make use of common
scu_power_mode()code and the early SCU setup code inheadsmp-scu.S.Also, to save a few line remove
hotplug.cwhile at it.The only remaining itch to scratch here is to fix up CPU Hotplug of CPU0 on r8a7779, but for that to happen we first need to start accounting for spurious interrupts during shut down.
Quoted 6 lines
Signed-off-by Magnus Damm <[email protected]>---
No known dependencies apart from previous SMP cleanup series "[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework" Written against -next in renesas.git.
I believe those are queued up for upstream in the soc5 branch.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Please let me know when you are comfortable with me applying these patches to that branch. I'm fine with that answer being "now".
Now sounds wonderful. Thanks Simon.
[some time passes]
Thanks, applied to the soc5 branch.
[more time passes]
Thanks for your help.
Here's a list of the recent SMP/SCU/CPU Hotplug patches:
[PATCH 00/06] ARM: shmobile: Trivial SMP cleanups [PATCH 01/06] ARM: shmobile: Remove unused headers from
hotplug.c[PATCH 02/06] ARM: shmobile: Remove partial CPU Hotplug from EMEV2 [PATCH 03/06] ARM: shmobile: Move EMEV2 CPU boot vector setup code [PATCH 04/06] ARM: shmobile: Removesh73a0_get_core_count()[PATCH 05/06] ARM: shmobile: Remover8a7779_get_core_count()[PATCH 06/06] ARM: shmobile: Removeemev2_get_core_count()[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework [PATCH 01/06] ARM: shmobile: Kill off sh73a0
scu_base_addr()function [PATCH 02/06] ARM: shmobile: Kill off r8a7779scu_base_addr()function [PATCH 03/06] ARM: shmobile: Rework EMEV2scu_basevariable [PATCH 04/06] ARM: shmobile: Moveheadsmp-sh73a0.Stoheadsmp-scu.S[PATCH 05/06] ARM: shmobile: Commonshmobile_scu_baseinheadsmp-scu.S[PATCH 06/06] ARM: shmobile: Update EMEV2 to usescu_power_mode()[PATCH 00/08] ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2 [PATCH 01/08] ARM: shmobile: Fix base address readout in
headsmp-scu.S[PATCH 02/08] ARM: shmobile: ReworkSH73A0_SCU_BASEIOMEM()usage [PATCH 03/08] ARM: shmobile: UseR8A7779_SCU_BASEwith TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to usescu_power_mode()[PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unusedhotplug.c
Quoted 5 lines
I've now gotten around to once more test the above patches on KZM9D, and both CPU0 and CPU1 boots as expected when SMP is enabled in the kernel configuration.
To test I used renesas.git with the tag renesas-next-20130321.
Do you want me to queue-up the above patches for v3.10?
Magnus Damm
maintainerQuoted 76 lines · Simon Horman
Quoted 75 lines · Magnus Damm
Quoted 33 lines · Simon Horman
Quoted 32 lines · Magnus Damm
Quoted 31 lines · Simon Horman
Quoted 21 lines · Magnus Damm
ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2
[PATCH 01/08] ARM: shmobile: Fix base address readout in
headsmp-scu.S[PATCH 02/08] ARM: shmobile: ReworkSH73A0_SCU_BASEIOMEM()usage [PATCH 03/08] ARM: shmobile: UseR8A7779_SCU_BASEwith TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to usescu_power_mode()[PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unusedhotplug.cFinalize the SCU rework by performing minor fixes and converting the r8a7779 SMP code to make use of common
scu_power_mode()code and the early SCU setup code inheadsmp-scu.S.Also, to save a few line remove
hotplug.cwhile at it.The only remaining itch to scratch here is to fix up CPU Hotplug of CPU0 on r8a7779, but for that to happen we first need to start accounting for spurious interrupts during shut down.
Quoted 6 lines
Signed-off-by Magnus Damm <[email protected]>---
No known dependencies apart from previous SMP cleanup series "[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework" Written against -next in renesas.git.
I believe those are queued up for upstream in the soc5 branch.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Please let me know when you are comfortable with me applying these patches to that branch. I'm fine with that answer being "now".
Now sounds wonderful. Thanks Simon.
[some time passes]
Thanks, applied to the soc5 branch.
[more time passes]
Thanks for your help.
Here's a list of the recent SMP/SCU/CPU Hotplug patches:
[PATCH 00/06] ARM: shmobile: Trivial SMP cleanups [PATCH 01/06] ARM: shmobile: Remove unused headers from
hotplug.c[PATCH 02/06] ARM: shmobile: Remove partial CPU Hotplug from EMEV2 [PATCH 03/06] ARM: shmobile: Move EMEV2 CPU boot vector setup code [PATCH 04/06] ARM: shmobile: Removesh73a0_get_core_count()[PATCH 05/06] ARM: shmobile: Remover8a7779_get_core_count()[PATCH 06/06] ARM: shmobile: Removeemev2_get_core_count()[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework [PATCH 01/06] ARM: shmobile: Kill off sh73a0
scu_base_addr()function [PATCH 02/06] ARM: shmobile: Kill off r8a7779scu_base_addr()function [PATCH 03/06] ARM: shmobile: Rework EMEV2scu_basevariable [PATCH 04/06] ARM: shmobile: Moveheadsmp-sh73a0.Stoheadsmp-scu.S[PATCH 05/06] ARM: shmobile: Commonshmobile_scu_baseinheadsmp-scu.S[PATCH 06/06] ARM: shmobile: Update EMEV2 to usescu_power_mode()[PATCH 00/08] ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2 [PATCH 01/08] ARM: shmobile: Fix base address readout in
headsmp-scu.S[PATCH 02/08] ARM: shmobile: ReworkSH73A0_SCU_BASEIOMEM()usage [PATCH 03/08] ARM: shmobile: UseR8A7779_SCU_BASEwith TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to usescu_power_mode()[PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unusedhotplug.c
Quoted 7 lines
Quoted 5 lines
I've now gotten around to once more test the above patches on KZM9D, and both CPU0 and CPU1 boots as expected when SMP is enabled in the kernel configuration.
To test I used renesas.git with the tag renesas-next-20130321.
Do you want me to queue-up the above patches for v3.10?
To be honest, I actually expected them to be queued-up already. They are in "next", right?
If they are not queued up already then please do so.
Thanks,
/ magnus
Quoted 81 lines · Magnus Damm
Quoted 80 lines · Simon Horman
Quoted 79 lines · Magnus Damm
Quoted 33 lines · Simon Horman
Quoted 32 lines · Magnus Damm
Quoted 31 lines · Simon Horman
Quoted 21 lines · Magnus Damm
ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2
[PATCH 01/08] ARM: shmobile: Fix base address readout in
headsmp-scu.S[PATCH 02/08] ARM: shmobile: ReworkSH73A0_SCU_BASEIOMEM()usage [PATCH 03/08] ARM: shmobile: UseR8A7779_SCU_BASEwith TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to usescu_power_mode()[PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unusedhotplug.cFinalize the SCU rework by performing minor fixes and converting the r8a7779 SMP code to make use of common
scu_power_mode()code and the early SCU setup code inheadsmp-scu.S.Also, to save a few line remove
hotplug.cwhile at it.The only remaining itch to scratch here is to fix up CPU Hotplug of CPU0 on r8a7779, but for that to happen we first need to start accounting for spurious interrupts during shut down.
Quoted 6 lines
Signed-off-by Magnus Damm <[email protected]>---
No known dependencies apart from previous SMP cleanup series "[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework" Written against -next in renesas.git.
I believe those are queued up for upstream in the soc5 branch.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Please let me know when you are comfortable with me applying these patches to that branch. I'm fine with that answer being "now".
Now sounds wonderful. Thanks Simon.
[some time passes]
Thanks, applied to the soc5 branch.
[more time passes]
Thanks for your help.
Here's a list of the recent SMP/SCU/CPU Hotplug patches:
[PATCH 00/06] ARM: shmobile: Trivial SMP cleanups [PATCH 01/06] ARM: shmobile: Remove unused headers from
hotplug.c[PATCH 02/06] ARM: shmobile: Remove partial CPU Hotplug from EMEV2 [PATCH 03/06] ARM: shmobile: Move EMEV2 CPU boot vector setup code [PATCH 04/06] ARM: shmobile: Removesh73a0_get_core_count()[PATCH 05/06] ARM: shmobile: Remover8a7779_get_core_count()[PATCH 06/06] ARM: shmobile: Removeemev2_get_core_count()[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework [PATCH 01/06] ARM: shmobile: Kill off sh73a0
scu_base_addr()function [PATCH 02/06] ARM: shmobile: Kill off r8a7779scu_base_addr()function [PATCH 03/06] ARM: shmobile: Rework EMEV2scu_basevariable [PATCH 04/06] ARM: shmobile: Moveheadsmp-sh73a0.Stoheadsmp-scu.S[PATCH 05/06] ARM: shmobile: Commonshmobile_scu_baseinheadsmp-scu.S[PATCH 06/06] ARM: shmobile: Update EMEV2 to usescu_power_mode()[PATCH 00/08] ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2 [PATCH 01/08] ARM: shmobile: Fix base address readout in
headsmp-scu.S[PATCH 02/08] ARM: shmobile: ReworkSH73A0_SCU_BASEIOMEM()usage [PATCH 03/08] ARM: shmobile: UseR8A7779_SCU_BASEwith TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to usescu_power_mode()[PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unusedhotplug.cI've now gotten around to once more test the above patches on KZM9D, and both CPU0 and CPU1 boots as expected when SMP is enabled in the kernel configuration.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
To test I used renesas.git with the tag renesas-next-20130321.
Do you want me to queue-up the above patches for v3.10?
To be honest, I actually expected them to be queued-up already. They are in "next", right?
If they are not queued up already then please do so.
I checked in patchwork and they have all been accepted.
What was the purpose of you posting the list of patches? I am confused.
Magnus Damm
maintainerQuoted 89 lines · Simon Horman
Quoted 88 lines · Magnus Damm
Quoted 76 lines · Simon Horman
Quoted 75 lines · Magnus Damm
Quoted 33 lines · Simon Horman
Quoted 32 lines · Magnus Damm
Quoted 31 lines · Simon Horman
Quoted 21 lines · Magnus Damm
ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2
[PATCH 01/08] ARM: shmobile: Fix base address readout in
headsmp-scu.S[PATCH 02/08] ARM: shmobile: ReworkSH73A0_SCU_BASEIOMEM()usage [PATCH 03/08] ARM: shmobile: UseR8A7779_SCU_BASEwith TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to usescu_power_mode()[PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unusedhotplug.cFinalize the SCU rework by performing minor fixes and converting the r8a7779 SMP code to make use of common
scu_power_mode()code and the early SCU setup code inheadsmp-scu.S.Also, to save a few line remove
hotplug.cwhile at it.The only remaining itch to scratch here is to fix up CPU Hotplug of CPU0 on r8a7779, but for that to happen we first need to start accounting for spurious interrupts during shut down.
Quoted 6 lines
Signed-off-by Magnus Damm <[email protected]>---
No known dependencies apart from previous SMP cleanup series "[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework" Written against -next in renesas.git.
I believe those are queued up for upstream in the soc5 branch.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Please let me know when you are comfortable with me applying these patches to that branch. I'm fine with that answer being "now".
Now sounds wonderful. Thanks Simon.
[some time passes]
Thanks, applied to the soc5 branch.
[more time passes]
Thanks for your help.
Here's a list of the recent SMP/SCU/CPU Hotplug patches:
[PATCH 00/06] ARM: shmobile: Trivial SMP cleanups [PATCH 01/06] ARM: shmobile: Remove unused headers from
hotplug.c[PATCH 02/06] ARM: shmobile: Remove partial CPU Hotplug from EMEV2 [PATCH 03/06] ARM: shmobile: Move EMEV2 CPU boot vector setup code [PATCH 04/06] ARM: shmobile: Removesh73a0_get_core_count()[PATCH 05/06] ARM: shmobile: Remover8a7779_get_core_count()[PATCH 06/06] ARM: shmobile: Removeemev2_get_core_count()[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework [PATCH 01/06] ARM: shmobile: Kill off sh73a0
scu_base_addr()function [PATCH 02/06] ARM: shmobile: Kill off r8a7779scu_base_addr()function [PATCH 03/06] ARM: shmobile: Rework EMEV2scu_basevariable [PATCH 04/06] ARM: shmobile: Moveheadsmp-sh73a0.Stoheadsmp-scu.S[PATCH 05/06] ARM: shmobile: Commonshmobile_scu_baseinheadsmp-scu.S[PATCH 06/06] ARM: shmobile: Update EMEV2 to usescu_power_mode()[PATCH 00/08] ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2 [PATCH 01/08] ARM: shmobile: Fix base address readout in
headsmp-scu.S[PATCH 02/08] ARM: shmobile: ReworkSH73A0_SCU_BASEIOMEM()usage [PATCH 03/08] ARM: shmobile: UseR8A7779_SCU_BASEwith TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to usescu_power_mode()[PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unusedhotplug.cQuoted 7 lines
Quoted 5 lines
I've now gotten around to once more test the above patches on KZM9D, and both CPU0 and CPU1 boots as expected when SMP is enabled in the kernel configuration.
To test I used renesas.git with the tag renesas-next-20130321.
Do you want me to queue-up the above patches for v3.10?
To be honest, I actually expected them to be queued-up already. They are in "next", right?
Quoted 6 lines
Quoted 1 line
If they are not queued up already then please do so.
I checked in patchwork and they have all been accepted.
What was the purpose of you posting the list of patches? I am confused.
Just wanted to make a summary of those SMP related patches. Sorry about the confusion!
/ magnus
Quoted 92 lines · Magnus Damm
Quoted 91 lines · Simon Horman
Quoted 89 lines · Magnus Damm
Quoted 76 lines · Simon Horman
Quoted 75 lines · Magnus Damm
Quoted 33 lines · Simon Horman
Quoted 32 lines · Magnus Damm
Quoted 31 lines · Simon Horman
Quoted 21 lines · Magnus Damm
ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2
[PATCH 01/08] ARM: shmobile: Fix base address readout in
headsmp-scu.S[PATCH 02/08] ARM: shmobile: ReworkSH73A0_SCU_BASEIOMEM()usage [PATCH 03/08] ARM: shmobile: UseR8A7779_SCU_BASEwith TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to usescu_power_mode()[PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unusedhotplug.cFinalize the SCU rework by performing minor fixes and converting the r8a7779 SMP code to make use of common
scu_power_mode()code and the early SCU setup code inheadsmp-scu.S.Also, to save a few line remove
hotplug.cwhile at it.The only remaining itch to scratch here is to fix up CPU Hotplug of CPU0 on r8a7779, but for that to happen we first need to start accounting for spurious interrupts during shut down.
Quoted 6 lines
Signed-off-by Magnus Damm <[email protected]>---
No known dependencies apart from previous SMP cleanup series "[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework" Written against -next in renesas.git.
I believe those are queued up for upstream in the soc5 branch.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Please let me know when you are comfortable with me applying these patches to that branch. I'm fine with that answer being "now".
Now sounds wonderful. Thanks Simon.
[some time passes]
Thanks, applied to the soc5 branch.
[more time passes]
Thanks for your help.
Here's a list of the recent SMP/SCU/CPU Hotplug patches:
[PATCH 00/06] ARM: shmobile: Trivial SMP cleanups [PATCH 01/06] ARM: shmobile: Remove unused headers from
hotplug.c[PATCH 02/06] ARM: shmobile: Remove partial CPU Hotplug from EMEV2 [PATCH 03/06] ARM: shmobile: Move EMEV2 CPU boot vector setup code [PATCH 04/06] ARM: shmobile: Removesh73a0_get_core_count()[PATCH 05/06] ARM: shmobile: Remover8a7779_get_core_count()[PATCH 06/06] ARM: shmobile: Removeemev2_get_core_count()[PATCH 00/06] ARM: shmobile: SMP Cortex-A9 SCU rework [PATCH 01/06] ARM: shmobile: Kill off sh73a0
scu_base_addr()function [PATCH 02/06] ARM: shmobile: Kill off r8a7779scu_base_addr()function [PATCH 03/06] ARM: shmobile: Rework EMEV2scu_basevariable [PATCH 04/06] ARM: shmobile: Moveheadsmp-sh73a0.Stoheadsmp-scu.S[PATCH 05/06] ARM: shmobile: Commonshmobile_scu_baseinheadsmp-scu.S[PATCH 06/06] ARM: shmobile: Update EMEV2 to usescu_power_mode()[PATCH 00/08] ARM: shmobile: CPU Hotplug and SMP CA9 SCU rework part 2 [PATCH 01/08] ARM: shmobile: Fix base address readout in
headsmp-scu.S[PATCH 02/08] ARM: shmobile: ReworkSH73A0_SCU_BASEIOMEM()usage [PATCH 03/08] ARM: shmobile: UseR8A7779_SCU_BASEwith TWD [PATCH 04/08] ARM: shmobile: Update r8a7779 to check SCU for hotplug [PATCH 05/08] ARM: shmobile: Update r8a7779 to usescu_power_mode()[PATCH 06/08] ARM: shmobile: Use sh73a0-specific cpu disable code [PATCH 07/08] ARM: shmobile: Rearrange r8a7779 cpu hotplug code [PATCH 08/08] ARM: shmobile: Remove unusedhotplug.cQuoted 7 lines
Quoted 5 lines
I've now gotten around to once more test the above patches on KZM9D, and both CPU0 and CPU1 boots as expected when SMP is enabled in the kernel configuration.
To test I used renesas.git with the tag renesas-next-20130321.
Do you want me to queue-up the above patches for v3.10?
To be honest, I actually expected them to be queued-up already. They are in "next", right?
If they are not queued up already then please do so.
Quoted 7 lines
Quoted 4 lines
I checked in patchwork and they have all been accepted.
What was the purpose of you posting the list of patches? I am confused.
Just wanted to make a summary of those SMP related patches. Sorry about the confusion!
No problem. I am no longer confused :)