public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC] Multiple binaries per U-Boot target (was: Separately compile Master boot loader)
Date: Thu, 11 Jul 2013 11:11:02 +0200	[thread overview]
Message-ID: <20130711111102.48fc47a7@lilith> (raw)
In-Reply-To: <20130711103507.48bd224f@lilith>

On Thu, 11 Jul 2013 10:35:07 +0200, Albert ARIBAUD
<albert.u.boot@aribaud.net> wrote:

> [...] nor is there currently a way to build several U-Boots in one go.

Although, with recent proposals like the TPL one:

http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/164432

... I am toying with the idea of a more generic build mechanism which
would allow a target to specify as many binaries as it needs, each with
its own configuration.

The simplest targets would have a single build (U-boot itself).

SPL-type targets would have two (SPL and U-Boot).

TPL-like ones would have three (SPL, TPL and U-boot).

Etc.

A developer could then choose to build the default binaries or a
specific set, e.g. only rebuild U-boot for targets whose SPL needs not
change.

For maximum reuse, U-boot would have to be a set of components (and
that's what it is right now, and would be all the more with Kconfig)
and each 'binary' would be a selection of which components. Examples of
components would be:

- startup (mandatory component which contains the entry point);

- setup (optional component which would set up the system incl. DDR);

- relocation (optional component which moves the code up in DDR);

- console (optional component which allows interactive commands);

- chainload (optional component which allows chainloading another
  binary);

Etc. Of course there would be components for architecture support
(PPC, ARM, MIPS, x86)..., for CPU [class] support, for driver support,
for function support).

The interest of this idea would be that SPL and U-Boot would not be
distinguished by #ifs across the code, but only by their respective
configurations. We'd have a clear view and control in a single place
(the configuration header file) of what goes in SPL and what goes in
U-Boot (and what goes in TPL).

To be clearer on configurations and header files: my idea would be to
put SPL configuration under a single '#if CONFIG_BUILDING_SPL'-like
conditional, and U-Boot configuration under #if CONFIG_BUILDING_UBOOT,
and that SPL related configuration options either be replaced by their
general equivalents (for instance, no need for CONFIG_SPL_I2C_SUPPORT
if the SPL configuration includes some CONFIG_I2C_somedriver) or turned
into a component option (e.g. CONFIG_SPL_MAX_FOOTPRINT becoming option
CONFIG_SIZECHECK_MAX_FOOTPRINT).

I don't think this would require overhauling the whole of U-Boot; nor
should all be done in one go. We could independently:

- make sure SPL, U-Boot and TPL are independent sub-targets which can
  be built separately from the command line if needed, with a sane
  default for existing targets;

- progressively replace CONFIG_SPL_xxx options with equivalent
  CONFIG_SYS_xxx ones or move them into new "components" such as
  "sizecheck" or "chainload".

I realize I'm drawing a very rough picture here...

Comments/Criticisms welcome.

Amicalement,
-- 
Albert.

  reply	other threads:[~2013-07-11  9:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 10:42 [U-Boot] Separately compile Master boot loader Rajdeep Vaghasia
2013-07-09 12:01 ` Albert ARIBAUD
2013-07-10  9:34 ` Rajdeep Vaghasia
2013-07-10 12:23   ` Albert ARIBAUD
2013-07-11  5:27     ` Rajdeep Vaghasia
2013-07-11  8:35       ` Albert ARIBAUD
2013-07-11  9:11         ` Albert ARIBAUD [this message]
2013-07-19 15:27           ` [U-Boot] [RFC] Multiple binaries per U-Boot target Sascha Silbe
2013-07-19 16:53             ` Simon Glass
2013-07-19 18:12               ` Albert ARIBAUD
2013-07-19 18:14                 ` Simon Glass
2013-07-19 19:27                 ` Wolfgang Denk
2013-07-19 21:09                   ` Albert ARIBAUD
2013-07-19 22:32                     ` Wolfgang Denk
2013-07-20  7:15                       ` Albert ARIBAUD
2013-07-19 19:26             ` Wolfgang Denk
2013-07-11 10:08         ` [U-Boot] Separately compile Master boot loader Wolfgang Denk
2013-07-11 10:25           ` Albert ARIBAUD
2013-07-11  9:58       ` Wolfgang Denk

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=20130711111102.48fc47a7@lilith \
    --to=albert.u.boot@aribaud.net \
    --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