Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84955
b: refs/heads/master
c: ef8028a
h: refs/heads/master
i:
  84953: 2491ec7
  84951: be263ae
v: v3
  • Loading branch information
Jesper Nilsson committed Feb 8, 2008
1 parent 6974912 commit 0c5dfce
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 546cc14862c8712341823c9235268062bac87b74
refs/heads/master: ef8028a7ab1014b174c1ff9f565e387bd2a9a436
58 changes: 29 additions & 29 deletions trunk/arch/cris/arch-v10/boot/rescue/kimagerescue.S
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/* $Id: kimagerescue.S,v 1.1 2001/12/17 13:59:27 bjornw Exp $
*
/*
* Rescue code to be prepended on a kimage and copied to the
* rescue serial port.
* This is called from the rescue code, it will copy received data to
* 4004000 and after a timeout jump to it.
*/

#define ASSEMBLER_MACROS_ONLY
#include <asm/sv_addr_ag.h>
#include <asm/arch/sv_addr_ag.h>

#define CODE_START 0x40004000
#define CODE_LENGTH 784
#define TIMEOUT_VALUE 1000


#ifdef CONFIG_ETRAX_RESCUE_SER0
#define SERXOFF R_SERIAL0_XOFF
#define SERBAUD R_SERIAL0_BAUD
Expand All @@ -34,7 +33,7 @@
#define SERRECC R_SERIAL2_REC_CTRL
#define SERRDAT R_SERIAL2_REC_DATA
#define SERSTAT R_SERIAL2_STATUS
#endif
#endif
#ifdef CONFIG_ETRAX_RESCUE_SER3
#define SERXOFF R_SERIAL3_XOFF
#define SERBAUD R_SERIAL3_BAUD
Expand All @@ -48,54 +47,55 @@
;; 0x80000000 if loaded in flash (as it should be)
;; 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
nop

nop
di
#ifndef CONFIG_SVINTO_SIM
#ifndef CONFIG_SVINTO_SIM
;; setup port PA and PB default initial directions and data
;; (so we can flash LEDs, and so that DTR and others are set)

move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, $r0
move.b $r0, [R_PORT_PA_DIR]
move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, $r0
move.b $r0, [R_PORT_PA_DATA]

move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, $r0
move.b $r0, [R_PORT_PB_DIR]
move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, $r0
move.b $r0, [R_PORT_PB_DATA]

;; We need to setup the bus registers before we start using the DRAM
#include "../../lib/dram_init.S"

#endif
;; Setup the stack to a suitably high address.
;; We assume 8 MB is the minimum DRAM in an eLinux
;; product and put the sp at the top for now.

move.d 0x40800000, $sp

;; setup the serial port at 115200 baud

moveq 0, $r0
move.d $r0, [SERXOFF]
move.d $r0, [SERXOFF]

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 $r0, [SERRECC]
move.b $r0, [SERRECC]


moveq 0, $r1 ; "timer" to clock out a LED red flash
move.d CODE_START, $r3 ; destination counter
moveq 0, $r1 ; "timer" to clock out a LED red flash
move.d CODE_START, $r3 ; destination counter
move.d CODE_LENGTH, $r4 ; length
move.d TIMEOUT_VALUE, $r5 ; "timeout" until jump

wait_ser:
addq 1, $r1
subq 1, $r5 ; decrease timeout
beq jump_start ; timed out
subq 1, $r5 ; decrease timeout
beq jump_start ; timed out
nop
#ifndef CONFIG_ETRAX_NO_LEDS
#ifdef CONFIG_ETRAX_PA_LEDS
Expand All @@ -111,21 +111,21 @@ wait_ser:
or.d $r0, $r2 ; set bit
ba 2f
nop
1: not $r0 ; clear bit
1: not $r0 ; clear bit
and.d $r0, $r2
2:
2:
#ifdef CONFIG_ETRAX_PA_LEDS
move.b $r2, [R_PORT_PA_DATA]
#endif
#endif
#ifdef CONFIG_ETRAX_PB_LEDS
move.b $r2, [R_PORT_PB_DATA]
#endif
#endif

;; check if we got something on the serial port

move.b [SERSTAT], $r0
btstq 0, $r0 ; data_avail
btstq 0, $r0 ; data_avail
bpl wait_ser
nop

Expand All @@ -134,7 +134,7 @@ wait_ser:
move.b [SERRDAT], $r0
move.b $r0, [$r3+]
move.d TIMEOUT_VALUE, $r5 ; reset "timeout"
subq 1, $r4 ; decrease length
subq 1, $r4 ; decrease length
bne wait_ser
nop
jump_start:
Expand Down

0 comments on commit 0c5dfce

Please sign in to comment.