From c5795aec8487680d748a635d6ab03766f90166ec Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Mon, 28 Jan 2013 09:41:40 +0900 Subject: [PATCH 1/4] ARM: mach-shmobile: sh73a0: Add reg and device_type properties to cpus Cc: Mark Rutland Signed-off-by: Simon Horman --- arch/arm/boot/dts/sh73a0.dtsi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/boot/dts/sh73a0.dtsi b/arch/arm/boot/dts/sh73a0.dtsi index 721f48668f98..8a59465d0231 100644 --- a/arch/arm/boot/dts/sh73a0.dtsi +++ b/arch/arm/boot/dts/sh73a0.dtsi @@ -14,11 +14,18 @@ compatible = "renesas,sh73a0"; cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu@0 { + device_type = "cpu"; compatible = "arm,cortex-a9"; + reg = <0>; }; cpu@1 { + device_type = "cpu"; compatible = "arm,cortex-a9"; + reg = <1>; }; }; From fe681d2941a7dc4870753d88545a35ec5080d710 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Mon, 28 Jan 2013 09:41:40 +0900 Subject: [PATCH 2/4] ARM: mach-shmobile: emev2: Add reg and device_type properties to cpus Cc: Mark Rutland Signed-off-by: Simon Horman --- arch/arm/boot/dts/emev2.dtsi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/boot/dts/emev2.dtsi b/arch/arm/boot/dts/emev2.dtsi index eb504a6c0f4a..c8a8c08b48dd 100644 --- a/arch/arm/boot/dts/emev2.dtsi +++ b/arch/arm/boot/dts/emev2.dtsi @@ -15,11 +15,18 @@ interrupt-parent = <&gic>; cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu@0 { + device_type = "cpu"; compatible = "arm,cortex-a9"; + reg = <0>; }; cpu@1 { + device_type = "cpu"; compatible = "arm,cortex-a9"; + reg = <1>; }; }; From 0f234d91b8f50119c4c921db9d9dc0dac24db383 Mon Sep 17 00:00:00 2001 From: Ulrich Hecht Date: Thu, 10 Jan 2013 11:16:43 +0100 Subject: [PATCH 3/4] ARM: mach-shmobile: add shmobile_cpu_disable_any() Method to disable any core to be used on platforms where CPU0 does not need special treatment. Signed-off-by: Ulrich Hecht Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/hotplug.c | 6 ++++++ arch/arm/mach-shmobile/include/mach/common.h | 1 + 2 files changed, 7 insertions(+) diff --git a/arch/arm/mach-shmobile/hotplug.c b/arch/arm/mach-shmobile/hotplug.c index b09a0bdbf813..a1524e3367b0 100644 --- a/arch/arm/mach-shmobile/hotplug.c +++ b/arch/arm/mach-shmobile/hotplug.c @@ -56,6 +56,12 @@ int shmobile_cpu_disable(unsigned int cpu) return cpu == 0 ? -EPERM : 0; } +int shmobile_cpu_disable_any(unsigned int cpu) +{ + cpumask_clear_cpu(cpu, &dead_cpus); + return 0; +} + int shmobile_cpu_is_dead(unsigned int cpu) { return cpumask_test_cpu(cpu, &dead_cpus); diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h index 64c0622ae7d6..e48606d8a2be 100644 --- a/arch/arm/mach-shmobile/include/mach/common.h +++ b/arch/arm/mach-shmobile/include/mach/common.h @@ -84,6 +84,7 @@ static inline int shmobile_cpuidle_init(void) { return 0; } 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); From dc784e73b45dc055f9dcb174ea5753ea020516fc Mon Sep 17 00:00:00 2001 From: Ulrich Hecht Date: Thu, 10 Jan 2013 11:16:44 +0100 Subject: [PATCH 4/4] ARM: mach-shmobile: sh73a0: allow unplugging of CPU0 sh73a0 deals fine with disabling any core, so we should permit it. Signed-off-by: Ulrich Hecht Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/smp-sh73a0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c index 9812ea3255c9..acb46a94ccdf 100644 --- a/arch/arm/mach-shmobile/smp-sh73a0.c +++ b/arch/arm/mach-shmobile/smp-sh73a0.c @@ -143,6 +143,6 @@ struct smp_operations sh73a0_smp_ops __initdata = { #ifdef CONFIG_HOTPLUG_CPU .cpu_kill = sh73a0_cpu_kill, .cpu_die = sh73a0_cpu_die, - .cpu_disable = shmobile_cpu_disable, + .cpu_disable = shmobile_cpu_disable_any, #endif };