aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-01 22:11:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-01 22:11:38 -0400
commit9cd11c0c47b8690b47e7573311ce5c483cb344ed (patch)
tree59f51c2bb3f73b21005105095d7321d35616ca9d /arch/arm/kernel
parentb9541d94bcd2f23a069dbe84830fef1bbcd643f0 (diff)
parent1ec9c26ad0890003f2b8a4ab97164f66d5de3f6d (diff)
Merge tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM soc multiplatform enablement from Olof Johansson: "This is a pretty significant branch. It's the introduction of the first multiplatform support on ARM, and with this (and the later branch) merged, it is now possible to build one kernel that contains support for highbank, vexpress, mvebu, socfpga, and picoxcell. More platforms will be convered over in the next few releases. Two critical last things had to be done for this to be practical and possible: * Today each platform has its own include directory under mach-<mach>/include/mach/*, and traditionally that is where a lot of driver/platform shared definitions have gone, such as platform data structures. They now need to move out to a common location instead, and this branch moves a large number of those out to include/linux/platform_data. * Each platform used to list the device trees to compile for its boards in mach-<mach>/Makefile.boot. Both of the above changes will mean that there are some merge conflicts to come (and some to resolve here). It's a one-time move and once it settles in, we should be good for quite a while. Sorry for the overhead." Fix conflicts as per Olof. * tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (51 commits) ARM: add v7 multi-platform defconfig ARM: msm: Move core.h contents into common.h ARM: highbank: call highbank_pm_init from .init_machine ARM: dtb: move all dtb targets to common Makefile ARM: spear: move platform_data definitions ARM: samsung: move platform_data definitions ARM: orion: move platform_data definitions ARM: vexpress: convert to multi-platform ARM: initial multiplatform support ARM: mvebu: move armada-370-xp.h in mach dir ARM: vexpress: remove dependency on mach/* headers ARM: picoxcell: remove dependency on mach/* headers ARM: move all dtb targets out of Makefile.boot ARM: picoxcell: move debug macros to include/debug ARM: socfpga: move debug macros to include/debug ARM: mvebu: move debug macros to include/debug ARM: vexpress: move debug macros to include/debug ARM: highbank: move debug macros to include/debug ARM: move debug macros to common location ARM: make mach/gpio.h headers optional ...
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/debug.S87
-rw-r--r--arch/arm/kernel/head.S4
-rw-r--r--arch/arm/kernel/setup.c4
-rw-r--r--arch/arm/kernel/smp.c72
4 files changed, 77 insertions, 90 deletions
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index c45522c36787..66f711b2e0e8 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -20,90 +20,9 @@
20 * references to these in a production kernel! 20 * references to these in a production kernel!
21 */ 21 */
22 22
23#if defined(CONFIG_DEBUG_ICEDCC) 23#if !defined(CONFIG_DEBUG_SEMIHOSTING)
24 @@ debug using ARM EmbeddedICE DCC channel 24#include CONFIG_DEBUG_LL_INCLUDE
25 25#endif
26 .macro addruart, rp, rv, tmp
27 .endm
28
29#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
30
31 .macro senduart, rd, rx
32 mcr p14, 0, \rd, c0, c5, 0
33 .endm
34
35 .macro busyuart, rd, rx
361001:
37 mrc p14, 0, \rx, c0, c1, 0
38 tst \rx, #0x20000000
39 beq 1001b
40 .endm
41
42 .macro waituart, rd, rx
43 mov \rd, #0x2000000
441001:
45 subs \rd, \rd, #1
46 bmi 1002f
47 mrc p14, 0, \rx, c0, c1, 0
48 tst \rx, #0x20000000
49 bne 1001b
501002:
51 .endm
52
53#elif defined(CONFIG_CPU_XSCALE)
54
55 .macro senduart, rd, rx
56 mcr p14, 0, \rd, c8, c0, 0
57 .endm
58
59 .macro busyuart, rd, rx
601001:
61 mrc p14, 0, \rx, c14, c0, 0
62 tst \rx, #0x10000000
63 beq 1001b
64 .endm
65
66 .macro waituart, rd, rx
67 mov \rd, #0x10000000
681001:
69 subs \rd, \rd, #1
70 bmi 1002f
71 mrc p14, 0, \rx, c14, c0, 0
72 tst \rx, #0x10000000
73 bne 1001b
741002:
75 .endm
76
77#else
78
79 .macro senduart, rd, rx
80 mcr p14, 0, \rd, c1, c0, 0
81 .endm
82
83 .macro busyuart, rd, rx
841001:
85 mrc p14, 0, \rx, c0, c0, 0
86 tst \rx, #2
87 beq 1001b
88
89 .endm
90
91 .macro waituart, rd, rx
92 mov \rd, #0x2000000
931001:
94 subs \rd, \rd, #1
95 bmi 1002f
96 mrc p14, 0, \rx, c0, c0, 0
97 tst \rx, #2
98 bne 1001b
991002:
100 .endm
101
102#endif /* CONFIG_CPU_V6 */
103
104#elif !defined(CONFIG_DEBUG_SEMIHOSTING)
105#include <mach/debug-macro.S>
106#endif /* CONFIG_DEBUG_ICEDCC */
107 26
108#ifdef CONFIG_MMU 27#ifdef CONFIG_MMU
109 .macro addruart_current, rx, tmp1, tmp2 28 .macro addruart_current, rx, tmp1, tmp2
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 3db960e20cb8..9874d0741191 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -23,8 +23,8 @@
23#include <asm/thread_info.h> 23#include <asm/thread_info.h>
24#include <asm/pgtable.h> 24#include <asm/pgtable.h>
25 25
26#ifdef CONFIG_DEBUG_LL 26#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_SEMIHOSTING)
27#include <mach/debug-macro.S> 27#include CONFIG_DEBUG_LL_INCLUDE
28#endif 28#endif
29 29
30/* 30/*
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index a81dcecc7343..725f9f2a9541 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -977,8 +977,10 @@ void __init setup_arch(char **cmdline_p)
977 unflatten_device_tree(); 977 unflatten_device_tree();
978 978
979#ifdef CONFIG_SMP 979#ifdef CONFIG_SMP
980 if (is_smp()) 980 if (is_smp()) {
981 smp_set_ops(mdesc->smp);
981 smp_init_cpus(); 982 smp_init_cpus();
983 }
982#endif 984#endif
983 reserve_crashkernel(); 985 reserve_crashkernel();
984 986
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index ebd8ad274d76..aa4ffe6e5ecf 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -19,7 +19,6 @@
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/err.h> 20#include <linux/err.h>
21#include <linux/cpu.h> 21#include <linux/cpu.h>
22#include <linux/smp.h>
23#include <linux/seq_file.h> 22#include <linux/seq_file.h>
24#include <linux/irq.h> 23#include <linux/irq.h>
25#include <linux/percpu.h> 24#include <linux/percpu.h>
@@ -27,6 +26,7 @@
27#include <linux/completion.h> 26#include <linux/completion.h>
28 27
29#include <linux/atomic.h> 28#include <linux/atomic.h>
29#include <asm/smp.h>
30#include <asm/cacheflush.h> 30#include <asm/cacheflush.h>
31#include <asm/cpu.h> 31#include <asm/cpu.h>
32#include <asm/cputype.h> 32#include <asm/cputype.h>
@@ -42,6 +42,7 @@
42#include <asm/ptrace.h> 42#include <asm/ptrace.h>
43#include <asm/localtimer.h> 43#include <asm/localtimer.h>
44#include <asm/smp_plat.h> 44#include <asm/smp_plat.h>
45#include <asm/mach/arch.h>
45 46
46/* 47/*
47 * as from 2.5, kernels no longer have an init_tasks structure 48 * as from 2.5, kernels no longer have an init_tasks structure
@@ -50,6 +51,12 @@
50 */ 51 */
51struct secondary_data secondary_data; 52struct secondary_data secondary_data;
52 53
54/*
55 * control for which core is the next to come out of the secondary
56 * boot "holding pen"
57 */
58volatile int __cpuinitdata pen_release = -1;
59
53enum ipi_msg_type { 60enum ipi_msg_type {
54 IPI_TIMER = 2, 61 IPI_TIMER = 2,
55 IPI_RESCHEDULE, 62 IPI_RESCHEDULE,
@@ -60,6 +67,14 @@ enum ipi_msg_type {
60 67
61static DECLARE_COMPLETION(cpu_running); 68static DECLARE_COMPLETION(cpu_running);
62 69
70static struct smp_operations smp_ops;
71
72void __init smp_set_ops(struct smp_operations *ops)
73{
74 if (ops)
75 smp_ops = *ops;
76};
77
63int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle) 78int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle)
64{ 79{
65 int ret; 80 int ret;
@@ -100,13 +115,64 @@ int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle)
100 return ret; 115 return ret;
101} 116}
102 117
118/* platform specific SMP operations */
119void __init smp_init_cpus(void)
120{
121 if (smp_ops.smp_init_cpus)
122 smp_ops.smp_init_cpus();
123}
124
125static void __init platform_smp_prepare_cpus(unsigned int max_cpus)
126{
127 if (smp_ops.smp_prepare_cpus)
128 smp_ops.smp_prepare_cpus(max_cpus);
129}
130
131static void __cpuinit platform_secondary_init(unsigned int cpu)
132{
133 if (smp_ops.smp_secondary_init)
134 smp_ops.smp_secondary_init(cpu);
135}
136
137int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
138{
139 if (smp_ops.smp_boot_secondary)
140 return smp_ops.smp_boot_secondary(cpu, idle);
141 return -ENOSYS;
142}
143
103#ifdef CONFIG_HOTPLUG_CPU 144#ifdef CONFIG_HOTPLUG_CPU
104static void percpu_timer_stop(void); 145static void percpu_timer_stop(void);
105 146
147static int platform_cpu_kill(unsigned int cpu)
148{
149 if (smp_ops.cpu_kill)
150 return smp_ops.cpu_kill(cpu);
151 return 1;
152}
153
154static void platform_cpu_die(unsigned int cpu)
155{
156 if (smp_ops.cpu_die)
157 smp_ops.cpu_die(cpu);
158}
159
160static int platform_cpu_disable(unsigned int cpu)
161{
162 if (smp_ops.cpu_disable)
163 return smp_ops.cpu_disable(cpu);
164
165 /*
166 * By default, allow disabling all CPUs except the first one,
167 * since this is special on a lot of platforms, e.g. because
168 * of clock tick interrupts.
169 */
170 return cpu == 0 ? -EPERM : 0;
171}
106/* 172/*
107 * __cpu_disable runs on the processor to be shutdown. 173 * __cpu_disable runs on the processor to be shutdown.
108 */ 174 */
109int __cpu_disable(void) 175int __cpuinit __cpu_disable(void)
110{ 176{
111 unsigned int cpu = smp_processor_id(); 177 unsigned int cpu = smp_processor_id();
112 int ret; 178 int ret;
@@ -149,7 +215,7 @@ static DECLARE_COMPLETION(cpu_died);
149 * called on the thread which is asking for a CPU to be shutdown - 215 * called on the thread which is asking for a CPU to be shutdown -
150 * waits until shutdown has completed, or it is timed out. 216 * waits until shutdown has completed, or it is timed out.
151 */ 217 */
152void __cpu_die(unsigned int cpu) 218void __cpuinit __cpu_die(unsigned int cpu)
153{ 219{
154 if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) { 220 if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) {
155 pr_err("CPU%u: cpu didn't die\n", cpu); 221 pr_err("CPU%u: cpu didn't die\n", cpu);