Patchwork [U-Boot,4/4] armv7: fix relocation skip

login
register
mail settings
Submitter Andreas Bießmann
Date Nov. 30, 2010, 11:58 p.m.
Message ID <1291161516-21861-5-git-send-email-andreas.devel@googlemail.com>
Download mbox | patch
Permalink /patch/73686/
State Accepted
Delegated to: Wolfgang Denk
Headers show

Comments

Andreas Bießmann - Nov. 30, 2010, 11:58 p.m.
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>
---
Dear Albert,
(or whoever works with armv7 currently)

However I doubt there is another issue when CONFIG_PRELOADER is not set!
Then the bss will never be setup, is that correct?

 arch/arm/cpu/armv7/start.S |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Albert ARIBAUD - Dec. 1, 2010, 6:50 a.m.
Le 01/12/2010 00:58, Andreas Bießmann a écrit :

> 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>
> ---
> Dear Albert,
> (or whoever works with armv7 currently)
>
> However I doubt there is another issue when CONFIG_PRELOADER is not set!
> Then the bss will never be setup, is that correct?

That is correct and had to be fixed indeed. Thanks!

Amicalement,
Wolfgang Denk - Dec. 8, 2010, 11 p.m.
Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,

In message <1291161516-21861-5-git-send-email-andreas.devel@googlemail.com> you wrote:
> 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>
> ---
> Dear Albert,
> (or whoever works with armv7 currently)
> 
> However I doubt there is another issue when CONFIG_PRELOADER is not set!
> Then the bss will never be setup, is that correct?
> 
>  arch/arm/cpu/armv7/start.S |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
Albert ARIBAUD - Dec. 9, 2010, 12:56 p.m.
Le 01/12/2010 00:58, Andreas Bießmann a écrit :
> 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>

Acked-by: Albert ARIBAUD <albertaribaud@free.fr>

Amicalement,

Patch

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 5d79f34..7e31cc2 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -165,9 +165,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