forked from luck/tmp_suning_uos_patched
CRIS v10: Update rescue head.s
- Correct whitespace problems. - Add ifdef for ETRAX_AXISFLASHMAP to avoid compile error when not set.
This commit is contained in:
parent
63e6b9a0b8
commit
8c11bffae7
@ -1,5 +1,4 @@
|
|||||||
/* $Id: head.S,v 1.7 2005/03/07 12:11:06 starvik Exp $
|
/*
|
||||||
*
|
|
||||||
* Rescue code, made to reside at the beginning of the
|
* Rescue code, made to reside at the beginning of the
|
||||||
* flash-memory. when it starts, it checks a partition
|
* flash-memory. when it starts, it checks a partition
|
||||||
* table at the first sector after the rescue sector.
|
* table at the first sector after the rescue sector.
|
||||||
@ -60,9 +59,11 @@
|
|||||||
* During the wait for serial input, the status LED will flash so the
|
* During the wait for serial input, the status LED will flash so the
|
||||||
* user knows something went wrong.
|
* user knows something went wrong.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999, 2000, 2001, 2002, 2003 Axis Communications AB
|
* Copyright (C) 1999-2007 Axis Communications AB
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_ETRAX_AXISFLASHMAP
|
||||||
|
|
||||||
#define ASSEMBLER_MACROS_ONLY
|
#define ASSEMBLER_MACROS_ONLY
|
||||||
#include <asm/arch/sv_addr_ag.h>
|
#include <asm/arch/sv_addr_ag.h>
|
||||||
|
|
||||||
@ -118,7 +119,7 @@
|
|||||||
|
|
||||||
;; This is the entry point of the rescue code
|
;; This is the entry point of the rescue code
|
||||||
;; 0x80000000 if loaded in flash (as it should be)
|
;; 0x80000000 if loaded in flash (as it should be)
|
||||||
;; since etrax actually starts at address 2 when booting from flash, we
|
;; Since etrax actually starts at address 2 when booting from flash, we
|
||||||
;; put a nop (2 bytes) here first so we dont accidentally skip the di
|
;; put a nop (2 bytes) here first so we dont accidentally skip the di
|
||||||
|
|
||||||
nop
|
nop
|
||||||
@ -128,10 +129,11 @@
|
|||||||
in_cache:
|
in_cache:
|
||||||
|
|
||||||
|
|
||||||
;; first put a jump test to give a possibility of upgrading the rescue code
|
;; First put a jump test to give a possibility of upgrading the
|
||||||
;; without erasing/reflashing the sector. we put a longword of -1 here and if
|
;; rescue code without erasing/reflashing the sector.
|
||||||
;; it is not -1, we jump using the value as jump target. since we can always
|
;; We put a longword of -1 here and if it is not -1, we jump using
|
||||||
;; change 1's to 0's without erasing the sector, it is possible to add new
|
;; the value as jump target. Since we can always change 1's to 0's
|
||||||
|
;; without erasing the sector, it is possible to add new
|
||||||
;; code after this and altering the jumptarget in an upgrade.
|
;; code after this and altering the jumptarget in an upgrade.
|
||||||
|
|
||||||
jtcd: move.d [jumptarget], $r0
|
jtcd: move.d [jumptarget], $r0
|
||||||
@ -214,7 +216,6 @@ bosse: move.d [$r3+], $r5 ; checksum
|
|||||||
nop
|
nop
|
||||||
move.d $r1, $r7 ; remember boot partition offset
|
move.d $r1, $r7 ; remember boot partition offset
|
||||||
1:
|
1:
|
||||||
|
|
||||||
add.d PTABLE_START, $r1
|
add.d PTABLE_START, $r1
|
||||||
|
|
||||||
jsr checksum ; checksum the partition
|
jsr checksum ; checksum the partition
|
||||||
@ -245,9 +246,9 @@ do_rescue:
|
|||||||
move.d $r0, [SERXOFF]
|
move.d $r0, [SERXOFF]
|
||||||
|
|
||||||
move.b 0x99, $r0
|
move.b 0x99, $r0
|
||||||
move.b $r0, [SERBAUD] ; 115.2kbaud for both transmit and receive
|
move.b $r0, [SERBAUD] ; 115.2kbaud for both transmit and receive
|
||||||
|
|
||||||
move.b 0x40, $r0 ; rec enable
|
move.b 0x40, $r0 ; rec enable
|
||||||
move.b $r0, [SERRECC]
|
move.b $r0, [SERRECC]
|
||||||
|
|
||||||
moveq 0, $r1 ; "timer" to clock out a LED red flash
|
moveq 0, $r1 ; "timer" to clock out a LED red flash
|
||||||
@ -302,7 +303,8 @@ wait_ser:
|
|||||||
|
|
||||||
;; jump into downloaded code
|
;; jump into downloaded code
|
||||||
|
|
||||||
move.d RAM_INIT_MAGIC, $r8 ; Tell next product that DRAM is initialized
|
move.d RAM_INIT_MAGIC, $r8 ; Tell next product that DRAM is
|
||||||
|
; initialized
|
||||||
jump CODE_START
|
jump CODE_START
|
||||||
|
|
||||||
flash_ok:
|
flash_ok:
|
||||||
@ -313,7 +315,8 @@ flash_ok:
|
|||||||
nop
|
nop
|
||||||
move.d PTABLE_START, $r7; otherwise use the ptable start
|
move.d PTABLE_START, $r7; otherwise use the ptable start
|
||||||
1:
|
1:
|
||||||
move.d RAM_INIT_MAGIC, $r8 ; Tell next product that DRAM is initialized
|
move.d RAM_INIT_MAGIC, $r8 ; Tell next product that DRAM is
|
||||||
|
; initialized
|
||||||
jump $r7 ; boot!
|
jump $r7 ; boot!
|
||||||
|
|
||||||
|
|
||||||
@ -327,7 +330,7 @@ checksum:
|
|||||||
moveq 0, $r0
|
moveq 0, $r0
|
||||||
moveq CONFIG_ETRAX_FLASH1_SIZE, $r6
|
moveq CONFIG_ETRAX_FLASH1_SIZE, $r6
|
||||||
|
|
||||||
;; If the first physical flash memory is exceeded wrap to the second one.
|
;; If the first physical flash memory is exceeded wrap to the second one
|
||||||
btstq 26, $r1 ; Are we addressing first flash?
|
btstq 26, $r1 ; Are we addressing first flash?
|
||||||
bpl 1f
|
bpl 1f
|
||||||
nop
|
nop
|
||||||
@ -351,3 +354,5 @@ checksum:
|
|||||||
3: move.d MEM_CSE1_START, $r1 ; wrap to second flash
|
3: move.d MEM_CSE1_START, $r1 ; wrap to second flash
|
||||||
ba 2b
|
ba 2b
|
||||||
nop
|
nop
|
||||||
|
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user