From 09af6a59fb2cc4c88eae3ec884bfe6cb282ffa00 Mon Sep 17 00:00:00 2001 From: Heiko Stuebner Date: Wed, 23 Jul 2014 11:36:49 +0200 Subject: [PATCH 1/2] ARM: rockchip: select ARMv7 compiler flags for platsmp.o When compiling for multiplatform for both ARMv6 and ARMv7, the default compiler flags are for ARMv6, and the following cpu-hotplug change will fail with: /tmp/ccSFxfmI.s:68: Error: selected processor does not support ARM mode `isb ' /tmp/ccSFxfmI.s:74: Error: selected processor does not support ARM mode `isb ' /tmp/ccSFxfmI.s:75: Error: selected processor does not support ARM mode `dsb ' Fix this in a similar manner as in commit 9f0affcf3e21 "ARM: mvebu: Fix pmsu compilation when ARMv6 is selected", by specifying ARMv7 flags for platsmp.o. Signed-off-by: Heiko Stuebner --- arch/arm/mach-rockchip/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index 4377a1436a98..b29d8ead4cf2 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -1,2 +1,4 @@ +CFLAGS_platsmp.o := -march=armv7-a + obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip.o obj-$(CONFIG_SMP) += headsmp.o platsmp.o From f54b91fdfa7a1b5603d6d00f9972765662a4e6ef Mon Sep 17 00:00:00 2001 From: Romain Perier Date: Sat, 19 Jul 2014 13:03:26 +0000 Subject: [PATCH 2/2] ARM: rockchip: Add cpu hotplug support for RK3XXX SoCs Adds ability to shutdown all CPUs except the first one (since it might be special for a lot of platforms). It is now possible to use kexec which requires such a feature. Signed-off-by: Romain Perier Signed-off-by: Heiko Stuebner --- arch/arm/mach-rockchip/platsmp.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c index 910835d4ccf4..189684f55927 100644 --- a/arch/arm/mach-rockchip/platsmp.c +++ b/arch/arm/mach-rockchip/platsmp.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -178,8 +179,27 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus) pmu_set_power_domain(0 + i, false); } +#ifdef CONFIG_HOTPLUG_CPU +static int rockchip_cpu_kill(unsigned int cpu) +{ + pmu_set_power_domain(0 + cpu, false); + return 1; +} + +static void rockchip_cpu_die(unsigned int cpu) +{ + v7_exit_coherency_flush(louis); + while(1) + cpu_do_idle(); +} +#endif + static struct smp_operations rockchip_smp_ops __initdata = { .smp_prepare_cpus = rockchip_smp_prepare_cpus, .smp_boot_secondary = rockchip_boot_secondary, +#ifdef CONFIG_HOTPLUG_CPU + .cpu_kill = rockchip_cpu_kill, + .cpu_die = rockchip_cpu_die, +#endif }; CPU_METHOD_OF_DECLARE(rk3066_smp, "rockchip,rk3066-smp", &rockchip_smp_ops);