
Dear Heiko Schocher,
In message 4CA57762.3000201@denx.de you wrote:
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 we have to be careful here.
Please keep in mind that the with the new setup the relocation address is not a constant, not even for systems that come with a fixed memroy configuration.
If you enable for example the protected RAM feature, the relocation address will be shifted down by the amount needed for the reserved PRAM area - which is variable, as it can be set through an environment variable.
So assume you have a system with a preloader, and you optimize your configuration to load U-Bot to the "final" position close to the end of the RAM. Not the user defines "setenv pram 128" and reboots. Now U-Boot will try to relocate itself 128 kB down, which pretty reliably causes an overlap.
Eventually we have to detect such situations and relocate twice then?
Best regards,
Wolfgang Denk