All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] U-Boot proper(not SPL) relocate option
Date: Mon, 27 Nov 2017 13:52:36 -0500	[thread overview]
Message-ID: <20171127185236.GL3587@bill-the-cat> (raw)
In-Reply-To: <CAK7LNARc-MUPRmHSiSjtea9X6hpRAe9t9wgdbdfg2DYSEpC4RA@mail.gmail.com>

On Sun, Nov 26, 2017 at 11:16:45PM +0900, Masahiro Yamada wrote:
[snip]
> This discussion should have happened.
> U-Boot boot sequence is crazily inefficient.
> 
> 
> 
> When we talk about "relocation", two things are happening.
> 
>  [1] U-Boot proper copies itself to the very end of DRAM
>  [2] Fix-up the global symbols
> 
> In my opinion, only [2] is useful.
> 
> 
> SPL initializes the DRAM, so it knows the base and size of DRAM.
> SPL should be able to load the U-Boot proper to the final destination.
> So, [1] is unnecessary.

Knowing this final destination isn't necessarily easy in all cases.  One
thing to keep in mind here is that long long ago, U-Boot did not do this
relocation step.  But that was also well before SPL, so some level of
what was made easier with relocation isn't so necessary now.

It's also somewhat of an important safety feature.  We have a lot of
values that get re-used (and sometimes re-based) without sufficient
care.  Take for example where for the longest time nearly everyone on
ARM32 was loading the kernel to.  Having U-Boot automatically end up way
out of the way rather than hoping everyone calculates a good address
that won't get stepped on is important.  It's also one of those things
that will change over time as features get added / changed and our
footprint grows.  We're already fairly often talking about "oops, what
do we do now to keep X into size constraint of $Y storage?".  It'll be
even worse to deal with "oops, adding $X means we need more run-time
space".

All of that said, I'd be happy to see logs showing that we in fact spend
a measurable amount of time in relocation and what we can do about it.

Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171127/32f70783/attachment.sig>

  parent reply	other threads:[~2017-11-27 18:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21  9:33 [U-Boot] U-Boot proper(not SPL) relocate option Kever Yang
2017-11-21 10:29 ` Lukasz Majewski
2017-11-22  1:59   ` Kever Yang
2017-11-22  7:29     ` Chris Packham
2017-11-22  8:47       ` Lukasz Majewski
2017-11-22  8:45     ` Lokesh Vutla
2017-11-22  8:51     ` Lukasz Majewski
2017-11-22 10:27     ` Wolfgang Denk
2017-11-25 22:34       ` Simon Glass
2017-11-25 23:31         ` Dr. Philipp Tomsich
2017-11-26 11:38           ` Simon Glass
2017-11-26 13:44             ` Dr. Philipp Tomsich
2017-11-26 13:49               ` Dr. Philipp Tomsich
2017-11-26 14:16             ` Masahiro Yamada
2017-11-27 13:21               ` Wolfgang Denk
2017-11-29 10:10                 ` Masahiro Yamada
2017-11-27 17:13               ` Simon Glass
2017-11-27 18:53                 ` Tom Rini
2017-11-28  9:53                 ` Lukasz Majewski
2017-11-28 11:30                   ` Peter Robinson
2017-11-29 10:11                 ` Masahiro Yamada
2017-11-29 10:48                   ` Joakim Tjernlund
2017-12-02  3:29                     ` Simon Glass
2017-11-27 18:52               ` Tom Rini [this message]
2017-11-26 14:04 ` Andreas Färber
2017-11-21  9:38 Kever Yang

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=20171127185236.GL3587@bill-the-cat \
    --to=trini@konsulko.com \
    --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.