* [U-Boot] [v3] arm: Fixed the offset for the no relocation.
@ 2012-09-02 6:49 Zhong Hongbo
2012-09-02 6:52 ` Zhong Hongbo
2012-09-03 0:14 ` Marek Vasut
0 siblings, 2 replies; 8+ messages in thread
From: Zhong Hongbo @ 2012-09-02 6:49 UTC (permalink / raw)
To: u-boot
From: Zhong Hongbo <bocui107@gmail.com>
When the u-boot address of destination equal to __start,
no relocation. relocation offset(r9) = 0.
Signed-off-by: Zhong Hongbo <bocui107@gmail.com>
---
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(+)
diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index 2483c63..3752af9 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -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
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index d613641..667a0e0 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -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
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index 9b8604e..14c9156 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -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
diff --git a/arch/arm/cpu/arm925t/start.S b/arch/arm/cpu/arm925t/start.S
index 1a54416..3a483f6 100644
--- a/arch/arm/cpu/arm925t/start.S
+++ b/arch/arm/cpu/arm925t/start.S
@@ -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
diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 6f05f1a..1b530dc 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -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
diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
index b4d1d2d..30e2183 100644
--- a/arch/arm/cpu/arm946es/start.S
+++ b/arch/arm/cpu/arm946es/start.S
@@ -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
diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S
index b85e7d4..a133d19 100644
--- a/arch/arm/cpu/arm_intcm/start.S
+++ b/arch/arm/cpu/arm_intcm/start.S
@@ -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
diff --git a/arch/arm/cpu/ixp/start.S b/arch/arm/cpu/ixp/start.S
index 59c359a..c12f1a7 100644
--- a/arch/arm/cpu/ixp/start.S
+++ b/arch/arm/cpu/ixp/start.S
@@ -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
diff --git a/arch/arm/cpu/lh7a40x/start.S b/arch/arm/cpu/lh7a40x/start.S
index bd68cd4..33b9269 100644
--- a/arch/arm/cpu/lh7a40x/start.S
+++ b/arch/arm/cpu/lh7a40x/start.S
@@ -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
diff --git a/arch/arm/cpu/pxa/start.S b/arch/arm/cpu/pxa/start.S
index 33c73f6..536cf5c 100644
--- a/arch/arm/cpu/pxa/start.S
+++ b/arch/arm/cpu/pxa/start.S
@@ -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
diff --git a/arch/arm/cpu/s3c44b0/start.S b/arch/arm/cpu/s3c44b0/start.S
index 8daf26c..323b923 100644
--- a/arch/arm/cpu/s3c44b0/start.S
+++ b/arch/arm/cpu/s3c44b0/start.S
@@ -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
diff --git a/arch/arm/cpu/sa1100/start.S b/arch/arm/cpu/sa1100/start.S
index bcea2a8..1ea92d1 100644
--- a/arch/arm/cpu/sa1100/start.S
+++ b/arch/arm/cpu/sa1100/start.S
@@ -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
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [U-Boot] [v3] arm: Fixed the offset for the no relocation.
2012-09-02 6:49 [U-Boot] [v3] arm: Fixed the offset for the no relocation Zhong Hongbo
@ 2012-09-02 6:52 ` Zhong Hongbo
2012-09-03 0:14 ` Marek Vasut
1 sibling, 0 replies; 8+ messages in thread
From: Zhong Hongbo @ 2012-09-02 6:52 UTC (permalink / raw)
To: u-boot
Sorry, Add Albert to the thread.
Thanks,
hongbo
On 02/09/12 14:49, Zhong Hongbo wrote:
> From: Zhong Hongbo <bocui107@gmail.com>
>
> When the u-boot address of destination equal to __start,
> no relocation. relocation offset(r9) = 0.
>
> Signed-off-by: Zhong Hongbo <bocui107@gmail.com>
> ---
> 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(+)
>
> diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
> index 2483c63..3752af9 100644
> --- a/arch/arm/cpu/arm1136/start.S
> +++ b/arch/arm/cpu/arm1136/start.S
> @@ -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
> diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
> index d613641..667a0e0 100644
> --- a/arch/arm/cpu/arm1176/start.S
> +++ b/arch/arm/cpu/arm1176/start.S
> @@ -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
> diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
> index 9b8604e..14c9156 100644
> --- a/arch/arm/cpu/arm920t/start.S
> +++ b/arch/arm/cpu/arm920t/start.S
> @@ -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
> diff --git a/arch/arm/cpu/arm925t/start.S b/arch/arm/cpu/arm925t/start.S
> index 1a54416..3a483f6 100644
> --- a/arch/arm/cpu/arm925t/start.S
> +++ b/arch/arm/cpu/arm925t/start.S
> @@ -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
> diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
> index 6f05f1a..1b530dc 100644
> --- a/arch/arm/cpu/arm926ejs/start.S
> +++ b/arch/arm/cpu/arm926ejs/start.S
> @@ -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
> diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
> index b4d1d2d..30e2183 100644
> --- a/arch/arm/cpu/arm946es/start.S
> +++ b/arch/arm/cpu/arm946es/start.S
> @@ -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
> diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S
> index b85e7d4..a133d19 100644
> --- a/arch/arm/cpu/arm_intcm/start.S
> +++ b/arch/arm/cpu/arm_intcm/start.S
> @@ -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
> diff --git a/arch/arm/cpu/ixp/start.S b/arch/arm/cpu/ixp/start.S
> index 59c359a..c12f1a7 100644
> --- a/arch/arm/cpu/ixp/start.S
> +++ b/arch/arm/cpu/ixp/start.S
> @@ -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
> diff --git a/arch/arm/cpu/lh7a40x/start.S b/arch/arm/cpu/lh7a40x/start.S
> index bd68cd4..33b9269 100644
> --- a/arch/arm/cpu/lh7a40x/start.S
> +++ b/arch/arm/cpu/lh7a40x/start.S
> @@ -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
> diff --git a/arch/arm/cpu/pxa/start.S b/arch/arm/cpu/pxa/start.S
> index 33c73f6..536cf5c 100644
> --- a/arch/arm/cpu/pxa/start.S
> +++ b/arch/arm/cpu/pxa/start.S
> @@ -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
> diff --git a/arch/arm/cpu/s3c44b0/start.S b/arch/arm/cpu/s3c44b0/start.S
> index 8daf26c..323b923 100644
> --- a/arch/arm/cpu/s3c44b0/start.S
> +++ b/arch/arm/cpu/s3c44b0/start.S
> @@ -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
> diff --git a/arch/arm/cpu/sa1100/start.S b/arch/arm/cpu/sa1100/start.S
> index bcea2a8..1ea92d1 100644
> --- a/arch/arm/cpu/sa1100/start.S
> +++ b/arch/arm/cpu/sa1100/start.S
> @@ -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
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [v3] arm: Fixed the offset for the no relocation.
2012-09-02 6:49 [U-Boot] [v3] arm: Fixed the offset for the no relocation Zhong Hongbo
2012-09-02 6:52 ` Zhong Hongbo
@ 2012-09-03 0:14 ` Marek Vasut
2012-09-04 14:03 ` Zhong Hongbo
1 sibling, 1 reply; 8+ messages in thread
From: Marek Vasut @ 2012-09-03 0:14 UTC (permalink / raw)
To: u-boot
Dear Zhong Hongbo,
> From: Zhong Hongbo <bocui107@gmail.com>
>
> 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?
> Signed-off-by: Zhong Hongbo <bocui107@gmail.com>
> ---
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [v3] arm: Fixed the offset for the no relocation.
2012-09-03 0:14 ` Marek Vasut
@ 2012-09-04 14:03 ` Zhong Hongbo
2012-09-04 15:57 ` Stefano Babic
0 siblings, 1 reply; 8+ messages in thread
From: Zhong Hongbo @ 2012-09-04 14:03 UTC (permalink / raw)
To: u-boot
On 03/09/12 08:14, Marek Vasut wrote:
> Dear Zhong Hongbo,
>
>> From: Zhong Hongbo <bocui107@gmail.com>
>>
>> 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, r9
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
Thanks,
hongbo
>
>> Signed-off-by: Zhong Hongbo <bocui107@gmail.com>
>> ---
>> 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
>
^ permalink raw reply [flat|nested] 8+ messages in thread* [U-Boot] [v3] arm: Fixed the offset for the no relocation.
2012-09-04 14:03 ` Zhong Hongbo
@ 2012-09-04 15:57 ` Stefano Babic
2012-09-05 14:45 ` Zhong Hongbo
0 siblings, 1 reply; 8+ messages in thread
From: Stefano Babic @ 2012-09-04 15:57 UTC (permalink / raw)
To: u-boot
On 04/09/2012 16:03, Zhong Hongbo wrote:
> On 03/09/12 08:14, Marek Vasut wrote:
>> Dear Zhong Hongbo,
>>
>>> From: Zhong Hongbo <bocui107@gmail.com>
>>>
>>> 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, r9
>
> 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
--
=====================================================================
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
=====================================================================
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [v3] arm: Fixed the offset for the no relocation.
2012-09-04 15:57 ` Stefano Babic
@ 2012-09-05 14:45 ` Zhong Hongbo
2012-09-05 19:22 ` Stefano Babic
0 siblings, 1 reply; 8+ messages in thread
From: Zhong Hongbo @ 2012-09-05 14:45 UTC (permalink / raw)
To: u-boot
On 04/09/12 23:57, Stefano Babic wrote:
> On 04/09/2012 16:03, Zhong Hongbo wrote:
>> On 03/09/12 08:14, Marek Vasut wrote:
>>> Dear Zhong Hongbo,
>>>
>>>> From: Zhong Hongbo <bocui107@gmail.com>
>>>>
>>>> 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, r9
>>
>> 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 ?
Hi Stefano,
That is enough for my smdk6400 board.
Thanks,
hongbo
>
> Regards,
> Stefano
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [v3] arm: Fixed the offset for the no relocation.
2012-09-05 14:45 ` Zhong Hongbo
@ 2012-09-05 19:22 ` Stefano Babic
2012-09-06 15:36 ` Zhong Hongbo
0 siblings, 1 reply; 8+ messages in thread
From: Stefano Babic @ 2012-09-05 19:22 UTC (permalink / raw)
To: u-boot
On 05/09/2012 16:45, Zhong Hongbo wrote:
> On 04/09/12 23:57, Stefano Babic wrote:
>> On 04/09/2012 16:03, Zhong Hongbo wrote:
>>> On 03/09/12 08:14, Marek Vasut wrote:
>>>> Dear Zhong Hongbo,
>>>>
>>>>> From: Zhong Hongbo <bocui107@gmail.com>
>>>>>
>>>>> 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, r9
>>>
>>> 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 ?
> 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-by: Stefano Babic <sbabic@denx.de>
Tested on a i.MX35 board (ARM1136) with SPL.
Regards,
Stefano
--
=====================================================================
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
=====================================================================
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [v3] arm: Fixed the offset for the no relocation.
2012-09-05 19:22 ` Stefano Babic
@ 2012-09-06 15:36 ` Zhong Hongbo
0 siblings, 0 replies; 8+ messages in thread
From: Zhong Hongbo @ 2012-09-06 15:36 UTC (permalink / raw)
To: u-boot
On 06/09/12 03:22, Stefano Babic wrote:
> On 05/09/2012 16:45, Zhong Hongbo wrote:
>> On 04/09/12 23:57, Stefano Babic wrote:
>>> On 04/09/2012 16:03, Zhong Hongbo wrote:
>>>> On 03/09/12 08:14, Marek Vasut wrote:
>>>>> Dear Zhong Hongbo,
>>>>>
>>>>>> From: Zhong Hongbo <bocui107@gmail.com>
>>>>>>
>>>>>> 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, r9
>>>>
>>>> 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 ?
>> Hi Stefano,
>>
>> That is enough for my smdk6400 board.
>
>
Hi Stefano,
> Ok, thanks. Then I will post a patch on top of yours, but here my:
>
> Tested-by: Stefano Babic <sbabic@denx.de>
>
> Tested on a i.MX35 board (ARM1136) with SPL.
Ok, Thanks,
BR,
hongbo
>
> Regards,
> Stefano
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-09-06 15:36 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-02 6:49 [U-Boot] [v3] arm: Fixed the offset for the no relocation Zhong Hongbo
2012-09-02 6:52 ` Zhong Hongbo
2012-09-03 0:14 ` Marek Vasut
2012-09-04 14:03 ` Zhong Hongbo
2012-09-04 15:57 ` Stefano Babic
2012-09-05 14:45 ` Zhong Hongbo
2012-09-05 19:22 ` Stefano Babic
2012-09-06 15:36 ` Zhong Hongbo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox