From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aneesh V Date: Fri, 11 Feb 2011 19:19:36 +0530 Subject: [U-Boot] [RFC] ARM: mx31pdk: Use the new relocation scheme In-Reply-To: <4D552F8D.5020200@free.fr> References: <1294836544-24512-1-git-send-email-fabio.estevam@freescale.com> <4D2F004B.9090204@denx.de> <4D309716.4000905@freescale.com> <4D4E8E11.2010906@gmail.com> <4D4FD850.3050800@freescale.com> <4D4FFE09.2090709@denx.de> <4D504CAA.7000302@gmail.com> <4D5178DA.4050401@freescale.com> <4D518280.3010300@denx.de> <4D5198EA.7020703@gmail.com> <4D51A52C.8080002@denx.de> <4D51AC9C.8040908@free.fr> <4D5514BF.2080906@ti.com> <4D552F8D.5020200@free.fr> Message-ID: <4D553E70.60800@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Friday 11 February 2011 06:16 PM, Albert ARIBAUD wrote: [snip...] >>> >>> Note also that there was a recent patch to ARM926's start.S (replacing >>> 'adr r1, _start' with 'ldr r1, _TEXT_BASE' at line 284). The same should >>> be done on arm1136. >> >> Is this going to happen for armv7 too? What is the real reason behind >> this proposal. What is the case when _start is not same as _TEXT_BASE(I >> looked at the archives but couldn't filter out the original discussion >> on this) > > The difference is that _TEXT_BASE always contains the link-time address > of _start, whereas references to _start may contain a different value if > the code is executed somewhere else than at the link-time address. > > /Normally/, u-boot should always execute first at the link-time address > -- that's a base constraint. > > /But/ this change makes it more resilient to out-of-link-time-address > execution, and I want, at some time in the future, to find a way for > u-boot to be able to start anywhere -- within reasonable limits: > anywhere in NOR for a NOR-based U-boot, anywhere in RAM for a RAM-based > U-boot, but I am not talking about a generic, > run-in-RAM-or-NOR-or-anywhere, binary. > > Yet. :) > >> I see a problem with that. _TEXT_BASE is based on >> CONFIG_SYS_TEXT_BASE. In our SPL's case CONFIG_SYS_TEXT_BASE indicates >> the TEXT_BASE for u-boot and *CONFIG_SYS_SPL_TEXT_BASE* indicates the >> TEXT_BASE for SPL. Both are defined and useful in SPL because one is >> used for linking SPL while the other is used while loading u-boot from >> MMC. So, CONFIG_SYS_TEXT_BASE used in the start.S of SPL will not be >> correct. > > The change I indicate is under the #else of a #ifdef CONFIG_NAND_SPL, so > it will not apply to SPL. Does that still cause an issue with armv7? No. It doesn't. I am fine with this change if it applies only to u-boot. br, Aneesh