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] Avoiding Relocation on ARM When Earlier Bootloader Inits RAM?
Date: Mon, 14 Feb 2011 19:07:29 +0100	[thread overview]
Message-ID: <4D596F61.8080307@free.fr> (raw)
In-Reply-To: <loom.20110214T175951-507@post.gmane.org>

Hi Tim,

Le 14/02/2011 18:01, Tim Kryger a ?crit :
> Hello,
>
> 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
> 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
> 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.
>
> Thanks,
> Tim Kryger

What you are looking for requires that the bootloader compute where 
U-Boot should end up in RAM, just like U-Boot would compute it too. It 
certainly is not easy, possibly even impossible due to run-time memory 
allocation from top of RAM before the U-boot location is computed.

Note that even if you can compute the address, you would save a copy, 
but you would still need to go through the relocation code, which takes 
a while too.

Besides, loading U-boot at the lowest location then relocating up is 
doing precisely what the feature is supposed to do: have a single U-Boot 
binary able to run on variants of a board with different amounts of RAM. 
Preloading at a fixed address would defeat the idea.

Amicalement,
-- 
Albert.

  reply	other threads:[~2011-02-14 18:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14 17:01 [U-Boot] Avoiding Relocation on ARM When Earlier Bootloader Inits RAM? Tim Kryger
2011-02-14 18:07 ` Albert ARIBAUD [this message]
2011-02-14 19:59   ` Tim Kryger
2011-02-14 18:21 ` Wolfgang Denk
2011-02-14 19:51   ` Tim Kryger
2011-02-14 21:22     ` Wolfgang Denk
2011-02-14 22:22       ` Tim Kryger

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=4D596F61.8080307@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.