aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-01-09 23:16:37 -0500
committerPaul Mundt <lethal@linux-sh.org>2012-01-09 23:16:37 -0500
commitea75b9c127e67683a11f7c9c8e052172f28d9266 (patch)
tree707d616bc44bb7ad251cc92985a586a8e34c3426 /arch/arm
parent916b1f8c81ea563611288d1a9b082df3f723e4fe (diff)
parent1229835ccb6d7ea2b36230121205be95c88eca88 (diff)
Merge branch 'rmobile/core' into rmobile/marzen
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-shmobile/headsmp.S2
-rw-r--r--arch/arm/mach-shmobile/hotplug.c32
-rw-r--r--arch/arm/mach-shmobile/include/mach/common.h1
-rw-r--r--arch/arm/mach-shmobile/platsmp.c5
4 files changed, 38 insertions, 2 deletions
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index 26079d933d91..6ac015c89206 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -14,7 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <asm/memory.h> 15#include <asm/memory.h>
16 16
17 __INIT 17 __CPUINIT
18 18
19/* 19/*
20 * Reset vector for secondary CPUs. 20 * Reset vector for secondary CPUs.
diff --git a/arch/arm/mach-shmobile/hotplug.c b/arch/arm/mach-shmobile/hotplug.c
index 238a0d97d2d5..828d22f3af57 100644
--- a/arch/arm/mach-shmobile/hotplug.c
+++ b/arch/arm/mach-shmobile/hotplug.c
@@ -12,14 +12,43 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/smp.h> 14#include <linux/smp.h>
15#include <linux/cpumask.h>
16#include <linux/delay.h>
17#include <mach/common.h>
18#include <asm/cacheflush.h>
19
20static cpumask_t dead_cpus;
15 21
16int platform_cpu_kill(unsigned int cpu) 22int platform_cpu_kill(unsigned int cpu)
17{ 23{
18 return 1; 24 int k;
25
26 /* this function is running on another CPU than the offline target,
27 * here we need wait for shutdown code in platform_cpu_die() to
28 * finish before asking SoC-specific code to power off the CPU core.
29 */
30 for (k = 0; k < 1000; k++) {
31 if (cpumask_test_cpu(cpu, &dead_cpus))
32 return shmobile_platform_cpu_kill(cpu);
33
34 mdelay(1);
35 }
36
37 return 0;
19} 38}
20 39
21void platform_cpu_die(unsigned int cpu) 40void platform_cpu_die(unsigned int cpu)
22{ 41{
42 /* hardware shutdown code running on the CPU that is being offlined */
43 flush_cache_all();
44 dsb();
45
46 /* notify platform_cpu_kill() that hardware shutdown is finished */
47 cpumask_set_cpu(cpu, &dead_cpus);
48
49 /* wait for SoC code in platform_cpu_kill() to shut off CPU core
50 * power. CPU bring up starts from the reset vector.
51 */
23 while (1) { 52 while (1) {
24 /* 53 /*
25 * here's the WFI 54 * here's the WFI
@@ -33,6 +62,7 @@ void platform_cpu_die(unsigned int cpu)
33 62
34int platform_cpu_disable(unsigned int cpu) 63int platform_cpu_disable(unsigned int cpu)
35{ 64{
65 cpumask_clear_cpu(cpu, &dead_cpus);
36 /* 66 /*
37 * we don't allow CPU 0 to be shutdown (it is still too special 67 * we don't allow CPU 0 to be shutdown (it is still too special
38 * e.g. clock tick interrupts) 68 * e.g. clock tick interrupts)
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index 65e954b08774..304ac3115338 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -4,6 +4,7 @@
4extern struct sys_timer shmobile_timer; 4extern struct sys_timer shmobile_timer;
5extern void shmobile_setup_console(void); 5extern void shmobile_setup_console(void);
6extern void shmobile_secondary_vector(void); 6extern void shmobile_secondary_vector(void);
7extern int shmobile_platform_cpu_kill(unsigned int cpu);
7struct clk; 8struct clk;
8extern int clk_init(void); 9extern int clk_init(void);
9extern void shmobile_handle_irq_intc(struct pt_regs *); 10extern void shmobile_handle_irq_intc(struct pt_regs *);
diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c
index c49a833bf9bb..3f3325d4206d 100644
--- a/arch/arm/mach-shmobile/platsmp.c
+++ b/arch/arm/mach-shmobile/platsmp.c
@@ -37,6 +37,11 @@ static void __init shmobile_smp_prepare_cpus(void)
37 sh73a0_smp_prepare_cpus(); 37 sh73a0_smp_prepare_cpus();
38} 38}
39 39
40int shmobile_platform_cpu_kill(unsigned int cpu)
41{
42 return 1;
43}
44
40void __cpuinit platform_secondary_init(unsigned int cpu) 45void __cpuinit platform_secondary_init(unsigned int cpu)
41{ 46{
42 trace_hardirqs_off(); 47 trace_hardirqs_off();