diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/arm/mach-ux500/hotplug.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'arch/arm/mach-ux500/hotplug.c')
-rw-r--r-- | arch/arm/mach-ux500/hotplug.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/hotplug.c b/arch/arm/mach-ux500/hotplug.c new file mode 100644 index 000000000000..dd8037ebccf8 --- /dev/null +++ b/arch/arm/mach-ux500/hotplug.c | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Copyright (C) STMicroelectronics 2009 | ||
3 | * Copyright (C) ST-Ericsson SA 2010 | ||
4 | * | ||
5 | * License Terms: GNU General Public License v2 | ||
6 | * Based on ARM realview platform | ||
7 | * | ||
8 | * Author: Sundar Iyer <sundar.iyer@stericsson.com> | ||
9 | * | ||
10 | */ | ||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/errno.h> | ||
13 | #include <linux/smp.h> | ||
14 | |||
15 | #include <asm/cacheflush.h> | ||
16 | |||
17 | extern volatile int pen_release; | ||
18 | |||
19 | static inline void platform_do_lowpower(unsigned int cpu) | ||
20 | { | ||
21 | flush_cache_all(); | ||
22 | |||
23 | /* we put the platform to just WFI */ | ||
24 | for (;;) { | ||
25 | __asm__ __volatile__("dsb\n\t" "wfi\n\t" | ||
26 | : : : "memory"); | ||
27 | if (pen_release == cpu) { | ||
28 | /* | ||
29 | * OK, proper wakeup, we're done | ||
30 | */ | ||
31 | break; | ||
32 | } | ||
33 | } | ||
34 | } | ||
35 | |||
36 | int platform_cpu_kill(unsigned int cpu) | ||
37 | { | ||
38 | return 1; | ||
39 | } | ||
40 | |||
41 | /* | ||
42 | * platform-specific code to shutdown a CPU | ||
43 | * | ||
44 | * Called with IRQs disabled | ||
45 | */ | ||
46 | void platform_cpu_die(unsigned int cpu) | ||
47 | { | ||
48 | /* directly enter low power state, skipping secure registers */ | ||
49 | platform_do_lowpower(cpu); | ||
50 | } | ||
51 | |||
52 | int platform_cpu_disable(unsigned int cpu) | ||
53 | { | ||
54 | /* | ||
55 | * we don't allow CPU 0 to be shutdown (it is still too special | ||
56 | * e.g. clock tick interrupts) | ||
57 | */ | ||
58 | return cpu == 0 ? -EPERM : 0; | ||
59 | } | ||