All of lore.kernel.org
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm relocation: Fix calculation of board_init_r
Date: Sat, 05 Feb 2011 08:53:15 +0100	[thread overview]
Message-ID: <4D4D01EB.40600@free.fr> (raw)
In-Reply-To: <1296766349-4695-1-git-send-email-alexander.stein@informatik.tu-chemnitz.de>

Hi Alexander,

Le 03/02/2011 21:52, Alexander Stein a ?crit :
> Signed-off-by: Alexander Stein<alexander.stein@informatik.tu-chemnitz.de>
> ---
> Hello,
>
> I just played a bit with my at91sam9g20ek and tried using a new u-boot.
> So I compiled 656b990daa84bfdd512407ee2e3d2610e305a455 (atmel/wip110202) load
> it into memory using jtag to 0x22000000 while it was linked to 0x20000000.

Side note: loading and starting U-Boot at an address different from the 
one which it was linked for is not currently supported.

> I stepped through the relocation code and at start.S:291 'mov pc, lr' the pc
> gets an invalid address (0x25F81D70 while memory ends at 0x24000000).
> While stepping to start.S:286 some registers have the following contents:
> r0: 00000d70
> r1: 22000000
> r9: 03f81000
> lr: 22000d70
> The content if r0 seems ok, but r1 seems wrong, it should be 0x20000000.
> Indeed r1 should contain the linked address of _start not the address
> relative from the current code.

Correct, since we're trying to find the post-relocation address of 
board_init_r, we should add the relocation offet to its link-time 
address, not run-time address -- the fact that both are the same right 
now is only incidental. Thus:

Applied to u-boot-arm, thanks.

Amicalement,
-- 
Albert.

      reply	other threads:[~2011-02-05  7:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-03 20:52 [U-Boot] [PATCH] arm relocation: Fix calculation of board_init_r Alexander Stein
2011-02-05  7:53 ` Albert ARIBAUD [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D4D01EB.40600@free.fr \
    --to=albert.aribaud@free.fr \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.