From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] Use LINK_OFF to access global data
Date: Sun, 03 Jan 2010 21:06:51 +0100 [thread overview]
Message-ID: <4B40F8DB.1090509@free.fr> (raw)
In-Reply-To: <20100103195153.558C4EF5FF5@gemini.denx.de>
Wolfgang Denk a ?crit :
> I think as follows:
>
> In the past, the majority of systems supported by U-Boot where
> booting from NOR flash or other memory devices. This made it easy to
> use common code (like library functions) both before and after
> relocation to the final location in RAM. For your current changes
> this means that we have a large number of places where we have to add
> this LINK_OFF stuff. This makes the code harder to read, much harder
> to understand (especially if it's not working during the initial
> bringup on new hardware), and harder to debug in general.
>
> If I try to see trends in the development of U-Boot I notice a
> growing number of systems that boot from NAND flash, DataFlash or
> that come with on-chip ROM code to load images from SDCard and other
> storage media. Such systems cannot make real benefit from the
> original design of U-Boot, as here U-Boot is inherently a
> second-stage boot loader which gets loaded by some other means. Even
> for NAND booting systems where we have the NAND boot code included
> within the U-Boot source tree we often cannot share much of the code
> between the primary and the secondary loader stages as there are
> usually tight restrictions on the maximum size for the primary loader
> image. Here a sharper separation of "primary" and "secondary" boot
> code within U-Boot would be benefical.
>
> I feel (but this is really just a feeling, and I definitely would like
> to hear what others think about this!) your PIC changes would be (or
> have been) useful for the former usage mode, but they come at a pretty
> heavy cost as they are really invasive to the code. For the second
> usage mode they are not usable, or at least not useful. This makes me
> wonder if we really should continue to work in this direction.
>
> Comments welcome...
>
> Best regards,
>
> Wolfgang Denk
Hmm... PIC is interesting only if you want the same binary to run from
two places, like NOR then RAM, which is the case when U-boot is the code
which gets run in NOR at power-up and ends up running in RAM later.
For NAND-based boards, the NAND bootloader will load U-boot to RAM, and
U-boot will never run from anywhere else but its intended RAM location.
Why not make the same two-stage separation systematic, even on NOR-based
devices and others where U-boot is currently the one executed at
power-up? Split the current U-boot into a small primary bootloader (U1?)
and a fuller secondary bootloader (U2?). U1 would initialize RAM (and a
console?) and U2 would initialize everything else. Each stage would only
run from a fixed location and type of memory, removing the need for PIC.
Comment given off the top of my head, so feel free to open fire. :)
Amicalement,
--
Albert.
next prev parent reply other threads:[~2010-01-03 20:06 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-30 15:08 [U-Boot] [PATCH 0/4] Make u-boot true PIC for ppc Joakim Tjernlund
2009-12-30 15:08 ` [U-Boot] [PATCH 1/4] ppc: Add const void *link_off(const void *addr) Joakim Tjernlund
2009-12-30 15:08 ` [U-Boot] [PATCH 2/4] Use LINK_OFF to access global data Joakim Tjernlund
2009-12-30 15:08 ` [U-Boot] [PATCH 3/4] Use LINK_OFF in enviroment too Joakim Tjernlund
2009-12-30 15:08 ` [U-Boot] [PATCH 4/4] ppc: Make mpc83xx start.S relative Joakim Tjernlund
2009-12-31 18:44 ` [U-Boot] [PATCH 2/4] Use LINK_OFF to access global data Mike Frysinger
2010-01-01 1:39 ` Joakim Tjernlund
2010-01-01 6:18 ` Mike Frysinger
2010-01-01 16:29 ` Joakim Tjernlund
2010-01-02 3:14 ` Mike Frysinger
2010-01-02 18:17 ` Wolfgang Denk
2010-01-03 10:48 ` Joakim Tjernlund
2010-01-02 18:13 ` Wolfgang Denk
2010-01-03 10:33 ` Joakim Tjernlund
2010-01-03 19:51 ` Wolfgang Denk
2010-01-03 20:06 ` Albert ARIBAUD [this message]
2010-01-03 20:17 ` Wolfgang Denk
2010-01-03 20:41 ` Albert ARIBAUD
2010-01-03 21:07 ` Wolfgang Denk
2010-01-04 6:54 ` Albert ARIBAUD
2010-01-03 22:29 ` Graeme Russ
2010-01-05 20:20 ` Scott Wood
2010-01-05 22:11 ` Joakim Tjernlund
2010-01-06 21:02 ` Scott Wood
2010-01-04 1:08 ` Joakim Tjernlund
2010-01-05 0:40 ` Mike Frysinger
-- strict thread matches above, loose matches on Subject: below --
2009-11-02 18:01 [U-Boot] [PATCH 0/4] Make u-boot true PIC for ppc Joakim Tjernlund
2009-11-02 18:01 ` [U-Boot] [PATCH 1/4] ppc: Add const void *link_off(const void *addr) Joakim Tjernlund
2009-11-02 18:01 ` [U-Boot] [PATCH 2/4] Use LINK_OFF to access global data Joakim Tjernlund
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=4B40F8DB.1090509@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox