[U-Boot] [RFC] arm926ejs: fix jump to RAM nand_boot

Albert ARIBAUD
2010-11-02T09:47:49Z

Le 02/11/2010 10:38, Wolfgang Denk a ?crit :
> Dear Reinhard Meyer,
>
> In message<4CCFD27E.3080500@emk-elektronik.de> you wrote:
>>
>> I would recommend that we add code to check for overlapping relocation into
>> board.c and print a panic message if an overlap is detected.
>
> Why should we try to detect a problem when we can as well avoid the
> problem?
>
> The needed image isze if known when we build the image, we just have
> to use it instead of manually defining a constant value.

These is a valid point that the SPL isn't necessarily rebuilt and
flashed every time u-boot itself is built and flashed, so whatever
constant the SPL would carry would only be valid for the u-boot that was
built alongside.

Now a solution would be that the actual u-boot size be flashed along
with it, for instance as a literal defined as '.word _end - _start'
right after the vectors. The SPL could load a first NAND block, read the
literal, round it to a multiple of NAND blocks by default, and then read
this quantity.

That would remove the dependency at the cost of extra code in the SPL,
though, and not all boards might be able to afford it.

> Best regards,
>
> Wolfgang Denk

Amicalement,
--
Albert.