Patchwork [U-Boot,2/4] arm: relocate_code(): do not set register useless

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

Comments

Andreas Bießmann - Nov. 30, 2010, 11:58 p.m.
In case we are still at relocation target address before relocation we
do not need to load the registers needed for relocation. We should
instead skip the whole relocation part and jump over to clear_bss
immediately.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
---
 arch/arm/cpu/arm1136/start.S   |    4 ++--
 arch/arm/cpu/arm1176/start.S   |    4 ++--
 arch/arm/cpu/arm720t/start.S   |    4 ++--
 arch/arm/cpu/arm920t/start.S   |    4 ++--
 arch/arm/cpu/arm925t/start.S   |    4 ++--
 arch/arm/cpu/arm926ejs/start.S |    4 ++--
 arch/arm/cpu/arm946es/start.S  |    4 ++--
 arch/arm/cpu/arm_intcm/start.S |    4 ++--
 arch/arm/cpu/armv7/start.S     |    8 ++++----
 arch/arm/cpu/ixp/start.S       |    4 ++--
 arch/arm/cpu/lh7a40x/start.S   |    4 ++--
 arch/arm/cpu/pxa/start.S       |    4 ++--
 arch/arm/cpu/s3c44b0/start.S   |    4 ++--
 arch/arm/cpu/sa1100/start.S    |    4 ++--
 14 files changed, 30 insertions(+), 30 deletions(-)
Wolfgang Denk - Dec. 8, 2010, 10:59 p.m.
Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,

In message <1291161516-21861-3-git-send-email-andreas.devel@googlemail.com> you wrote:
> In case we are still at relocation target address before relocation we
> do not need to load the registers needed for relocation. We should
> instead skip the whole relocation part and jump over to clear_bss
> immediately.
> 
> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
> ---
>  arch/arm/cpu/arm1136/start.S   |    4 ++--
>  arch/arm/cpu/arm1176/start.S   |    4 ++--
>  arch/arm/cpu/arm720t/start.S   |    4 ++--
>  arch/arm/cpu/arm920t/start.S   |    4 ++--
>  arch/arm/cpu/arm925t/start.S   |    4 ++--
>  arch/arm/cpu/arm926ejs/start.S |    4 ++--
>  arch/arm/cpu/arm946es/start.S  |    4 ++--
>  arch/arm/cpu/arm_intcm/start.S |    4 ++--
>  arch/arm/cpu/armv7/start.S     |    8 ++++----
>  arch/arm/cpu/ixp/start.S       |    4 ++--
>  arch/arm/cpu/lh7a40x/start.S   |    4 ++--
>  arch/arm/cpu/pxa/start.S       |    4 ++--
>  arch/arm/cpu/s3c44b0/start.S   |    4 ++--
>  arch/arm/cpu/sa1100/start.S    |    4 ++--
>  14 files changed, 30 insertions(+), 30 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
Albert ARIBAUD - Dec. 9, 2010, 12:57 p.m.
Le 01/12/2010 00:58, Andreas Bießmann a écrit :
> In case we are still at relocation target address before relocation we
> do not need to load the registers needed for relocation. We should
> instead skip the whole relocation part and jump over to clear_bss
> immediately.
>
> Signed-off-by: Andreas Bießmann<andreas.devel@googlemail.com>

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

Amicalement,
Albert ARIBAUD - Dec. 9, 2010, 12:58 p.m.
Le 01/12/2010 00:58, Andreas Bießmann a écrit :
> In case we are still at relocation target address before relocation we
> do not need to load the registers needed for relocation. We should
> instead skip the whole relocation part and jump over to clear_bss
> immediately.
>
> Signed-off-by: Andreas Bießmann<andreas.devel@googlemail.com>

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

(note: other patches in the series have a typo in my e-mail address -- 
missing dot between my name and surname. In my case, lack not of beer 
but of coffee.)

Amicalement,

Patch

diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index 153a881..7ba7245 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -192,12 +192,12 @@  stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
+	cmp	r0, r6
+	beq	clear_bss		/* skip relocation */
 	mov	r1, r6			/* r1 <- scratch for copy_loop */
 	ldr	r2, _TEXT_BASE
 	ldr	r3, _bss_start_ofs
 	add	r2, r0, r3		/* r2 <- source end address	    */
-	cmp	r0, r6
-	beq	clear_bss
 
 copy_loop:
 	ldmia	r0!, {r9-r10}		/* copy from source address [r0]    */
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index 5046765..f9c8671 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -246,12 +246,12 @@  stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
+	cmp	r0, r6
+	beq	clear_bss		/* skip relocation */
 	mov	r1, r6			/* r1 <- scratch for copy_loop */
 	ldr	r2, _TEXT_BASE
 	ldr	r3, _bss_start_ofs
 	add	r2, r0, r3		/* r2 <- source end address	    */
-	cmp	r0, r6
-	beq	clear_bss
 
 copy_loop:
 	ldmia	r0!, {r9-r10}		/* copy from source address [r0]    */
diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index c34ec44..6a6af1b 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -161,12 +161,12 @@  stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
+	cmp	r0, r6
+	beq	clear_bss		/* skip relocation */
 	mov	r1, r6			/* r1 <- scratch for copy_loop */
 	ldr	r2, _TEXT_BASE
 	ldr	r3, _bss_start_ofs
 	add	r2, r0, r3		/* r2 <- source end address	    */
-	cmp	r0, r6
-	beq	clear_bss
 
 copy_loop:
 	ldmia	r0!, {r9-r10}		/* copy from source address [r0]    */
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index cae0e3c..cdf0920 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -207,12 +207,12 @@  stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
+	cmp	r0, r6
+	beq	clear_bss		/* skip relocation */
 	mov	r1, r6			/* r1 <- scratch for copy_loop */
 	ldr	r2, _TEXT_BASE
 	ldr	r3, _bss_start_ofs
 	add	r2, r0, r3		/* r2 <- source end address	    */
-	cmp	r0, r6
-	beq	clear_bss
 
 copy_loop:
 	ldmia	r0!, {r9-r10}		/* copy from source address [r0]    */
diff --git a/arch/arm/cpu/arm925t/start.S b/arch/arm/cpu/arm925t/start.S
index ebce803..54f2339 100644
--- a/arch/arm/cpu/arm925t/start.S
+++ b/arch/arm/cpu/arm925t/start.S
@@ -198,12 +198,12 @@  stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
+	cmp	r0, r6
+	beq	clear_bss		/* skip relocation */
 	mov	r1, r6			/* r1 <- scratch for copy_loop */
 	ldr	r2, _TEXT_BASE
 	ldr	r3, _bss_start_ofs
 	add	r2, r0, r3		/* r2 <- source end address	    */
-	cmp	r0, r6
-	beq	clear_bss
 
 copy_loop:
 	ldmia	r0!, {r9-r10}		/* copy from source address [r0]    */
diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index a099f7d..59db6b5 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -197,12 +197,12 @@  stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
+	cmp	r0, r6
+	beq	clear_bss		/* skip relocation */
 	mov	r1, r6			/* r1 <- scratch for copy loop */
 	ldr	r2, _TEXT_BASE
 	ldr	r3, _bss_start_ofs
 	add	r2, r0, r3		/* r2 <- source end address	    */
-	cmp	r0, r6
-	beq	clear_bss
 
 copy_loop:
 	ldmia	r0!, {r9-r10}		/* copy from source address [r0]    */
diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
index bb97143..90ae0cf 100644
--- a/arch/arm/cpu/arm946es/start.S
+++ b/arch/arm/cpu/arm946es/start.S
@@ -169,12 +169,12 @@  stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
+	cmp	r0, r6
+	beq	clear_bss		/* skip relocation */
 	mov	r1, r6			/* r1 <- scratch for copy_loop */
 	ldr	r2, _TEXT_BASE
 	ldr	r3, _bss_start_ofs
 	add	r2, r0, r3		/* r2 <- source end address	    */
-	cmp	r0, r6
-	beq	clear_bss
 
 copy_loop:
 	ldmia	r0!, {r9-r10}		/* copy from source address [r0]    */
diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S
index a1a548c..e53eaa7 100644
--- a/arch/arm/cpu/arm_intcm/start.S
+++ b/arch/arm/cpu/arm_intcm/start.S
@@ -165,12 +165,12 @@  stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
+	cmp	r0, r6
+	beq	clear_bss		/* skip relocation */
 	mov	r1, r6			/* r1 <- scratch for copy_loop */
 	ldr	r2, _TEXT_BASE
 	ldr	r3, _bss_start_ofs
 	add	r2, r0, r3		/* r2 <- source end address	    */
-	cmp	r0, r6
-	beq	clear_bss
 
 copy_loop:
 	ldmia	r0!, {r9-r10}		/* copy from source address [r0]    */
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index e6f6d69..1c2b36b 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -165,14 +165,14 @@  stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
-	ldr	r2, _TEXT_BASE
-	ldr	r3, _bss_start_ofs
-	add	r2, r0, r3		/* r2 <- source end address	    */
-	mov	r1, r6			/* r1 <- scratch for copy_loop */
 	cmp	r0, r6
 #ifndef CONFIG_PRELOADER
 	beq	jump_2_ram
 #endif
+	mov	r1, r6			/* r1 <- scratch for copy_loop */
+	ldr	r2, _TEXT_BASE
+	ldr	r3, _bss_start_ofs
+	add	r2, r0, r3		/* r2 <- source end address	    */
 
 copy_loop:
 	ldmia	r0!, {r9-r10}		/* copy from source address [r0]    */
diff --git a/arch/arm/cpu/ixp/start.S b/arch/arm/cpu/ixp/start.S
index c6dee26..d176869 100644
--- a/arch/arm/cpu/ixp/start.S
+++ b/arch/arm/cpu/ixp/start.S
@@ -291,12 +291,12 @@  stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
+	cmp	r0, r6
+	beq	clear_bss		/* skip relocation */
 	mov	r1, r6			/* r1 <- scratch for copy_loop */
 	ldr	r2, _TEXT_BASE
 	ldr	r3, _bss_start_ofs
 	add	r2, r0, r3		/* r2 <- source end address	    */
-	cmp	r0, r6
-	beq	clear_bss
 
 copy_loop:
 	ldmia	r0!, {r9-r10}		/* copy from source address [r0]    */
diff --git a/arch/arm/cpu/lh7a40x/start.S b/arch/arm/cpu/lh7a40x/start.S
index 119fe18..73cdda4 100644
--- a/arch/arm/cpu/lh7a40x/start.S
+++ b/arch/arm/cpu/lh7a40x/start.S
@@ -178,12 +178,12 @@  stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
+	cmp	r0, r6
+	beq	clear_bss		/* skip relocation */
 	mov	r1, r6			/* r1 <- scratch for copy_loop */
 	ldr	r2, _TEXT_BASE
 	ldr	r3, _bss_start_ofs
 	add	r2, r0, r3		/* r2 <- source end address	    */
-	cmp	r0, r6
-	beq	clear_bss
 
 copy_loop:
 	ldmia	r0!, {r9-r10}		/* copy from source address [r0]    */
diff --git a/arch/arm/cpu/pxa/start.S b/arch/arm/cpu/pxa/start.S
index be4eb8b..d37797a 100644
--- a/arch/arm/cpu/pxa/start.S
+++ b/arch/arm/cpu/pxa/start.S
@@ -243,12 +243,12 @@  stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
+	cmp	r0, r6
+	beq	clear_bss		/* skip relocation */
 	mov	r1, r6			/* r1 <- scratch for copy_loop */
 	ldr	r2, _TEXT_BASE
 	ldr	r3, _bss_start_ofs
 	add	r2, r0, r3		/* r2 <- source end address	    */
-	cmp	r0, r6
-	beq	clear_bss
 
 	stmfd sp!, {r0-r12}
 copy_loop:
diff --git a/arch/arm/cpu/s3c44b0/start.S b/arch/arm/cpu/s3c44b0/start.S
index 9667eab..ac8f913 100644
--- a/arch/arm/cpu/s3c44b0/start.S
+++ b/arch/arm/cpu/s3c44b0/start.S
@@ -150,12 +150,12 @@  stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
+	cmp	r0, r6
+	beq	clear_bss		/* skip relocation */
 	mov	r1, r6			/* r1 <- scratch for copy_loop */
 	ldr	r2, _TEXT_BASE
 	ldr	r3, _bss_start_ofs
 	add	r2, r0, r3		/* r2 <- source end address	    */
-	cmp	r0, r6
-	beq	clear_bss
 
 copy_loop:
 	ldmia	r0!, {r9-r10}		/* copy from source address [r0]    */
diff --git a/arch/arm/cpu/sa1100/start.S b/arch/arm/cpu/sa1100/start.S
index e928bc2..61ac21f 100644
--- a/arch/arm/cpu/sa1100/start.S
+++ b/arch/arm/cpu/sa1100/start.S
@@ -154,12 +154,12 @@  stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
+	cmp	r0, r6
+	beq	clear_bss		/* skip relocation */
 	mov	r1, r6			/* r1 <- scratch for copy_loop */
 	ldr	r2, _TEXT_BASE
 	ldr	r3, _bss_start_ofs
 	add	r2, r0, r3		/* r2 <- source end address	    */
-	cmp	r0, r6
-	beq	clear_bss
 
 copy_loop:
 	ldmia	r0!, {r9-r10}		/* copy from source address [r0]    */