diff options
-rw-r--r-- | arch/arm/include/asm/smp.h | 1 | ||||
-rw-r--r-- | arch/arm/kernel/head.S | 7 | ||||
-rw-r--r-- | arch/arm/kernel/smp.c | 1 | ||||
-rw-r--r-- | arch/arm/mm/proc-v6.S | 4 | ||||
-rw-r--r-- | arch/arm/mm/proc-v7.S | 4 |
5 files changed, 13 insertions, 4 deletions
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h index d2b514fd76f4..e42d96a45d3e 100644 --- a/arch/arm/include/asm/smp.h +++ b/arch/arm/include/asm/smp.h | |||
@@ -70,6 +70,7 @@ extern void platform_smp_prepare_cpus(unsigned int); | |||
70 | */ | 70 | */ |
71 | struct secondary_data { | 71 | struct secondary_data { |
72 | unsigned long pgdir; | 72 | unsigned long pgdir; |
73 | unsigned long swapper_pg_dir; | ||
73 | void *stack; | 74 | void *stack; |
74 | }; | 75 | }; |
75 | extern struct secondary_data secondary_data; | 76 | extern struct secondary_data secondary_data; |
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index c9173cfbbc74..8224b1d5f2f2 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
@@ -113,6 +113,7 @@ ENTRY(stext) | |||
113 | ldr r13, =__mmap_switched @ address to jump to after | 113 | ldr r13, =__mmap_switched @ address to jump to after |
114 | @ mmu has been enabled | 114 | @ mmu has been enabled |
115 | adr lr, BSYM(1f) @ return (PIC) address | 115 | adr lr, BSYM(1f) @ return (PIC) address |
116 | mov r8, r4 @ set TTBR1 to swapper_pg_dir | ||
116 | ARM( add pc, r10, #PROCINFO_INITFUNC ) | 117 | ARM( add pc, r10, #PROCINFO_INITFUNC ) |
117 | THUMB( add r12, r10, #PROCINFO_INITFUNC ) | 118 | THUMB( add r12, r10, #PROCINFO_INITFUNC ) |
118 | THUMB( mov pc, r12 ) | 119 | THUMB( mov pc, r12 ) |
@@ -302,8 +303,10 @@ ENTRY(secondary_startup) | |||
302 | */ | 303 | */ |
303 | adr r4, __secondary_data | 304 | adr r4, __secondary_data |
304 | ldmia r4, {r5, r7, r12} @ address to jump to after | 305 | ldmia r4, {r5, r7, r12} @ address to jump to after |
305 | sub r4, r4, r5 @ mmu has been enabled | 306 | sub lr, r4, r5 @ mmu has been enabled |
306 | ldr r4, [r7, r4] @ get secondary_data.pgdir | 307 | ldr r4, [r7, lr] @ get secondary_data.pgdir |
308 | add r7, r7, #4 | ||
309 | ldr r8, [r7, lr] @ get secondary_data.swapper_pg_dir | ||
307 | adr lr, BSYM(__enable_mmu) @ return address | 310 | adr lr, BSYM(__enable_mmu) @ return address |
308 | mov r13, r12 @ __secondary_switched address | 311 | mov r13, r12 @ __secondary_switched address |
309 | ARM( add pc, r10, #PROCINFO_INITFUNC ) @ initialise processor | 312 | ARM( add pc, r10, #PROCINFO_INITFUNC ) @ initialise processor |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index d439a8f4c078..344e52b16c8c 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -105,6 +105,7 @@ int __cpuinit __cpu_up(unsigned int cpu) | |||
105 | */ | 105 | */ |
106 | secondary_data.stack = task_stack_page(idle) + THREAD_START_SP; | 106 | secondary_data.stack = task_stack_page(idle) + THREAD_START_SP; |
107 | secondary_data.pgdir = virt_to_phys(pgd); | 107 | secondary_data.pgdir = virt_to_phys(pgd); |
108 | secondary_data.swapper_pg_dir = virt_to_phys(swapper_pg_dir); | ||
108 | __cpuc_flush_dcache_area(&secondary_data, sizeof(secondary_data)); | 109 | __cpuc_flush_dcache_area(&secondary_data, sizeof(secondary_data)); |
109 | outer_clean_range(__pa(&secondary_data), __pa(&secondary_data + 1)); | 110 | outer_clean_range(__pa(&secondary_data), __pa(&secondary_data + 1)); |
110 | 111 | ||
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S index ab17cc0d3fa7..1d2b8451bf25 100644 --- a/arch/arm/mm/proc-v6.S +++ b/arch/arm/mm/proc-v6.S | |||
@@ -213,7 +213,9 @@ __v6_setup: | |||
213 | mcr p15, 0, r0, c2, c0, 2 @ TTB control register | 213 | mcr p15, 0, r0, c2, c0, 2 @ TTB control register |
214 | ALT_SMP(orr r4, r4, #TTB_FLAGS_SMP) | 214 | ALT_SMP(orr r4, r4, #TTB_FLAGS_SMP) |
215 | ALT_UP(orr r4, r4, #TTB_FLAGS_UP) | 215 | ALT_UP(orr r4, r4, #TTB_FLAGS_UP) |
216 | mcr p15, 0, r4, c2, c0, 1 @ load TTB1 | 216 | ALT_SMP(orr r8, r8, #TTB_FLAGS_SMP) |
217 | ALT_UP(orr r8, r8, #TTB_FLAGS_UP) | ||
218 | mcr p15, 0, r8, c2, c0, 1 @ load TTB1 | ||
217 | #endif /* CONFIG_MMU */ | 219 | #endif /* CONFIG_MMU */ |
218 | adr r5, v6_crval | 220 | adr r5, v6_crval |
219 | ldmia r5, {r5, r6} | 221 | ldmia r5, {r5, r6} |
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index babfba09c89f..3c3867850a30 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -368,7 +368,9 @@ __v7_setup: | |||
368 | mcr p15, 0, r10, c2, c0, 2 @ TTB control register | 368 | mcr p15, 0, r10, c2, c0, 2 @ TTB control register |
369 | ALT_SMP(orr r4, r4, #TTB_FLAGS_SMP) | 369 | ALT_SMP(orr r4, r4, #TTB_FLAGS_SMP) |
370 | ALT_UP(orr r4, r4, #TTB_FLAGS_UP) | 370 | ALT_UP(orr r4, r4, #TTB_FLAGS_UP) |
371 | mcr p15, 0, r4, c2, c0, 1 @ load TTB1 | 371 | ALT_SMP(orr r8, r8, #TTB_FLAGS_SMP) |
372 | ALT_UP(orr r8, r8, #TTB_FLAGS_UP) | ||
373 | mcr p15, 0, r8, c2, c0, 1 @ load TTB1 | ||
372 | ldr r5, =PRRR @ PRRR | 374 | ldr r5, =PRRR @ PRRR |
373 | ldr r6, =NMRR @ NMRR | 375 | ldr r6, =NMRR @ NMRR |
374 | mcr p15, 0, r5, c10, c2, 0 @ write PRRR | 376 | mcr p15, 0, r5, c10, c2, 0 @ write PRRR |