Patchwork [U-Boot,03/10] MIPS: xburst/start.S: save relocation address in s2 register

login
register
mail settings
Submitter Gabor Juhos
Date June 13, 2013, 10:59 a.m.
Message ID <1371121176-20256-4-git-send-email-juhosg@openwrt.org>
Download mbox | patch
Permalink /patch/251040/
State Accepted
Delegated to: Daniel Schwierzeck
Headers show

Comments

Gabor Juhos - June 13, 2013, 10:59 a.m.
Synchronize the code with mips{32,64}/start.S, in order to
allow further unifications.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 arch/mips/cpu/xburst/start.S |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Patch

diff --git a/arch/mips/cpu/xburst/start.S b/arch/mips/cpu/xburst/start.S
index d2c064b..33111c7 100644
--- a/arch/mips/cpu/xburst/start.S
+++ b/arch/mips/cpu/xburst/start.S
@@ -63,8 +63,10 @@  _start:
 relocate_code:
 	move	sp, a0			# set new stack pointer
 
+	move	s2, a2			# save destination address in s2
+
 	li	t0, CONFIG_SYS_MONITOR_BASE
-	sub	t6, a2, t0		# t6 <-- relocation offset
+	sub	t6, s2, t0		# t6 <-- relocation offset
 
 	la	t3, in_ram
 	lw	t2, -12(t3)		# t2 <-- __image_copy_end
@@ -112,7 +114,7 @@  relocate_code:
 	nop
 
 	/* Jump to where we've relocated ourselves */
-	addi	t0, a2, in_ram - _start
+	addi	t0, s2, in_ram - _start
 	jr	t0
 	 nop
 
@@ -187,6 +189,6 @@  in_ram:
 	move	a0, a1			# a0 <-- gd
 	la	t9, board_init_r
 	jr	t9
-	 move	a1, a2
+	 move	a1, s2
 
 	.end	relocate_code