From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Wed, 05 Sep 2012 21:22:01 +0200 Subject: [U-Boot] [v3] arm: Fixed the offset for the no relocation. In-Reply-To: <5047658A.8040501@gmail.com> References: <1346568592-6832-1-git-send-email-bocui107@gmail.com> <201209030214.32639.marek.vasut@gmail.com> <50460A1B.9040102@gmail.com> <50462502.6050203@denx.de> <5047658A.8040501@gmail.com> Message-ID: <5047A659.20405@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 On 05/09/2012 16:45, Zhong Hongbo wrote: > On 04/09/12 23:57, Stefano Babic wrote: >> On 04/09/2012 16:03, Zhong Hongbo wrote: >>> On 03/09/12 08:14, Marek Vasut wrote: >>>> Dear Zhong Hongbo, >>>> >>>>> From: Zhong Hongbo >>>>> >>>>> When the u-boot address of destination equal to __start, >>>>> no relocation. relocation offset(r9) = 0. >>>> >>>> Good, now what kind of issue does this patch fix? >>> Hi Marek >>> >>> When you adopt CONFIG_SPL_BUILD framework, no CONFIG_NAND_SPL, if the >>> addr of destination is equal to _start, we should skip u-boot relocation. >>> >>> In the last, u-boot will count the dest addr, see the below: >>> >>> >>> adr r1, _start >>> add lr, r0, r1 >>> add lr, lr, r9 >>> >>> Here, lr = lr + r9, r9 is the offset of u-boot, So when it do not neet >>> to reolocat, we need to set the zero value for r9 register. >>> >>> /* setup parameters for board_init_r */ >>> mov r0, r5 /* gd_t */ >>> mov r1, r6 /* dest_addr */ >>> /* jump to it ... */ >>> mov pc, lr >> >> I can confirm this issue - I see this when I ported SPL to a MX35 board. >> However, clearing r9 was not enough. I had to fix also _rel_dyn_* to >> make SPL working, and I did changing the start.S in the same way start.S >> for arv7 is built. >> >> Do you not have these issues ? > Hi Stefano, > > That is enough for my smdk6400 board. Ok, thanks. Then I will post a patch on top of yours, but here my: Tested-by: Stefano Babic Tested on a i.MX35 board (ARM1136) with SPL. Regards, Stefano -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================