Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] ARM: 2816/1: Shark: boot kernel images bigger than 1 MB

Patch from Alexander Schulz

Up to now, shark kernels were limited to one megabyte compressed
size. As the kernels get bigger, this becomes more and more
uncomfortable. So I added a loop to copy 3 MB instead of one
and added some comments.

Signed-off-by: Alexander Schulz <alex@shark-linux.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Alexander Schulz and committed by
Russell King
246b4976 b66da4a4

+33 -9
+33 -9
arch/arm/boot/compressed/head-shark.S
··· 63 63 64 64 mov pc, r2 65 65 66 - __copy_target: .long 0x08508000 67 - __copy_end: .long 0x08608000 66 + __copy_target: .long 0x08507FFC 67 + __copy_end: .long 0x08607FFC 68 68 69 69 .word _start 70 70 .word __bss_start ··· 73 73 __temp_stack: .space 128 74 74 75 75 __mmu_off: 76 - adr r0, __ofw_data 76 + adr r0, __ofw_data @ read the 1. entry of the memory map 77 77 ldr r0, [r0, #4] 78 78 orr r0, r0, #0x00600000 79 + sub r0, r0, #4 79 80 80 81 ldr r1, __copy_end 81 82 ldr r3, __copy_target ··· 90 89 * from 0x08500000 to 0x08508000 if we have only 8MB 91 90 */ 92 91 92 + /* As we get more 2.6-kernels it gets more and more 93 + * uncomfortable to be bound to kernel images of 1MB only. 94 + * So we add a loop here, to be able to copy some more. 95 + * Alexander Schulz 2005-07-17 96 + */ 97 + 98 + mov r4, #3 @ How many megabytes to copy 99 + 100 + 101 + __MoveCode: sub r4, r4, #1 93 102 94 103 __Copy: ldr r2, [r0], #-4 95 104 str r2, [r1], #-4 96 105 teq r1, r3 97 106 bne __Copy 107 + 108 + /* The firmware maps us in blocks of 1 MB, the next block is 109 + _below_ the last one. So our decrementing source pointer 110 + ist right here, but the destination pointer must be increased 111 + by 2 MB */ 112 + add r1, r1, #0x00200000 113 + add r3, r3, #0x00100000 114 + 115 + teq r4, #0 116 + bne __MoveCode 117 + 118 + 98 119 /* and jump to it */ 99 - adr r2, __go_on 100 - adr r0, __ofw_data 120 + adr r2, __go_on @ where we want to jump 121 + adr r0, __ofw_data @ read the 1. entry of the memory map 101 122 ldr r0, [r0, #4] 102 - sub r2, r2, r0 103 - sub r2, r2, #0x00500000 104 - ldr r0, __copy_target 123 + sub r2, r2, r0 @ we are mapped add 0e50 now, sub that (-0e00) 124 + sub r2, r2, #0x00500000 @ -0050 125 + ldr r0, __copy_target @ and add 0850 8000 instead 126 + add r0, r0, #4 105 127 add r2, r2, r0 106 - mov pc, r2 128 + mov pc, r2 @ and jump there 107 129 108 130 __go_on: 109 131 adr sp, __temp_stack