[U-Boot] [RFC] [PATCH] arm: arm926ejs: use ELF relocations

Graeme Russ graeme.russ at gmail.com
Tue Oct 5 07:42:01 CEST 2010


On Tue, Oct 5, 2010 at 4:40 PM, Graeme Russ <graeme.russ at gmail.com> wrote:
> On Tue, Oct 5, 2010 at 4:34 PM, Wolfgang Denk <wd at denx.de> wrote:
>> Dear Graeme Russ,
>>
>> In message <AANLkTikqE0_DEqHs-tX3A4XuEXJhM0CYW_+j6izhmktw at mail.gmail.com> you wrote:
>>>
>>> Can NAND SPL initialise and size memory before loading U-Boot into RAM?
>>
>> It has to. You cannot load into and run from uninitialized RAM ;-)
>>
>>> If so, could the relocation code be added to NAND SPL so only one copy
>>> operation is performed?
>>
>> I'm afraid it cannot, due to size limitations. The NAND loader often
>> hast to fit into as little a 2 or 4 KiB...
>>
>
> For x86, the actual relocation calculations can be done in a probably a
> few dozen bytes of code. It contains:
>
>  - One offset calculation
>  - A single tight loop
>  - Two comparisons (probably not needed in the generic case as they are used
>   to filter out x86 specific code outside .text)
>  - An offset addition
>
> If the only constraint is space then it _may_ be possible in some scenarios
> (although I do acknowledge that previous trival changes have caused the
> size constaint to be violated)
>

Another alternative is to load into upper memory and have the relocation
code detect that U-Boot is already there and skip the copy operation

Regards,

Graeme


More information about the U-Boot mailing list