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

Graeme Russ
2010-10-05T05:42:01Z

On Tue, Oct 5, 2010 at 4:40 PM, Graeme Russ <graeme.russ@gmail.com> wrote:
> On Tue, Oct 5, 2010 at 4:34 PM, Wolfgang Denk <wd@denx.de> wrote:
>> Dear Graeme Russ,
>>
>> In message <AANLkTikqE0_DEqHs-tX3A4XuEXJhM0CYW_+j6izhmktw@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