From: Andreas Bießmann <andreas.devel@googlemail.com>
Date: Tue, 30 Nov 2010 23:58:36 +0000 (+0100)
Subject: armv7: fix relocation skip
X-Git-Tag: v2025.01-rc5-pxa1908~19788
X-Git-Url: http://git.dujemihanovic.xyz/html/static/git-logo.png?a=commitdiff_plain;h=b9c5081d7d6ebc3290813675ca8771f4471edb85;p=u-boot.git

armv7: fix relocation skip

I doubt the stack_setup() was defective before:
 we load the current location of _start and compare against destination
 of relocate_code(). If we are already there we shoud skip the
 relocation and jump over to clear_bss. Before the clear_bss was also skipped.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
---

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 02fdfc7976..c71ef6cf92 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -166,9 +166,9 @@ stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
-	cmp	r0, r6
 #ifndef CONFIG_PRELOADER
-	beq	jump_2_ram
+	cmp	r0, r6
+	beq	clear_bss		/* skip relocation */
 #endif
 	mov	r1, r6			/* r1 <- scratch for copy_loop */
 	ldr	r2, _TEXT_BASE