From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Mon, 14 Feb 2011 19:21:43 +0100 Subject: [U-Boot] Avoiding Relocation on ARM When Earlier Bootloader Inits RAM? In-Reply-To: References: Message-ID: <20110214182143.3819A1539C5@gemini.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 Dear Tim Kryger, In message you wrote: > > After looking at code, searching the mailing list archive, and reviewing the git > commit log, I now understand that for ARM relocation is performed unless U-Boot > is already running at its final destination as computed within board_init_f. > Since this computation attempts to back off from the end of RAM the resulting > address varies when U-Boot changes size. On my board I have an earlier It varies not only then. It may also vary when you are for example using features like protected RAm or frame buffers with adjustable resolution / color depth. Then the location in RAM may even depend on settings of environment variables, i. e. it can change dynamically from boot to boot. > bootloader that initializes RAM. Presently, it copies U-Boot near the start of > RAM and lets U-Boot relocate itself to the end. This is inefficient and I would This is only the case when booting from NAND; it does not apply for example when booting from NOR flash. > like to eliminate the extra copy. I suspect that my situation is not unique and > would be grateful to anyone willing to share their thoughts or experiences on > how best to deal with this. There are situation where the memory map is fixed and doesn;t change - then you can U-Boot load to it's final location, and no second copy is needed. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de In general, they do what you want, unless you want consistency. - Larry Wall in the perl man page