From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm1176: fix relocation
Date: Mon, 25 Oct 2010 09:11:22 +0200 [thread overview]
Message-ID: <4CC52D9A.3090507@denx.de> (raw)
In-Reply-To: <4CC49593.9010106@gmail.com>
Hello Darius,
Darius Augulis wrote:
> On 10/24/2010 11:08 PM, Darius Augulis wrote:
>> Fix relocation code for arm1176, do it like other ARM
>> CPU's are doing.
>> Tested only with CONFIG_SKIP_RELOCATE_UBOOT defined
>> and using nand_spl (booting from nand). Test done on
>> s3c6410 based board (not yet supported in main line).
>>
>> Signed-off-by: Darius Augulis<augulis.darius@gmail.com>
>> ---
>> arch/arm/cpu/arm1176/start.S | 139 +++++++++++++++++++++++----------------
>> arch/arm/cpu/arm1176/u-boot.lds | 15 +++-
>> 2 files changed, 94 insertions(+), 60 deletions(-)
>>
>> diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
>> index 24e5bf4..0d733f7 100644
>> --- a/arch/arm/cpu/arm1176/start.S
>> +++ b/arch/arm/cpu/arm1176/start.S
[...]
>> @@ -377,10 +402,9 @@ clbss_l:str r2, [r0] /* clear loop... */
>>
>> _nand_boot: .word nand_boot
>> #else
>> - ldr r0, _TEXT_BASE
>> - ldr r2, _board_init_r
>> - sub r2, r2, r0
>> - add r2, r2, r7 /* position from board_init_r in RAM */
>> + ldr r0, _board_init_r_ofs
>> + adr r1, _start
>> + add r2, r0, r1
>
> RFC:
> I've observed that other ARM CPU's are adding r9 to lr here (add lr,
> r0, r9). Even though r9 is not pre-loaded with any value in case
> CONFIG_SKIP_RELOCATE_UBOOT is defined. Is it bug or not?
> Maybe it's not tested without CONFIG_SKIP_RELOCATE_UBOOT?
> I've removed this line because uboot stops booting if it's there.
> Any comments about it?
Yep, thats a Bug, thanks for detecting this.
But your fix seems to me, is not working for the case if
CONFIG_SKIP_RELOCATE_UBOOT is !defined, because then you need this
update of the lr register ... so could you please add this line
with a "#if !defined(CONFIG_SKIP_RELOCATE_UBOOT)" ... "#endif"
around it? (And maybe fix all other arm start.S files too?)
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2010-10-25 7:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-24 20:08 [U-Boot] [PATCH] arm1176: fix relocation Darius Augulis
2010-10-24 20:22 ` Darius Augulis
2010-10-25 7:11 ` Heiko Schocher [this message]
2010-10-25 7:47 ` Darius Augulis
2010-10-25 6:17 ` Heiko Schocher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CC52D9A.3090507@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox