linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM:boot:device tree: Allow the device tree binary to be appended to zImage
Date: Sat, 12 Mar 2011 01:44:53 -0700	[thread overview]
Message-ID: <20110312084453.GD9347@angua.secretlab.ca> (raw)
In-Reply-To: <20110309230542.GC9995@trinity.fluff.org>

On Wed, Mar 09, 2011 at 11:05:42PM +0000, Ben Dooks wrote:
> On Wed, Mar 09, 2011 at 01:58:00PM -0800, John Bonesio wrote:
> > This patch provides the ability to boot using a device tree that is appended
> > to the raw binary zImage (e.g. cat zImage <filename>.dtb > zImage_w_dtb).
> 
> I'd much rather see something that wrappers the kernel and passes the
> DT through an ATAG. So possibly a pre-amble as well?

When DT support was initially implemented for ARM, it did exactly
that.  It passed the dt via an ATAG.  However, that leaves a number of
questions about which data is authoritative, ATAG or DT data.  Nicolas
argued rightly and successfully that if DT was going to be used, then
we should go at it whole hog and make passing a dtb the full boot
interface.

I disagreed strongly at first, but I'm glad to say he convinced me.
In the end the implementation of passing dt directly turned out to be
far more simple and elegant than the hybrid approach was.  In the
current code, a single kernel image can accept either a .dtb or an
ATAGs list (so no backwards compatibility issues) and it detects which
data structure to parse early in setup_arch().

As for this patch, this functionality was implemented for a client and
it is being posted for wider review in case anyone else finds it
useful.  I wasn't originally planning to push for mainline merging of
it, but after positive feedback on the first posting I though it was
probably worth the effort to refine it more and get it into acceptable
shape for mainline.

Regarding using a wrapper; that was the approach I initially wanted to
pursue, but modifying the zImage wrapper was much simpler to implement
because the wrapper has knowledge about how much RAM the kernel needs
at boot and can therefore make a good decision about where to locate
the .dtb before jumping into the kernel.

g.

  reply	other threads:[~2011-03-12  8:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-09 21:58 [PATCH] ARM:boot:device tree: Allow the device tree binary to be appended to zImage John Bonesio
2011-03-09 23:05 ` Ben Dooks
2011-03-12  8:44   ` Grant Likely [this message]
2011-03-15  3:44 ` Shawn Guo
2011-03-15  7:52   ` Shawn Guo
2011-03-15  8:03     ` Grant Likely
2011-03-17 18:42 ` Nicolas Pitre
2011-03-21 17:35   ` John Bonesio
2011-03-21 18:22     ` Nicolas Pitre
2011-03-21 18:36       ` John Bonesio

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=20110312084453.GD9347@angua.secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).