public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "José Miguel Gonçalves" <jose.goncalves@inov.pt>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 01/11] ARM: fix relocation on ARM926EJS
Date: Mon, 17 Sep 2012 10:20:07 +0100	[thread overview]
Message-ID: <5056EB47.8030203@inov.pt> (raw)
In-Reply-To: <CABkLObr6=FcH7G+2izodDB0Ke+=fUQiRWWCakjeLqJc7GMRpzA@mail.gmail.com>

Hi Christian,

On 09/17/2012 10:03 AM, Christian Riesch wrote:
> Hi,
>
> On Mon, Sep 17, 2012 at 10:34 AM, Jos? Miguel Gon?alves
> <jose.goncalves@inov.pt> wrote:
>> On 09/17/2012 07:28 AM, Christian Riesch wrote:
>>> Hi,
>>>
>>> On Sun, Sep 16, 2012 at 5:36 PM, Marek Vasut <marex@denx.de> wrote:
>>>> Dear Jos? Miguel Gon?alves,
>>>>
>>>>> On 09/16/2012 11:06 AM, Marek Vasut wrote:
>>>>>> Dear Jos? Miguel Gon?alves,
>>>>>>
>>>>>>> On 09/15/2012 07:03 PM, Marek Vasut wrote:
>>>>>>>> Dear Jos? Miguel Gon?alves,
>>>>>>>>
>>>>>>>>> Jumping to board_init_r is not performed due to a bug on address
>>>>>>>>> computation.
>>>>>>>> Is your CONFIG_SYS_TEXT_BASE configured correctly? I don't detect any
>>>>>>>> misbehavior on my arm926 boards.
>>>>>>> Maybe because you are not using it to build an SPL?
>>>>>> I do ... and I use CONFIG_SPL_TEXT_BASE properly .
>>>>>>> Please check the same chunk of code in other start.S for arm1176 and
>>>>>>> armv7. They have the same code that I put for arm926ejs.
>>>>>> Please wait and please first explain what is the issue.
>>>>> The issue is what I've explained in the patch comments.
>>>> "Jumping to board_init_r is not performed due to a bug on address
>>>> computation."
>>>>
>>>> Ok, I don't know how to replicate the bug from this comment or what
>>>> effects it
>>>> causes or ... well, anything. So please, try to be more elaborate in your
>>>> patch
>>>> description next time. Anyway ..
>>> Same for me - I have no idea what you are trying to fix here. In my
>>> SPL configuration, _TEXT_BASE and _start point to the same location,
>>> so please explain why they are different on your board.
>>
>> They are different because of how start.S is implemented in arm926ejs.
>>
>> In my SPL map file I see:
>>
>> .text           0x0000000000000000      0xc24
>>   arch/arm/cpu/arm926ejs/start.o(.text)
>>   .text          0x0000000000000000      0x120 arch/arm/cpu/arm926ejs/start.o
>>                  0x0000000000000000                _start
>>                  0x0000000000000040                _TEXT_BASE
>>                  0x0000000000000044                _bss_start_ofs
>>                  0x0000000000000048                _bss_end_ofs
>>                  0x000000000000004c                _end_ofs
>>                  0x0000000000000050                IRQ_STACK_START_IN
>>                  0x0000000000000074                relocate_code
> So _start is 0x00000000, and in your
> config/include/include/configs/mini2416.h you have
>
> #define CONFIG_SPL_TEXT_BASE           0x00000000
>
> and in arch/arm/cpu/arm926ejs/start.S we have
>
> .globl _TEXT_BASE
> _TEXT_BASE:
> #ifdef CONFIG_NAND_SPL /* deprecated, use instead CONFIG_SPL_BUILD */
>          .word   CONFIG_SYS_TEXT_BASE
> #else
> #ifdef CONFIG_SPL_BUILD
>          .word   CONFIG_SPL_TEXT_BASE
> #else
>          .word   CONFIG_SYS_TEXT_BASE
> #endif
> #endif
>
> So
>
> ldr     r1, _TEXT_BASE
>
> should be the same as
>
> adr     r1, _start
>
> However, if you do not load your SPL to 0x00000000 but to another
> address and execute it from there, it will be different, since adr
> uses relative adressing, right? Are you sure you are loading it to
> 0x00000000?

Not an expert on ARM assembly, so cannot give any feedback on the 
differences between adr and ldr mnemonics.

What I know for a fact is that the S3C2416, when booting from it's 
internal ROM, makes a copy of the first 8KB of the NAND flash to an 
internal RAM (named SteppingStone), maps it at address 0 and the jumps 
to the start of it. This mapping is not clear in Samsung's user manual 
but I retrieved that information from here:

http://barebox.org/documentation/barebox-2011.05.0/dev_s3c24xx_arch.html

>
> Regards, Christian
>
>>
>>
>>>>> Without this
>>>>> change the code never reaches board_init_r in the SPL and I think I have
>>>>> all the configurations correctly set.
>>>> I wonder why you'd ever want to reach board_init_r in the SPL. SPL is
>>>> there only
>>>> to load the real U-Boot from whatever media, so you usually use either
>>>> NAND SPL
>>>> or something like that.
>>>>
>>> Marek, going into board_init_r is fine for SPL, for example the
>>> davinci SPL does some hw initialization in board_init_f and then loads
>>> u-boot in board_init_r.
>>> Regards, Christian
>>>
>>>> What do you boot the rest from ?
>>>>
>>>>> If the bug is not from here please
>>>>> suggest me what I need to change in the configuration in order to
>>>>> correctly boot my board.
>>>>>
>>>>>>>>> Relocation offsets are not needed when building SPL.
>>>>>>>> Do they cause any trouble?
>>>>>>> No! Just not needed.
>>>>>>>
>>>>>>>>> Signed-off-by: Jos? Miguel Gon?alves <jose.goncalves@inov.pt>
>>>>>>>>> ---
>>>>>>>>>
>>>>>>>>> Changes for v2:
>>>>>>>>>        - None
>>>>>>>>>
>>>>>>>>> ---
>>>>>>>>>
>>>>>>>>>      arch/arm/cpu/arm926ejs/start.S |    4 +++-
>>>>>>>>>      1 file changed, 3 insertions(+), 1 deletion(-)
>>>>>>>>>
>>>>>>>>> diff --git a/arch/arm/cpu/arm926ejs/start.S
>>>>>>>>> b/arch/arm/cpu/arm926ejs/start.S index 6f05f1a..2da5342 100644
>>>>>>>>> --- a/arch/arm/cpu/arm926ejs/start.S
>>>>>>>>> +++ b/arch/arm/cpu/arm926ejs/start.S
>>>>>>>>>
>>>>>>>>> @@ -325,7 +325,7 @@ _nand_boot_ofs:
>>>>>>>>>            .word nand_boot
>>>>>>>>>
>>>>>>>>>      #else
>>>>>>>>>
>>>>>>>>>            ldr     r0, _board_init_r_ofs
>>>>>>>>>
>>>>>>>>> -        ldr     r1, _TEXT_BASE
>>>>>>>>> +        adr     r1, _start
>>>>>>>>>
>>>>>>>>>            add     lr, r0, r1
>>>>>>>>>            add     lr, lr, r9
>>>>>>>>>            /* setup parameters for board_init_r */
>>>>>>>>>
>>>>>>>>> @@ -338,12 +338,14 @@ _board_init_r_ofs:
>>>>>>>>>            .word board_init_r - _start
>>>>>>>>>
>>>>>>>>>      #endif
>>>>>>>>>
>>>>>>>>> +#ifndef CONFIG_SPL_BUILD
>>>>>>>>>
>>>>>>>>>      _rel_dyn_start_ofs:
>>>>>>>>>            .word __rel_dyn_start - _start
>>>>>>>>>
>>>>>>>>>      _rel_dyn_end_ofs:
>>>>>>>>>            .word __rel_dyn_end - _start
>>>>>>>>>
>>>>>>>>>      _dynsym_start_ofs:
>>>>>>>>>            .word __dynsym_start - _start
>>>>>>>>>
>>>>>>>>> +#endif
>>>>>>>>>
>>>>>>>>>      /*
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ******************************************************************
>>>>>>>>>       *** ****
>>>>>>>> Best regards,
>>>>>>>> Marek Vasut
>>>>>>> Best regards,
>>>>>>> Jos? Gon?alves
>>>>>> Best regards,
>>>>>> Marek Vasut
>>>>> Best regards,
>>>>> Jos? Gon?alves
>>
>> Best regards,
>> Jos? Gon?alves
>

Best regards,
Jos? Gon?alves

  reply	other threads:[~2012-09-17  9:20 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-14 17:28 [U-Boot] [PATCH v2 00/11] S3C24XX: Add support to MINI2416 board José Miguel Gonçalves
2012-09-14 17:28 ` [U-Boot] [PATCH v2 01/11] ARM: fix relocation on ARM926EJS José Miguel Gonçalves
2012-09-15 18:03   ` Marek Vasut
2012-09-16  9:45     ` José Miguel Gonçalves
2012-09-16 10:06       ` Marek Vasut
2012-09-16 10:16         ` José Miguel Gonçalves
2012-09-16 15:36           ` Marek Vasut
2012-09-16 16:26             ` José Miguel Gonçalves
2012-09-16 17:17               ` Marek Vasut
2012-09-17  6:28             ` Christian Riesch
2012-09-17  8:34               ` José Miguel Gonçalves
2012-09-17  9:03                 ` Christian Riesch
2012-09-17  9:20                   ` José Miguel Gonçalves [this message]
2012-09-17 17:18             ` Tom Rini
2012-09-17 17:23               ` Scott Wood
2012-09-17 17:32                 ` Tom Rini
2012-09-17 17:26               ` Marek Vasut
2012-09-17 17:35                 ` Tom Rini
2012-09-17 17:48                   ` Marek Vasut
2012-09-17 18:00                     ` Tom Rini
2012-09-17 17:27               ` José Miguel Gonçalves
2012-10-04 14:24   ` Albert ARIBAUD
2012-09-14 17:28 ` [U-Boot] [PATCH v2 02/11] S3C24XX: Add core support for Samsung's S3C24XX SoCs José Miguel Gonçalves
2012-09-14 18:03   ` Marek Vasut
     [not found]     ` <505375E3.6050005@inov.pt>
2012-09-14 18:25       ` Marek Vasut
2012-09-14 19:01         ` Scott Wood
2012-09-14 19:07           ` Marek Vasut
2012-09-14 19:17             ` Scott Wood
2012-09-14 18:39   ` Tom Rini
2012-09-14 17:28 ` [U-Boot] [PATCH v2 03/11] serial: Add support to 4 ports in serial_s3c24x0 José Miguel Gonçalves
2012-09-14 17:28 ` [U-Boot] [PATCH v2 04/11] serial: Use a more precise baud rate generation for serial_s3c24x0 José Miguel Gonçalves
2012-09-14 18:05   ` Marek Vasut
2012-09-14 17:28 ` [U-Boot] [PATCH v2 05/11] serial: Remove unnecessary delay in serial_s3c24x0 José Miguel Gonçalves
2012-09-14 18:05   ` Marek Vasut
2012-09-14 17:28 ` [U-Boot] [PATCH v2 06/11] rtc: Improve rtc_get() on s3c24x0_rtc José Miguel Gonçalves
2012-09-14 18:06   ` Marek Vasut
2012-09-14 17:28 ` [U-Boot] [PATCH v2 07/11] rtc: Fix rtc_reset() " José Miguel Gonçalves
2012-09-14 18:07   ` Marek Vasut
2012-09-14 17:28 ` [U-Boot] [PATCH v2 08/11] rtc: Don't allow setting unsuported years " José Miguel Gonçalves
2012-09-14 18:08   ` Marek Vasut
2012-09-14 17:29 ` [U-Boot] [PATCH v2 09/11] S3C24XX: Add NAND Flash driver José Miguel Gonçalves
2012-09-14 18:21   ` Marek Vasut
2012-09-14 18:45     ` José Miguel Gonçalves
2012-09-14 19:01       ` Tom Rini
2012-09-16  9:16         ` José Miguel Gonçalves
2012-09-17 16:57           ` Tom Rini
2012-09-17 17:03             ` Scott Wood
2012-09-17 17:08               ` Tom Rini
2012-09-17 17:13                 ` Scott Wood
2012-09-17 17:08             ` José Miguel Gonçalves
2012-09-17 17:56               ` Tom Rini
2012-09-17 18:05                 ` José Miguel Gonçalves
2012-09-17 18:27                   ` Tom Rini
2012-09-17 18:34                     ` José Miguel Gonçalves
2012-09-17 18:56                       ` Tom Rini
2012-09-14 19:24     ` Scott Wood
2012-09-14 20:20       ` Tom Rini
2012-09-14 20:29         ` Scott Wood
2012-09-17 11:11     ` José Miguel Gonçalves
2012-09-14 18:47   ` Tom Rini
2012-09-14 17:29 ` [U-Boot] [PATCH v2 10/11] Add u-boot-ubl.bin target to the Makefile José Miguel Gonçalves
2012-09-14 18:22   ` Marek Vasut
2012-09-14 19:08   ` Tom Rini
2012-09-16  9:27     ` José Miguel Gonçalves
2012-09-17  6:47       ` Christian Riesch
2012-09-17  8:30         ` José Miguel Gonçalves
2012-09-17  9:10           ` Christian Riesch
2012-09-17  9:24             ` José Miguel Gonçalves
2012-09-17 14:45               ` Tom Rini
2012-09-17 16:29                 ` Marek Vasut
2012-09-17 16:35                   ` Tom Rini
2012-09-17 16:27               ` Scott Wood
2012-09-17 16:51                 ` Tom Rini
2012-09-17 17:32                   ` Scott Wood
2012-09-17 17:53                     ` Tom Rini
2012-09-17 18:16                       ` Scott Wood
2012-09-17 19:52                       ` Wolfgang Denk
2012-09-14 17:29 ` [U-Boot] [PATCH v2 11/11] S3C24XX: Add support to MINI2416 board José Miguel Gonçalves
2012-09-14 18:58   ` Tom Rini
2012-09-16  9:11     ` José Miguel Gonçalves
2012-09-17 14:39       ` Tom Rini
2012-09-17 14:47         ` José Miguel Gonçalves
2012-09-17 15:11           ` Tom Rini
2012-09-18 12:11             ` José Miguel Gonçalves

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=5056EB47.8030203@inov.pt \
    --to=jose.goncalves@inov.pt \
    --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