]> git.sur5r.net Git - u-boot/commitdiff
arm: relocate_code(): do not set register useless
authorAndreas Bießmann <andreas.devel@googlemail.com>
Tue, 30 Nov 2010 23:58:34 +0000 (00:58 +0100)
committerWolfgang Denk <wd@denx.de>
Thu, 9 Dec 2010 10:01:15 +0000 (11:01 +0100)
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>
14 files changed:
arch/arm/cpu/arm1136/start.S
arch/arm/cpu/arm1176/start.S
arch/arm/cpu/arm720t/start.S
arch/arm/cpu/arm920t/start.S
arch/arm/cpu/arm925t/start.S
arch/arm/cpu/arm926ejs/start.S
arch/arm/cpu/arm946es/start.S
arch/arm/cpu/arm_intcm/start.S
arch/arm/cpu/armv7/start.S
arch/arm/cpu/ixp/start.S
arch/arm/cpu/lh7a40x/start.S
arch/arm/cpu/pxa/start.S
arch/arm/cpu/s3c44b0/start.S
arch/arm/cpu/sa1100/start.S

index 7e3b3104e9b985a1be945f0c8799ab8f2d2cdeb0..df17fe33c6e2eeca32e9768809e75f295e8526a5 100644 (file)
@@ -193,12 +193,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]    */
index 5c1899311c57aac7c1d5756b1fc9631dd7c10fff..ab751093745f00d8bc0394441a937d3473524f59 100644 (file)
@@ -247,12 +247,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]    */
index e3d81597daaf5d4507a4d15db56f6c92fc76df68..84ccaf3a456e1eb12f4640917de0fe34b086e4f3 100644 (file)
@@ -162,12 +162,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]    */
index b8d20d3b767e1ab1cbcd2fc38d8da91e9dbe00e9..97ceb7a106437b1824db092d9b4945e1d24a12b8 100644 (file)
@@ -208,12 +208,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]    */
index 6d6d8f85043541d88b143b164210b7a56e392ded..0e6d41396192bc5174485ea56a1264e1e81e0e2d 100644 (file)
@@ -199,12 +199,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]    */
index d3f563036ec4a9b084e3862999b4b10fa1abfcb9..32001e8789a1ee6eea61d5a31869981e9e709d89 100644 (file)
@@ -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]    */
index e3a84a1367885ceec2aff42c557155b13ea6b2a0..079477704de5cc01a7b24249dbed3dd2898e092c 100644 (file)
@@ -170,12 +170,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]    */
index 752c2a5d1b20fb225383a9453e0b45d0886d346d..809125261092ac0b4d2cd186469d8ab669268c26 100644 (file)
@@ -166,12 +166,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]    */
index fe982352f51e4b2f25ffc1c389c76d7e1a836bfb..0cb5f34afe10003b814ff467a90ae043d65982ff 100644 (file)
@@ -166,14 +166,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]    */
index 61264008d3c423348f4bf6bb975b21673c17de44..087f594ee2cba3fa819224333cace288557c97f3 100644 (file)
@@ -292,12 +292,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]    */
index e9af2631cdc135f5f2a459d3fed4dcd55e68201f..94eb00e0329307874099a8b5750cf8d2a02c66ae 100644 (file)
@@ -179,12 +179,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]    */
index 7e1c6e62aa5e907a87d110241350f9c38adb6a41..53391ec303f6da11c10663e46eff93d395d19228 100644 (file)
@@ -244,12 +244,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:
index 89e42b193702bd2f012420002719367e6ddefc04..e992c38d043ba11c9345c706b740d3f2a6ae6cb6 100644 (file)
@@ -151,12 +151,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]    */
index a7696879830a498e87bd24929aff8b829c32c2ed..1246b7831ae376e29cef8fab9da50e4ccffabe9e 100644 (file)
@@ -155,12 +155,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]    */