From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Fri, 4 Sep 2015 15:59:43 +0200 Subject: [U-Boot] [PATCH v2 4/8] nios2: enlarge the code relocation range In-Reply-To: <1441369343-4638-5-git-send-email-thomas@wytron.com.tw> References: <1441336526-23505-1-git-send-email-thomas@wytron.com.tw> <1441369343-4638-1-git-send-email-thomas@wytron.com.tw> <1441369343-4638-5-git-send-email-thomas@wytron.com.tw> Message-ID: <201509041559.43604.marex@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 Friday, September 04, 2015 at 02:22:19 PM, Thomas Chou wrote: > As we will use u-boot-dtb.bin, the code relocation range > should be adjusted to accommodate the additional dtb. > It might be overkilled to look into dtb header to find the > dtb size, so we will simply use CONFIG_SYS_MONITOR_LEN. > > Signed-off-by: Thomas Chou > --- > arch/nios2/cpu/start.S | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S > index 971bde8..0b16633 100644 > --- a/arch/nios2/cpu/start.S > +++ b/arch/nios2/cpu/start.S > @@ -73,8 +73,9 @@ _cur: movhi r5, %hi(_cur - _start) > ori r5, r5, %lo(_start) /* r5 <- linked _start */ > beq r4, r5, 3f > > - movhi r6, %hi(_edata) > - ori r6, r6, %lo(_edata) > + movhi r6, %hi(CONFIG_SYS_MONITOR_LEN) > + ori r6, r6, %lo(CONFIG_SYS_MONITOR_LEN) > + add r6, r6, r5 > 2: ldwio r7, 0(r4) > addi r4, r4, 4 > stwio r7, 0(r5) Can't you just call relocate_code the same way arm does it in arch/arm/lib/crt0.S ? Best regards, Marek Vasut