diff options
Diffstat (limited to 'arch/cris/arch-v10/boot/rescue/head.S')
-rw-r--r-- | arch/cris/arch-v10/boot/rescue/head.S | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/arch/cris/arch-v10/boot/rescue/head.S b/arch/cris/arch-v10/boot/rescue/head.S index 8689ea972c46..addb2194de0f 100644 --- a/arch/cris/arch-v10/boot/rescue/head.S +++ b/arch/cris/arch-v10/boot/rescue/head.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: head.S,v 1.6 2003/04/09 08:12:43 pkj Exp $ | 1 | /* $Id: head.S,v 1.7 2005/03/07 12:11:06 starvik Exp $ |
2 | * | 2 | * |
3 | * Rescue code, made to reside at the beginning of the | 3 | * Rescue code, made to reside at the beginning of the |
4 | * flash-memory. when it starts, it checks a partition | 4 | * flash-memory. when it starts, it checks a partition |
@@ -121,12 +121,13 @@ | |||
121 | ;; 0x80000000 if loaded in flash (as it should be) | 121 | ;; 0x80000000 if loaded in flash (as it should be) |
122 | ;; since etrax actually starts at address 2 when booting from flash, we | 122 | ;; since etrax actually starts at address 2 when booting from flash, we |
123 | ;; put a nop (2 bytes) here first so we dont accidentally skip the di | 123 | ;; put a nop (2 bytes) here first so we dont accidentally skip the di |
124 | 124 | ||
125 | nop | 125 | nop |
126 | di | 126 | di |
127 | 127 | ||
128 | jump in_cache ; enter cached area instead | 128 | jump in_cache ; enter cached area instead |
129 | in_cache: | 129 | in_cache: |
130 | |||
130 | 131 | ||
131 | ;; first put a jump test to give a possibility of upgrading the rescue code | 132 | ;; first put a jump test to give a possibility of upgrading the rescue code |
132 | ;; without erasing/reflashing the sector. we put a longword of -1 here and if | 133 | ;; without erasing/reflashing the sector. we put a longword of -1 here and if |
@@ -325,9 +326,29 @@ flash_ok: | |||
325 | ;; result will be in r0 | 326 | ;; result will be in r0 |
326 | checksum: | 327 | checksum: |
327 | moveq 0, $r0 | 328 | moveq 0, $r0 |
328 | 1: addu.b [$r1+], $r0 | 329 | moveq CONFIG_ETRAX_FLASH1_SIZE, $r6 |
329 | subq 1, $r2 | 330 | |
330 | bne 1b | 331 | ;; If the first physical flash memory is exceeded wrap to the second one. |
332 | btstq 26, $r1 ; Are we addressing first flash? | ||
333 | bpl 1f | ||
334 | nop | ||
335 | clear.d $r6 | ||
336 | |||
337 | 1: test.d $r6 ; 0 = no wrapping | ||
338 | beq 2f | ||
339 | nop | ||
340 | lslq 20, $r6 ; Convert MB to bytes | ||
341 | sub.d $r1, $r6 | ||
342 | |||
343 | 2: addu.b [$r1+], $r0 | ||
344 | subq 1, $r6 ; Flash memory left | ||
345 | beq 3f | ||
346 | subq 1, $r2 ; Length left | ||
347 | bne 2b | ||
331 | nop | 348 | nop |
332 | ret | 349 | ret |
333 | nop | 350 | nop |
351 | |||
352 | 3: move.d MEM_CSE1_START, $r1 ; wrap to second flash | ||
353 | ba 2b | ||
354 | nop | ||