diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-12-08 13:02:04 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-12-08 13:02:04 -0500 |
commit | 6ae25a5b9d7ba86d6ac19c403dfa57dae6caa73d (patch) | |
tree | 41d04269f268d6162e5f1866496dd42fbc79d2a4 /arch/arm/kernel | |
parent | 3ee0fc5ca129cbae81c073756febcb1c552af446 (diff) | |
parent | 497b7e943d0dc5743454de56dcdb67352bbf96b2 (diff) |
Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux into devel-stable
Conflicts:
arch/arm/mm/ioremap.c
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/head.S | 47 | ||||
-rw-r--r-- | arch/arm/kernel/hw_breakpoint.c | 8 | ||||
-rw-r--r-- | arch/arm/kernel/sleep.S | 2 |
3 files changed, 51 insertions, 6 deletions
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index fb2945be5a51..14e277d2ff91 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
@@ -39,8 +39,14 @@ | |||
39 | #error KERNEL_RAM_VADDR must start at 0xXXXX8000 | 39 | #error KERNEL_RAM_VADDR must start at 0xXXXX8000 |
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | #ifdef CONFIG_ARM_LPAE | ||
43 | /* LPAE requires an additional page for the PGD */ | ||
44 | #define PG_DIR_SIZE 0x5000 | ||
45 | #define PMD_ORDER 3 | ||
46 | #else | ||
42 | #define PG_DIR_SIZE 0x4000 | 47 | #define PG_DIR_SIZE 0x4000 |
43 | #define PMD_ORDER 2 | 48 | #define PMD_ORDER 2 |
49 | #endif | ||
44 | 50 | ||
45 | .globl swapper_pg_dir | 51 | .globl swapper_pg_dir |
46 | .equ swapper_pg_dir, KERNEL_RAM_VADDR - PG_DIR_SIZE | 52 | .equ swapper_pg_dir, KERNEL_RAM_VADDR - PG_DIR_SIZE |
@@ -164,6 +170,25 @@ __create_page_tables: | |||
164 | teq r0, r6 | 170 | teq r0, r6 |
165 | bne 1b | 171 | bne 1b |
166 | 172 | ||
173 | #ifdef CONFIG_ARM_LPAE | ||
174 | /* | ||
175 | * Build the PGD table (first level) to point to the PMD table. A PGD | ||
176 | * entry is 64-bit wide. | ||
177 | */ | ||
178 | mov r0, r4 | ||
179 | add r3, r4, #0x1000 @ first PMD table address | ||
180 | orr r3, r3, #3 @ PGD block type | ||
181 | mov r6, #4 @ PTRS_PER_PGD | ||
182 | mov r7, #1 << (55 - 32) @ L_PGD_SWAPPER | ||
183 | 1: str r3, [r0], #4 @ set bottom PGD entry bits | ||
184 | str r7, [r0], #4 @ set top PGD entry bits | ||
185 | add r3, r3, #0x1000 @ next PMD table | ||
186 | subs r6, r6, #1 | ||
187 | bne 1b | ||
188 | |||
189 | add r4, r4, #0x1000 @ point to the PMD tables | ||
190 | #endif | ||
191 | |||
167 | ldr r7, [r10, #PROCINFO_MM_MMUFLAGS] @ mm_mmuflags | 192 | ldr r7, [r10, #PROCINFO_MM_MMUFLAGS] @ mm_mmuflags |
168 | 193 | ||
169 | /* | 194 | /* |
@@ -219,8 +244,8 @@ __create_page_tables: | |||
219 | #endif | 244 | #endif |
220 | 245 | ||
221 | /* | 246 | /* |
222 | * Then map boot params address in r2 or | 247 | * Then map boot params address in r2 or the first 1MB (2MB with LPAE) |
223 | * the first 1MB of ram if boot params address is not specified. | 248 | * of ram if boot params address is not specified. |
224 | */ | 249 | */ |
225 | mov r0, r2, lsr #SECTION_SHIFT | 250 | mov r0, r2, lsr #SECTION_SHIFT |
226 | movs r0, r0, lsl #SECTION_SHIFT | 251 | movs r0, r0, lsl #SECTION_SHIFT |
@@ -251,7 +276,15 @@ __create_page_tables: | |||
251 | mov r3, r7, lsr #SECTION_SHIFT | 276 | mov r3, r7, lsr #SECTION_SHIFT |
252 | ldr r7, [r10, #PROCINFO_IO_MMUFLAGS] @ io_mmuflags | 277 | ldr r7, [r10, #PROCINFO_IO_MMUFLAGS] @ io_mmuflags |
253 | orr r3, r7, r3, lsl #SECTION_SHIFT | 278 | orr r3, r7, r3, lsl #SECTION_SHIFT |
279 | #ifdef CONFIG_ARM_LPAE | ||
280 | mov r7, #1 << (54 - 32) @ XN | ||
281 | #else | ||
282 | orr r3, r3, #PMD_SECT_XN | ||
283 | #endif | ||
254 | 1: str r3, [r0], #4 | 284 | 1: str r3, [r0], #4 |
285 | #ifdef CONFIG_ARM_LPAE | ||
286 | str r7, [r0], #4 | ||
287 | #endif | ||
255 | add r3, r3, #1 << SECTION_SHIFT | 288 | add r3, r3, #1 << SECTION_SHIFT |
256 | cmp r0, r6 | 289 | cmp r0, r6 |
257 | blo 1b | 290 | blo 1b |
@@ -283,6 +316,9 @@ __create_page_tables: | |||
283 | str r3, [r0] | 316 | str r3, [r0] |
284 | #endif | 317 | #endif |
285 | #endif | 318 | #endif |
319 | #ifdef CONFIG_ARM_LPAE | ||
320 | sub r4, r4, #0x1000 @ point to the PGD table | ||
321 | #endif | ||
286 | mov pc, lr | 322 | mov pc, lr |
287 | ENDPROC(__create_page_tables) | 323 | ENDPROC(__create_page_tables) |
288 | .ltorg | 324 | .ltorg |
@@ -374,12 +410,17 @@ __enable_mmu: | |||
374 | #ifdef CONFIG_CPU_ICACHE_DISABLE | 410 | #ifdef CONFIG_CPU_ICACHE_DISABLE |
375 | bic r0, r0, #CR_I | 411 | bic r0, r0, #CR_I |
376 | #endif | 412 | #endif |
413 | #ifdef CONFIG_ARM_LPAE | ||
414 | mov r5, #0 | ||
415 | mcrr p15, 0, r4, r5, c2 @ load TTBR0 | ||
416 | #else | ||
377 | mov r5, #(domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \ | 417 | mov r5, #(domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \ |
378 | domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ | 418 | domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ |
379 | domain_val(DOMAIN_TABLE, DOMAIN_MANAGER) | \ | 419 | domain_val(DOMAIN_TABLE, DOMAIN_MANAGER) | \ |
380 | domain_val(DOMAIN_IO, DOMAIN_CLIENT)) | 420 | domain_val(DOMAIN_IO, DOMAIN_CLIENT)) |
381 | mcr p15, 0, r5, c3, c0, 0 @ load domain access register | 421 | mcr p15, 0, r5, c3, c0, 0 @ load domain access register |
382 | mcr p15, 0, r4, c2, c0, 0 @ load page table pointer | 422 | mcr p15, 0, r4, c2, c0, 0 @ load page table pointer |
423 | #endif | ||
383 | b __turn_mmu_on | 424 | b __turn_mmu_on |
384 | ENDPROC(__enable_mmu) | 425 | ENDPROC(__enable_mmu) |
385 | 426 | ||
@@ -401,8 +442,10 @@ ENDPROC(__enable_mmu) | |||
401 | .pushsection .idmap.text, "ax" | 442 | .pushsection .idmap.text, "ax" |
402 | ENTRY(__turn_mmu_on) | 443 | ENTRY(__turn_mmu_on) |
403 | mov r0, r0 | 444 | mov r0, r0 |
445 | instr_sync | ||
404 | mcr p15, 0, r0, c1, c0, 0 @ write control reg | 446 | mcr p15, 0, r0, c1, c0, 0 @ write control reg |
405 | mrc p15, 0, r3, c0, c0, 0 @ read id reg | 447 | mrc p15, 0, r3, c0, c0, 0 @ read id reg |
448 | instr_sync | ||
406 | mov r3, r3 | 449 | mov r3, r3 |
407 | mov r3, r13 | 450 | mov r3, r13 |
408 | mov pc, r3 | 451 | mov pc, r3 |
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c index 814a52a9dc39..d6a95ef9131d 100644 --- a/arch/arm/kernel/hw_breakpoint.c +++ b/arch/arm/kernel/hw_breakpoint.c | |||
@@ -1016,10 +1016,10 @@ static int __init arch_hw_breakpoint_init(void) | |||
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | /* Register debug fault handler. */ | 1018 | /* Register debug fault handler. */ |
1019 | hook_fault_code(2, hw_breakpoint_pending, SIGTRAP, TRAP_HWBKPT, | 1019 | hook_fault_code(FAULT_CODE_DEBUG, hw_breakpoint_pending, SIGTRAP, |
1020 | "watchpoint debug exception"); | 1020 | TRAP_HWBKPT, "watchpoint debug exception"); |
1021 | hook_ifault_code(2, hw_breakpoint_pending, SIGTRAP, TRAP_HWBKPT, | 1021 | hook_ifault_code(FAULT_CODE_DEBUG, hw_breakpoint_pending, SIGTRAP, |
1022 | "breakpoint debug exception"); | 1022 | TRAP_HWBKPT, "breakpoint debug exception"); |
1023 | 1023 | ||
1024 | /* Register hotplug notifier. */ | 1024 | /* Register hotplug notifier. */ |
1025 | register_cpu_notifier(&dbg_reset_nb); | 1025 | register_cpu_notifier(&dbg_reset_nb); |
diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S index 9e64231c8cfe..1f268bda4552 100644 --- a/arch/arm/kernel/sleep.S +++ b/arch/arm/kernel/sleep.S | |||
@@ -57,8 +57,10 @@ ENDPROC(cpu_suspend_abort) | |||
57 | .pushsection .idmap.text,"ax" | 57 | .pushsection .idmap.text,"ax" |
58 | ENTRY(cpu_resume_mmu) | 58 | ENTRY(cpu_resume_mmu) |
59 | ldr r3, =cpu_resume_after_mmu | 59 | ldr r3, =cpu_resume_after_mmu |
60 | instr_sync | ||
60 | mcr p15, 0, r0, c1, c0, 0 @ turn on MMU, I-cache, etc | 61 | mcr p15, 0, r0, c1, c0, 0 @ turn on MMU, I-cache, etc |
61 | mrc p15, 0, r0, c0, c0, 0 @ read id reg | 62 | mrc p15, 0, r0, c0, c0, 0 @ read id reg |
63 | instr_sync | ||
62 | mov r0, r0 | 64 | mov r0, r0 |
63 | mov r0, r0 | 65 | mov r0, r0 |
64 | mov pc, r3 @ jump to virtual address | 66 | mov pc, r3 @ jump to virtual address |