arm: Fixed the offset for the no relocation.
PATCH v3 1/1 arm: Fixed the offset for the no relocation.
From: Zhong Hongbo <[email protected]>
When the u-boot address of destination equal to __start, no relocation. relocation offset(r9) = 0.
---
Change for V3:
- Drop the change of arm720t, It has already merge the change.
Change for V2:
- Clean a line for arm1176.
--- arch/arm/cpu/arm1136/start.S | 1 + arch/arm/cpu/arm1176/start.S | 1 + arch/arm/cpu/arm920t/start.S | 1 + arch/arm/cpu/arm925t/start.S | 1 + arch/arm/cpu/arm926ejs/start.S | 1 + arch/arm/cpu/arm946es/start.S | 1 + arch/arm/cpu/arm_intcm/start.S | 1 + arch/arm/cpu/ixp/start.S | 1 + arch/arm/cpu/lh7a40x/start.S | 1 + arch/arm/cpu/pxa/start.S | 1 + arch/arm/cpu/s3c44b0/start.S | 1 + arch/arm/cpu/sa1100/start.S | 1 + 12 files changed, 12 insertions(+)
arch/arm/cpu/arm1136/start.S +1 -0
@@ -190,6 +190,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofs
arch/arm/cpu/arm1176/start.S +1 -0
@@ -252,6 +252,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofs
arch/arm/cpu/arm920t/start.S +1 -0
@@ -210,6 +210,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofs
arch/arm/cpu/arm925t/start.S +1 -0
@@ -204,6 +204,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofs
arch/arm/cpu/arm926ejs/start.S +1 -0
@@ -235,6 +235,7 @@ stack_setup: adr r0, _start sub r9, r6, r0 /* r9 <- relocation offset */ cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy loop */ ldr r3, _bss_start_ofs
arch/arm/cpu/arm946es/start.S +1 -0
@@ -175,6 +175,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofs
arch/arm/cpu/arm_intcm/start.S +1 -0
@@ -171,6 +171,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofs
arch/arm/cpu/ixp/start.S +1 -0
@@ -273,6 +273,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofs
arch/arm/cpu/lh7a40x/start.S +1 -0
@@ -184,6 +184,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofs
arch/arm/cpu/pxa/start.S +1 -0
@@ -197,6 +197,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofs
arch/arm/cpu/s3c44b0/start.S +1 -0
@@ -156,6 +156,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofs
arch/arm/cpu/sa1100/start.S +1 -0
@@ -160,6 +160,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofs
Signature · 1 line
1.7.9.5
PATCH v3 1/1 arm: Fixed the offset for the no relocation.
Sorry, Add Albert to the thread.
Thanks,
hongbo
Quoted 171 lines · Zhong Hongbo
From: Zhong Hongbo <[email protected]>
When the u-boot address of destination equal to
__start, no relocation. relocation offset(r9) = 0.Signed-off-by Zhong Hongbo <[email protected]>---
Change for V3:
- Drop the change of arm720t, It has already merge the change.
Change for V2:
- Clean a line for arm1176.--- arch/arm/cpu/arm1136/start.S | 1 + arch/arm/cpu/arm1176/start.S | 1 + arch/arm/cpu/arm920t/start.S | 1 + arch/arm/cpu/arm925t/start.S | 1 + arch/arm/cpu/arm926ejs/start.S | 1 + arch/arm/cpu/arm946es/start.S | 1 + arch/arm/cpu/arm_intcm/start.S | 1 + arch/arm/cpu/ixp/start.S | 1 + arch/arm/cpu/lh7a40x/start.S | 1 + arch/arm/cpu/pxa/start.S | 1 + arch/arm/cpu/s3c44b0/start.S | 1 + arch/arm/cpu/sa1100/start.S | 1 + 12 files changed, 12 insertions(+)arch/arm/cpu/arm1136/start.S +1
-0@@ -190,6 +190,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofsarch/arm/cpu/arm1176/start.S +1
-0@@ -252,6 +252,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofsarch/arm/cpu/arm920t/start.S +1
-0@@ -210,6 +210,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofsarch/arm/cpu/arm925t/start.S +1
-0@@ -204,6 +204,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofsarch/arm/cpu/arm926ejs/start.S +1
-0@@ -235,6 +235,7 @@ stack_setup: adr r0, _start sub r9, r6, r0 /* r9 <- relocation offset */ cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy loop */ ldr r3, _bss_start_ofsarch/arm/cpu/arm946es/start.S +1
-0@@ -175,6 +175,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofsarch/arm/cpu/arm_intcm/start.S +1
-0@@ -171,6 +171,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofsarch/arm/cpu/ixp/start.S +1
-0@@ -273,6 +273,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofsarch/arm/cpu/lh7a40x/start.S +1
-0@@ -184,6 +184,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofsarch/arm/cpu/pxa/start.S +1
-0@@ -197,6 +197,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofsarch/arm/cpu/s3c44b0/start.S +1
-0@@ -156,6 +156,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofsarch/arm/cpu/sa1100/start.S +1
-0@@ -160,6 +160,7 @@ stack_setup: adr r0, _start cmp r0, r6 + moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */ beq clear_bss /* skip relocation */ mov r1, r6 /* r1 <- scratch for copy_loop */ ldr r3, _bss_start_ofs
PATCH v3 1/1 arm: Fixed the offset for the no relocation.
In reply to Zhong HongboDear Zhong Hongbo,
Quoted 4 lines
From: Zhong Hongbo <[email protected]>
When the u-boot address of destination equal to
__start, no relocation. relocation offset(r9) = 0.
Good, now what kind of issue does this patch fix?
Quoted 6 lines
Signed-off-by Zhong Hongbo <[email protected]>---
Change for V3:
- Drop the change of arm720t, It has already merge the change.
Change for V2:
- Clean a line for arm1176.
[...]
Best regards,
Marek Vasut
PATCH v3 1/1 arm: Fixed the offset for the no relocation.
Quoted 8 lines · Marek Vasut
Dear Zhong Hongbo,
Quoted 4 lines
From: Zhong Hongbo <[email protected]>
When the u-boot address of destination equal to
__start, no relocation. relocation offset(r9) = 0.Good, now what kind of issue does this patch fix?
Hi Marek
When you adopt CONFIG_SPL_BUILD framework, no CONFIG_NAND_SPL, if the addr of destination is equal to _start, we should skip u-boot relocation.
In the last, u-boot will count the dest addr, see the below:
adr r1, _start
add lr, r0, r1
add lr, lr, r9Here, lr = lr + r9, r9 is the offset of u-boot, So when it do not neet to reolocat, we need to set the zero value for r9 register.
/* setup parameters for board_init_r */
mov r0, r5 /* gd_t */
mov r1, r6 /* dest_addr */
/* jump to it ... */
mov pc, lr
Thanks,
hongbo
Quoted 13 lines
Quoted 7 lines
Signed-off-by Zhong Hongbo <[email protected]>---
Change for V3:
- Drop the change of arm720t, It has already merge the change.
Change for V2:
- Clean a line for arm1176.[...]
Best regards,
Marek Vasut
PATCH v3 1/1 arm: Fixed the offset for the no relocation.
Quoted 21 lines · Zhong Hongbo
Quoted 8 lines · Marek Vasut
Dear Zhong Hongbo,
Quoted 4 lines
From: Zhong Hongbo <[email protected]>
When the u-boot address of destination equal to
__start, no relocation. relocation offset(r9) = 0.Good, now what kind of issue does this patch fix?
Hi Marek
When you adopt
CONFIG_SPL_BUILDframework, noCONFIG_NAND_SPL, if the addr of destination is equal to_start, we should skip u-boot relocation.In the last, u-boot will count the dest addr, see the below:
adr r1, _start add lr, r0, r1 add lr, lr, r9
Quoted 8 lines
Here, lr = lr + r9, r9 is the offset of u-boot, So when it do not neet to reolocat, we need to set the zero value for r9 register.
/* setup parameters for
board_init_r*/
mov r0, r5 /*gd_t*/
mov r1, r6 /*dest_addr*/
/* jump to it ... */
mov pc, lr
I can confirm this issue - I see this when I ported SPL to a MX35 board. However, clearing r9 was not enough. I had to fix also _rel_dyn_* to make SPL working, and I did changing the start.S in the same way start.S for arv7 is built.
Do you not have these issues ?
Regards,
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v3 1/1 arm: Fixed the offset for the no relocation.
Quoted 31 lines · Stefano Babic
Quoted 21 lines · Zhong Hongbo
Quoted 8 lines · Marek Vasut
Dear Zhong Hongbo,
Quoted 4 lines
From: Zhong Hongbo <[email protected]>
When the u-boot address of destination equal to
__start, no relocation. relocation offset(r9) = 0.Good, now what kind of issue does this patch fix?
Hi Marek
When you adopt
CONFIG_SPL_BUILDframework, noCONFIG_NAND_SPL, if the addr of destination is equal to_start, we should skip u-boot relocation.In the last, u-boot will count the dest addr, see the below:
adr r1, _start add lr, r0, r1 add lr, lr, r9Quoted 8 lines
Here, lr = lr + r9, r9 is the offset of u-boot, So when it do not neet to reolocat, we need to set the zero value for r9 register.
/* setup parameters for
board_init_r*/
mov r0, r5 /*gd_t*/
mov r1, r6 /*dest_addr*/
/* jump to it ... */
mov pc, lr
Quoted 6 lines
I can confirm this issue - I see this when I ported SPL to a MX35 board. However, clearing r9 was not enough. I had to fix also _rel_dyn_* to make SPL working, and I did changing the
start.Sin the same waystart.Sfor arv7 is built.Do you not have these issues ?
Hi Stefano,
That is enough for my smdk6400 board.
Thanks,
hongbo
Quoted 4 lines
Regards,
Stefano
PATCH v3 1/1 arm: Fixed the offset for the no relocation.
Quoted 37 lines · Zhong Hongbo
Quoted 36 lines · Stefano Babic
Quoted 21 lines · Zhong Hongbo
Quoted 8 lines · Marek Vasut
Dear Zhong Hongbo,
Quoted 4 lines
From: Zhong Hongbo <[email protected]>
When the u-boot address of destination equal to
__start, no relocation. relocation offset(r9) = 0.Good, now what kind of issue does this patch fix?
Hi Marek
When you adopt
CONFIG_SPL_BUILDframework, noCONFIG_NAND_SPL, if the addr of destination is equal to_start, we should skip u-boot relocation.In the last, u-boot will count the dest addr, see the below:
adr r1, _start add lr, r0, r1 add lr, lr, r9Quoted 8 lines
Here, lr = lr + r9, r9 is the offset of u-boot, So when it do not neet to reolocat, we need to set the zero value for r9 register.
/* setup parameters for
board_init_r*/
mov r0, r5 /*gd_t*/
mov r1, r6 /*dest_addr*/
/* jump to it ... */
mov pc, lrI can confirm this issue - I see this when I ported SPL to a MX35 board. However, clearing r9 was not enough. I had to fix also _rel_dyn_* to make SPL working, and I did changing the
start.Sin the same waystart.Sfor arv7 is built.
Quoted 4 lines
Quoted 1 line
Do you not have these issues ?
Hi Stefano,
That is enough for my smdk6400 board.
Ok, thanks. Then I will post a patch on top of yours, but here my:
Tested on a i.MX35 board (ARM1136) with SPL.
Regards,
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v3 1/1 arm: Fixed the offset for the no relocation.
Quoted 38 lines · Stefano Babic
Quoted 37 lines · Zhong Hongbo
Quoted 36 lines · Stefano Babic
Quoted 21 lines · Zhong Hongbo
Quoted 8 lines · Marek Vasut
Dear Zhong Hongbo,
Quoted 4 lines
From: Zhong Hongbo <[email protected]>
When the u-boot address of destination equal to
__start, no relocation. relocation offset(r9) = 0.Good, now what kind of issue does this patch fix?
Hi Marek
When you adopt
CONFIG_SPL_BUILDframework, noCONFIG_NAND_SPL, if the addr of destination is equal to_start, we should skip u-boot relocation.In the last, u-boot will count the dest addr, see the below:
adr r1, _start add lr, r0, r1 add lr, lr, r9Quoted 8 lines
Here, lr = lr + r9, r9 is the offset of u-boot, So when it do not neet to reolocat, we need to set the zero value for r9 register.
/* setup parameters for
board_init_r*/
mov r0, r5 /*gd_t*/
mov r1, r6 /*dest_addr*/
/* jump to it ... */
mov pc, lrI can confirm this issue - I see this when I ported SPL to a MX35 board. However, clearing r9 was not enough. I had to fix also _rel_dyn_* to make SPL working, and I did changing the
start.Sin the same waystart.Sfor arv7 is built.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Do you not have these issues ?
Hi Stefano,
That is enough for my smdk6400 board.
Hi Stefano,
Quoted 5 lines
Ok, thanks. Then I will post a patch on top of yours, but here my:
Tested-by Stefano Babic <[email protected]>Tested on a i.MX35 board (ARM1136) with SPL.
Ok, Thanks,
BR,
hongbo
Quoted 5 lines
Regards,
Stefano