From: Will Deacon <hidden> Date: 2011-08-15 17:30:44
Hello,
This is version 2 of the RFC originally posted here:
http://lists.infradead.org/pipermail/linux-arm-kernel/2011-August/060594.html
Changes since v1 include:
* Fixed the GIC code to compile when !CONFIG_SMP
* Based on -rc2
* Added acks / tested-bys from various platform maintainers (thanks!)
Any feedback on the approach taken and comments from the shmobile folks
would be much appreciated.
Thanks,
Will
Will Deacon (8):
ARM: cpuid: add support for reading MPIDR
ARM: smp: populate logical CPU mapping during boot
ARM: gic: convert logical CPU numbers into physical numbers
ARM: exynos4: convert logical CPU numbers to physical numbers
ARM: msm: convert logical CPU numbers to physical numbers
ARM: shmobile: convert logical CPU numbers to physical numbers
ARM: ux500: convert logical CPU numbers to physical numbers
ARM: versatile: convert logical CPU numbers to physical numbers
arch/arm/common/gic.c | 17 ++++++++++++++---
arch/arm/include/asm/cputype.h | 6 ++++++
arch/arm/include/asm/smp.h | 6 ++++++
arch/arm/kernel/smp.c | 15 +++++++++++++++
arch/arm/mach-exynos4/hotplug.c | 2 +-
arch/arm/mach-exynos4/platsmp.c | 2 +-
arch/arm/mach-msm/hotplug.c | 2 +-
arch/arm/mach-msm/platsmp.c | 2 +-
arch/arm/mach-realview/hotplug.c | 2 +-
arch/arm/mach-shmobile/smp-sh73a0.c | 6 +++++-
arch/arm/mach-ux500/hotplug.c | 2 +-
arch/arm/mach-ux500/platsmp.c | 2 +-
arch/arm/mach-vexpress/hotplug.c | 2 +-
arch/arm/plat-versatile/platsmp.c | 2 +-
14 files changed, 55 insertions(+), 13 deletions(-)
From: Will Deacon <hidden> Date: 2011-08-15 17:30:45
The MPIDR register forms part of the CPUID interface and allows software
to determine the physical ID of the CPU on which it is currently
executing.
This patch adds support for reading the MPIDR to cputype.h
Signed-off-by: Will Deacon <redacted>
---
arch/arm/include/asm/cputype.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
From: Will Deacon <hidden> Date: 2011-08-15 17:30:46
To allow booting Linux on a CPU with physical ID != 0, we need to
provide a mapping from the logical CPU number to the physical CPU
number.
This patch adds such a mapping and populates it during boot.
Signed-off-by: Will Deacon <redacted>
---
arch/arm/include/asm/smp.h | 6 ++++++
arch/arm/kernel/smp.c | 15 +++++++++++++++
2 files changed, 21 insertions(+), 0 deletions(-)
@@ -259,6 +260,20 @@ void __ref cpu_die(void)}#endif /* CONFIG_HOTPLUG_CPU */+int__cpu_logical_map[NR_CPUS];++void__initsmp_setup_processor_id(void)+{+inti;+u32cpu=is_smp()?read_cpuid_mpidr()&0xff:0;++cpu_logical_map(0)=cpu;+for(i=1;i<NR_CPUS;++i)+cpu_logical_map(i)=i==cpu?0:i;++printk(KERN_INFO"Booting Linux on physical CPU %d\n",cpu);+}+/**Calledbybothbootandsecondariestomoveglobaldatainto*per-processorstorage.
From: Will Deacon <hidden> Date: 2011-08-15 17:30:47
The GIC driver must convert logical CPU numbers passed in from Linux
into physical CPU numbers that are understood by the hardware.
This patch uses the new cpu_logical_map macro for performing the
conversion inside the GIC driver.
Signed-off-by: Will Deacon <redacted>
---
arch/arm/common/gic.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
@@ -382,7 +388,12 @@ void __cpuinit gic_enable_ppi(unsigned int irq)#ifdef CONFIG_SMPvoidgic_raise_softirq(conststructcpumask*mask,unsignedintirq){-unsignedlongmap=*cpus_addr(*mask);+intcpu;+unsignedlongmap=0;++/* Convert our logical CPU mask into a physical one. */+for_each_cpu(cpu,mask)+map|=1<<cpu_logical_map(cpu);/**EnsurethatstorestoNormalmemoryarevisibletothe
From: Will Deacon <hidden> Date: 2011-08-15 17:30:48
This patch uses the new cpu_logical_map() macro for converting logical
CPU numbers into physical numbers when dealing with the pen_release
variable in the SMP boot and CPU hotplug paths.
Cc: Kukjin Kim <redacted>
Tested-and-acked-by: Kyungmin Park [off-list ref]
Signed-off-by: Will Deacon <redacted>
---
arch/arm/mach-exynos4/hotplug.c | 2 +-
arch/arm/mach-exynos4/platsmp.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
From: Will Deacon <hidden> Date: 2011-08-15 17:30:49
This patch uses the new cpu_logical_map() macro for converting logical
CPU numbers into physical numbers when dealing with the pen_release
variable in the SMP boot and CPU hotplug paths.
Tested-and-acked-by: David Brown [off-list ref]
Signed-off-by: Will Deacon <redacted>
---
arch/arm/mach-msm/hotplug.c | 2 +-
arch/arm/mach-msm/platsmp.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
From: Will Deacon <hidden> Date: 2011-08-15 17:30:50
This patch uses the new cpu_logical_map() macro for converting logical
CPU numbers into physical numbers when dealing with the SCU in the SMP
boot path for sh73a0.
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Paul Mundt <redacted>
Signed-off-by: Will Deacon <redacted>
---
arch/arm/mach-shmobile/smp-sh73a0.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
@@ -87,6 +89,8 @@ int __cpuinit sh73a0_boot_secondary(unsigned int cpu)void__initsh73a0_smp_prepare_cpus(void){+intcpu=cpu_logical_map(0);+scu_enable(scu_base_addr());/* Map the reset vector (in headsmp.S) */
From: Will Deacon <hidden> Date: 2011-08-15 17:30:51
This patch uses the new cpu_logical_map() macro for converting logical
CPU numbers into physical numbers when dealing with the pen_release
variable in the SMP boot and CPU hotplug paths.
Acked-by: Linus Walleij <redacted>
Signed-off-by: Will Deacon <redacted>
---
arch/arm/mach-ux500/hotplug.c | 2 +-
arch/arm/mach-ux500/platsmp.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
From: Will Deacon <hidden> Date: 2011-08-15 17:30:52
This patch uses the new cpu_logical_map() macro for converting logical
CPU numbers into physical numbers when dealing with the pen_release
variable in the SMP boot and CPU hotplug paths.
Signed-off-by: Will Deacon <redacted>
---
arch/arm/mach-realview/hotplug.c | 2 +-
arch/arm/mach-vexpress/hotplug.c | 2 +-
arch/arm/plat-versatile/platsmp.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
The MPIDR register forms part of the CPUID interface and allows software
to determine the physical ID of the CPU on which it is currently
executing.
This patch adds support for reading the MPIDR to cputype.h
Signed-off-by: Will Deacon <redacted>
---
?arch/arm/include/asm/cputype.h | ? ?6 ++++++
?1 files changed, 6 insertions(+), 0 deletions(-)
@@ -70,6 +71,11 @@ static inline unsigned int __attribute_const__ read_cpuid_tcmstatus(void)
? ? ? ?return read_cpuid(CPUID_TCM);
?}
+static inline unsigned int __attribute_const__ read_cpuid_mpidr(void)
+{
+ ? ? ? return read_cpuid(CPUID_MPIDR);
+}
+
?/*
?* Intel's XScale3 core supports some v6 features (supersections, L2)
?* but advertises itself as v5 as it does not support the v6 ISA. ?For
--
1.7.0.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Will Deacon <hidden> Date: 2011-08-19 12:52:24
Magnus, Paul,
On Mon, Aug 15, 2011 at 06:30:50PM +0100, Will Deacon wrote:
This patch uses the new cpu_logical_map() macro for converting logical
CPU numbers into physical numbers when dealing with the SCU in the SMP
boot path for sh73a0.
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Paul Mundt <redacted>
Signed-off-by: Will Deacon <redacted>
---
arch/arm/mach-shmobile/smp-sh73a0.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
Any feedback on this? My change to modify_scu_cpu_psr is based largely on
pattern matching, so please shout if it's wrong.
Will
@@ -87,6 +89,8 @@ int __cpuinit sh73a0_boot_secondary(unsigned int cpu)void__initsh73a0_smp_prepare_cpus(void){+intcpu=cpu_logical_map(0);+scu_enable(scu_base_addr());/* Map the reset vector (in headsmp.S) */