aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/head.S4
-rw-r--r--arch/arm/kernel/smp.c31
2 files changed, 4 insertions, 31 deletions
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 43e3aa3b0573..64e9943ea4f0 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -398,7 +398,8 @@ ENDPROC(__enable_mmu)
398 * other registers depend on the function called upon completion 398 * other registers depend on the function called upon completion
399 */ 399 */
400 .align 5 400 .align 5
401__turn_mmu_on: 401 .pushsection .idmap.text, "ax"
402ENTRY(__turn_mmu_on)
402 mov r0, r0 403 mov r0, r0
403 mcr p15, 0, r0, c1, c0, 0 @ write control reg 404 mcr p15, 0, r0, c1, c0, 0 @ write control reg
404 mrc p15, 0, r3, c0, c0, 0 @ read id reg 405 mrc p15, 0, r3, c0, c0, 0 @ read id reg
@@ -407,6 +408,7 @@ __turn_mmu_on:
407 mov pc, r3 408 mov pc, r3
408__turn_mmu_on_end: 409__turn_mmu_on_end:
409ENDPROC(__turn_mmu_on) 410ENDPROC(__turn_mmu_on)
411 .popsection
410 412
411 413
412#ifdef CONFIG_SMP_ON_UP 414#ifdef CONFIG_SMP_ON_UP
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 8afadda37459..76ff28d87bf3 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -62,7 +62,6 @@ int __cpuinit __cpu_up(unsigned int cpu)
62{ 62{
63 struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu); 63 struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu);
64 struct task_struct *idle = ci->idle; 64 struct task_struct *idle = ci->idle;
65 pgd_t *pgd;
66 int ret; 65 int ret;
67 66
68 /* 67 /*
@@ -85,29 +84,11 @@ int __cpuinit __cpu_up(unsigned int cpu)
85 } 84 }
86 85
87 /* 86 /*
88 * Allocate initial page tables to allow the new CPU to
89 * enable the MMU safely. This essentially means a set
90 * of our "standard" page tables, with the addition of
91 * a 1:1 mapping for the physical address of the kernel.
92 */
93 pgd = pgd_alloc(&init_mm);
94 if (!pgd)
95 return -ENOMEM;
96
97 if (PHYS_OFFSET != PAGE_OFFSET) {
98#ifndef CONFIG_HOTPLUG_CPU
99 identity_mapping_add(pgd, __pa(__init_begin), __pa(__init_end));
100#endif
101 identity_mapping_add(pgd, __pa(_stext), __pa(_etext));
102 identity_mapping_add(pgd, __pa(_sdata), __pa(_edata));
103 }
104
105 /*
106 * We need to tell the secondary core where to find 87 * We need to tell the secondary core where to find
107 * its stack and the page tables. 88 * its stack and the page tables.
108 */ 89 */
109 secondary_data.stack = task_stack_page(idle) + THREAD_START_SP; 90 secondary_data.stack = task_stack_page(idle) + THREAD_START_SP;
110 secondary_data.pgdir = virt_to_phys(pgd); 91 secondary_data.pgdir = virt_to_phys(idmap_pgd);
111 secondary_data.swapper_pg_dir = virt_to_phys(swapper_pg_dir); 92 secondary_data.swapper_pg_dir = virt_to_phys(swapper_pg_dir);
112 __cpuc_flush_dcache_area(&secondary_data, sizeof(secondary_data)); 93 __cpuc_flush_dcache_area(&secondary_data, sizeof(secondary_data));
113 outer_clean_range(__pa(&secondary_data), __pa(&secondary_data + 1)); 94 outer_clean_range(__pa(&secondary_data), __pa(&secondary_data + 1));
@@ -143,16 +124,6 @@ int __cpuinit __cpu_up(unsigned int cpu)
143 secondary_data.stack = NULL; 124 secondary_data.stack = NULL;
144 secondary_data.pgdir = 0; 125 secondary_data.pgdir = 0;
145 126
146 if (PHYS_OFFSET != PAGE_OFFSET) {
147#ifndef CONFIG_HOTPLUG_CPU
148 identity_mapping_del(pgd, __pa(__init_begin), __pa(__init_end));
149#endif
150 identity_mapping_del(pgd, __pa(_stext), __pa(_etext));
151 identity_mapping_del(pgd, __pa(_sdata), __pa(_edata));
152 }
153
154 pgd_free(&init_mm, pgd);
155
156 return ret; 127 return ret;
157} 128}
158 129