diff options
author | Will Deacon <will.deacon@arm.com> | 2012-02-28 06:50:32 -0500 |
---|---|---|
committer | Jonathan Austin <jonathan.austin@arm.com> | 2013-06-07 12:02:41 -0400 |
commit | 01fafcab20fbbd2930691c7fdcf177eaa190d499 (patch) | |
tree | 80da01e4544fbd018b041e3321b02cbaa9cde9e2 | |
parent | 78ecad0183bd7e49131da2b5aa82bee017db1cf0 (diff) |
ARM: nommu: add entry point for secondary CPUs to head-nommu.S
This patch adds a secondary_startup entry point to head-nommu.S so that
we can boot secondary CPUs on an SMP nommu configuration.
Signed-off-by: Will Deacon <will.deacon@arm.com>
CC: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
CC: Nicolas Pitre <nico@linaro.org>
-rw-r--r-- | arch/arm/kernel/head-nommu.S | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S index 8812ce88f7a1..06ba9c8e62be 100644 --- a/arch/arm/kernel/head-nommu.S +++ b/arch/arm/kernel/head-nommu.S | |||
@@ -63,12 +63,56 @@ ENTRY(stext) | |||
63 | movs r10, r5 @ invalid processor (r5=0)? | 63 | movs r10, r5 @ invalid processor (r5=0)? |
64 | beq __error_p @ yes, error 'p' | 64 | beq __error_p @ yes, error 'p' |
65 | 65 | ||
66 | adr lr, BSYM(__after_proc_init) @ return (PIC) address | 66 | ldr r13, =__mmap_switched @ address to jump to after |
67 | @ initialising sctlr | ||
68 | adr lr, BSYM(1f) @ return (PIC) address | ||
67 | ARM( add pc, r10, #PROCINFO_INITFUNC ) | 69 | ARM( add pc, r10, #PROCINFO_INITFUNC ) |
68 | THUMB( add r12, r10, #PROCINFO_INITFUNC ) | 70 | THUMB( add r12, r10, #PROCINFO_INITFUNC ) |
69 | THUMB( mov pc, r12 ) | 71 | THUMB( mov pc, r12 ) |
72 | 1: b __after_proc_init | ||
70 | ENDPROC(stext) | 73 | ENDPROC(stext) |
71 | 74 | ||
75 | #ifdef CONFIG_SMP | ||
76 | __CPUINIT | ||
77 | ENTRY(secondary_startup) | ||
78 | /* | ||
79 | * Common entry point for secondary CPUs. | ||
80 | * | ||
81 | * Ensure that we're in SVC mode, and IRQs are disabled. Lookup | ||
82 | * the processor type - there is no need to check the machine type | ||
83 | * as it has already been validated by the primary processor. | ||
84 | */ | ||
85 | setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 | ||
86 | #ifndef CONFIG_CPU_CP15 | ||
87 | ldr r9, =CONFIG_PROCESSOR_ID | ||
88 | #else | ||
89 | mrc p15, 0, r9, c0, c0 @ get processor id | ||
90 | #endif | ||
91 | bl __lookup_processor_type @ r5=procinfo r9=cpuid | ||
92 | movs r10, r5 @ invalid processor? | ||
93 | beq __error_p @ yes, error 'p' | ||
94 | |||
95 | adr r4, __secondary_data | ||
96 | ldmia r4, {r7, r12} | ||
97 | adr lr, BSYM(__after_proc_init) @ return address | ||
98 | mov r13, r12 @ __secondary_switched address | ||
99 | ARM( add pc, r10, #PROCINFO_INITFUNC ) | ||
100 | THUMB( add r12, r10, #PROCINFO_INITFUNC ) | ||
101 | THUMB( mov pc, r12 ) | ||
102 | ENDPROC(secondary_startup) | ||
103 | |||
104 | ENTRY(__secondary_switched) | ||
105 | ldr sp, [r7, #8] @ set up the stack pointer | ||
106 | mov fp, #0 | ||
107 | b secondary_start_kernel | ||
108 | ENDPROC(__secondary_switched) | ||
109 | |||
110 | .type __secondary_data, %object | ||
111 | __secondary_data: | ||
112 | .long secondary_data | ||
113 | .long __secondary_switched | ||
114 | #endif /* CONFIG_SMP */ | ||
115 | |||
72 | /* | 116 | /* |
73 | * Set the Control Register and Read the process ID. | 117 | * Set the Control Register and Read the process ID. |
74 | */ | 118 | */ |
@@ -99,9 +143,7 @@ __after_proc_init: | |||
99 | #endif | 143 | #endif |
100 | mcr p15, 0, r0, c1, c0, 0 @ write control reg | 144 | mcr p15, 0, r0, c1, c0, 0 @ write control reg |
101 | #endif /* CONFIG_CPU_CP15 */ | 145 | #endif /* CONFIG_CPU_CP15 */ |
102 | 146 | mov pc, r13 | |
103 | b __mmap_switched @ clear the BSS and jump | ||
104 | @ to start_kernel | ||
105 | ENDPROC(__after_proc_init) | 147 | ENDPROC(__after_proc_init) |
106 | .ltorg | 148 | .ltorg |
107 | 149 | ||