diff options
-rw-r--r-- | arch/arm/boot/compressed/head.S | 3 | ||||
-rw-r--r-- | arch/arm/kernel/head.S | 18 |
2 files changed, 11 insertions, 10 deletions
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index e5ab51b9cceb..2568d311be21 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S | |||
@@ -237,7 +237,8 @@ not_relocated: mov r0, #0 | |||
237 | */ | 237 | */ |
238 | cmp r4, r2 | 238 | cmp r4, r2 |
239 | bhs wont_overwrite | 239 | bhs wont_overwrite |
240 | add r0, r4, #4096*1024 @ 4MB largest kernel size | 240 | sub r3, sp, r5 @ > compressed kernel size |
241 | add r0, r4, r3, lsl #2 @ allow for 4x expansion | ||
241 | cmp r0, r5 | 242 | cmp r0, r5 |
242 | bls wont_overwrite | 243 | bls wont_overwrite |
243 | 244 | ||
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 5365d4e5949e..ebc3e74a7947 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
@@ -234,18 +234,18 @@ __create_page_tables: | |||
234 | 234 | ||
235 | /* | 235 | /* |
236 | * Now setup the pagetables for our kernel direct | 236 | * Now setup the pagetables for our kernel direct |
237 | * mapped region. We round TEXTADDR down to the | 237 | * mapped region. |
238 | * nearest megabyte boundary. It is assumed that | ||
239 | * the kernel fits within 4 contigous 1MB sections. | ||
240 | */ | 238 | */ |
241 | add r0, r4, #(TEXTADDR & 0xff000000) >> 18 @ start of kernel | 239 | add r0, r4, #(TEXTADDR & 0xff000000) >> 18 @ start of kernel |
242 | str r3, [r0, #(TEXTADDR & 0x00f00000) >> 18]! | 240 | str r3, [r0, #(TEXTADDR & 0x00f00000) >> 18]! |
243 | add r3, r3, #1 << 20 | 241 | |
244 | str r3, [r0, #4]! @ KERNEL + 1MB | 242 | ldr r6, =(_end - PAGE_OFFSET - 1) @ r6 = number of sections |
245 | add r3, r3, #1 << 20 | 243 | mov r6, r6, lsr #20 @ needed for kernel minus 1 |
246 | str r3, [r0, #4]! @ KERNEL + 2MB | 244 | |
247 | add r3, r3, #1 << 20 | 245 | 1: add r3, r3, #1 << 20 |
248 | str r3, [r0, #4] @ KERNEL + 3MB | 246 | str r3, [r0, #4]! |
247 | subs r6, r6, #1 | ||
248 | bgt 1b | ||
249 | 249 | ||
250 | /* | 250 | /* |
251 | * Then map first 1MB of ram in case it contains our boot params. | 251 | * Then map first 1MB of ram in case it contains our boot params. |