[U-Boot] ARM relocation, probably trivial mistake

Albert ARIBAUD albert.aribaud at free.fr
Fri Oct 1 09:01:15 CEST 2010


Le 01/10/2010 08:39, Reinhard Meyer a écrit :

>>> Actually CONFIG_SKIP_RELICATE_UBOOT should become unneeded once all
>>> boards which use it are made to support relocation, as the code will
>>> always check if it runs at its intended location and relocate only if
>>> needed.
>
> "intended location" == "relocation address based on ram size" ??

Correct for those boards which support relocation. There are still a few 
which dont, and which still have a fixed "intended location" -- that 
should become less and less prevalent in the coming months.

>> If u-boot starts in RAM, then it is the task from the preloader
>> where it copies u-boot code, and if there is somewhere in IRAM
>> enough room for it, this would be an option. Otherwise it is a
>> problem if relocation results in overlapping source and destination
>> areas ... but you will fast detect this problem, when you see,
>> that u-boot no longer works ;-)
>
> I think it would be safe that a preloader loads u-boot to the very
> bottom of SDRAM. If the SDRAM is not at least double the size of
> u-boot, u-boot needs a diet ;)

If you make a requirement that the preloader put u-boot in the lowest 
possible RAM location, and if you rewrite the relocation code to move 
from end to start of the source and target locations, rather than from 
start to end, then it will work even for RAM sizes only slightly bigger 
than the u-boot size :) (and it will still work in boot-from-NOR cases).

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list