From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Fri, 01 Oct 2010 08:57:41 +0200 Subject: [U-Boot] ARM relocation, probably trivial mistake In-Reply-To: <4CA5821E.3070108@emk-elektronik.de> References: <4CA49746.2050301@emk-elektronik.de> <4CA4AEFF.3050101@denx.de> <20100930174308.070ECD2B48C@gemini.denx.de> <4CA570D3.9040406@denx.de> <4CA57468.6090702@free.fr> <4CA57762.3000201@denx.de> <4CA5821E.3070108@emk-elektronik.de> Message-ID: <4CA58665.8080309@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Reinhard, Reinhard Meyer wrote: > Dear Heiko Schocher, > >>>>> In message<4CA4AEFF.3050101@denx.de> you wrote: >>>>>> If TEXT_BASE == relocation address it could be defined, >>>>>> never tested. > > If I think right, relocation address would vary with u-boot size, > so there seems no really reliable way to ensure above "if" is true. > Even worse, when it happens to become untrue because the size > changed, it will try to relocate overlapping areas. Yes, true, but you can with each release try your u-boot, and eventually fix it ... >>> 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" ?? admitted, just a good idea for boards where ramsize is always fix ... >> 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 ;) Yep. Idea behind my "intended location == relocation address" is to save one copy of u-boot (one from the preloader and one from relocation) ... but this is not a need for all boards, this is something a board maintainer can decide and use (for example, if speed is a critical point) ... bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany