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 0/3] patches to allow DTB to be appended to the ARM zImage
Date: Sun, 12 Jun 2011 08:57:51 -0600	[thread overview]
Message-ID: <20110612145751.GA4013@ponder.secretlab.ca> (raw)
In-Reply-To: <201106121615.24059.arnd@arndb.de>

On Sun, Jun 12, 2011 at 04:15:23PM +0200, Arnd Bergmann wrote:
> On Sunday 12 June 2011 13:58:20 Russell King - ARM Linux wrote:
> > Exactly my point - I have quite a number of platforms here which will
> > never be able to have a boot loader capable of modifying a DT blob for
> > the kernel.
> > 
> > One of the points of Nicolas' patch set is to allow existing boot loaders
> > to boot kernels where the hardware description is contained in a DT blob
> > encapsulated with the kernel.  That's great but the way things are currently
> > setup, it means that the boot loader does nothing more than loading and
> > executing - and we lose the existing flexibility for the boot loader to
> > pass platform specific information to the kernel.
> > 
> > So, what I'm considering to do is update the boot protocol such that the
> > base address of the DT blob is provided in r3, separately from the ATAG
> > pointer in r2.
> >
> > This means that boot loaders can provide a DT blob (r2 = 0 r3 => DT) or
> > they can provide ATAGs (r2 => atag, r3 = indeterminant).  We can then
> > cater for the situation where we have an ATAG boot loader, but a kernel
> > with an appended DT description (r2 => atag, r3 => DT) and have the ATAG
> > information override the DT for things like memory layout and the command
> > line string.
> 
> But when you have both atag and DT and the atag overrides the DT, that
> means we have incorrect information in the DT, and code might later
> rely on that information.
> 
> IMHO when we allow passing a DT to a kernel while booting from an
> existing boot loader that only knows about atag, the code that loads
> the DT should be responsible for updating the DT with the atag information,
> not pass two conflicting sets of data into the actual kernel.

I completely agree here.  I /started/ from the position that ATAGs and
DTB would coexist, and after extensive debate[1] my opinion turned around
to it should be one or the other.  Otherwise there are all kinds of
questions about accuracy of the information and which takes
precedence.

[1]http://lists.ozlabs.org/pipermail/devicetree-discuss/2010-May/002130.html

> > Let me give a situation where this matters: you have a boot loader which
> > loads a kernel from disk and executes it.  You have 256MB of RAM fitted
> > to the machine.  You replace this kernel with a DT-enabled kernel which
> > has the DT blob appended to the kernel.  The DT blob says you have 256MB
> > of RAM.
> > 
> > You remove a 128MB DIMM because its gone faulty.  You try to boot.  The
> > boot loader provides the kernel with an ATAG telling it that there's
> > 128MB of RAM.  However, the kernel ignores the ATAGs and instead looks
> > at the encapsulated DT information which tells it that there's 256MB
> > of RAM.  Your kernel OOPSes.  You reboot, and try passing a command
> > line argument of 'mem=128M'. The kernel again ignores this because its
> > an ATAG.
> > 
> > The result: you can't boot the platform.
> >
> > Another case: your flash has become corrupted, and the kernel won't mount
> > the flash based rootfs.  You want to boot from a root-NFS export to sort
> > the problem out, but the kernel ignores your new command line telling it
> > to do so.
> > 
> > The result: you can't boot the platform.
> > 
> > Another case: you have a Thecus N2100 acting as a server, with a pair
> > of drives setup as raid 1.  You reboot it one day and it refuses to build
> > the raid 1 rootfs, and so panics at boot.  You want to change the kernel
> > command line so that it mounts root from somewhere else, but because
> > you're using a DT based kernel, it ignores you.
> > 
> > The result: you can't boot the platform.
> 
> So we need to at least the command line and the memory layout to be adapted
> in the in-memory DT, from the atags. Any other tags?

initrd location.

There already exists a prototype patch that loads some atag data into
the dt, and it is exactly the mechanism used by powerpc to boot kernels
on non-dt firmware.

g.

  parent reply	other threads:[~2011-06-12 14:57 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-12  6:06 [PATCH 0/3] patches to allow DTB to be appended to the ARM zImage Nicolas Pitre
2011-06-12  6:06 ` [PATCH 1/3] ARM: zImage: ensure it is always a multiple of 64 bits in size Nicolas Pitre
2011-06-13 10:43   ` Tony Lindgren
2011-06-13 11:24   ` Russell King - ARM Linux
2011-06-13 14:06     ` Nicolas Pitre
2011-06-12  6:06 ` [PATCH 2/3] ARM: zImage: Allow the appending of a device tree binary Nicolas Pitre
2011-06-12 15:01   ` Grant Likely
2011-06-13 10:46   ` Tony Lindgren
2011-06-13 11:26     ` Russell King - ARM Linux
2011-06-13 14:08       ` Nicolas Pitre
2011-06-12  6:06 ` [PATCH 3/3] ARM: zImage: make sure appended DTB doesn't get overwritten by kernel .bss Nicolas Pitre
2011-06-13 10:47   ` Tony Lindgren
2011-06-12  8:15 ` [PATCH 0/3] patches to allow DTB to be appended to the ARM zImage Russell King - ARM Linux
2011-06-12  8:34   ` Shawn Guo
2011-06-12  9:21     ` Russell King - ARM Linux
2011-06-12  9:38       ` Shawn Guo
2011-06-12  9:52         ` Russell King - ARM Linux
2011-06-12 10:42           ` Shawn Guo
2011-06-12 10:40             ` Russell King - ARM Linux
2011-06-13 23:04               ` David Brown
2011-06-13 23:13                 ` Nicolas Pitre
2011-06-14  7:09                   ` Nicolas Pitre
2011-06-14 11:25                     ` Shawn Guo
2011-06-14 14:53                     ` Tony Lindgren
2011-06-14 17:28                       ` Nicolas Pitre
2011-06-14 20:32                         ` Arnd Bergmann
2011-06-14 21:21                           ` Nicolas Pitre
2011-06-14 21:42                             ` Arnd Bergmann
2011-06-14 22:06                               ` Grant Likely
2011-06-15  8:08                                 ` Tony Lindgren
2011-06-14 22:32                           ` Rob Herring
2011-06-14 23:50                             ` Nicolas Pitre
2011-06-15  2:09                               ` Rob Herring
2011-06-15  2:21                                 ` Nicolas Pitre
2011-06-14 21:38                     ` David Brown
2011-06-14 23:27                     ` [PATCH] Support multiple MEM tags with atags->fdt conversion David Brown
2011-06-15 19:50                       ` Nicolas Pitre
2011-06-15 20:15                         ` David Brown
2011-06-15 20:20                           ` Nicolas Pitre
2011-06-16  1:43                         ` David Gibson
2011-06-20  4:03                           ` Nicolas Pitre
2011-06-20  4:53                             ` David Gibson
2011-06-17 20:23                         ` David Brown
2011-06-12 11:22     ` [PATCH 0/3] patches to allow DTB to be appended to the ARM zImage Petr Štetiar
2011-06-12 11:58       ` Russell King - ARM Linux
2011-06-12 14:15         ` Arnd Bergmann
2011-06-12 14:34           ` Russell King - ARM Linux
2011-06-12 15:01             ` Arnd Bergmann
2011-06-12 15:35               ` Russell King - ARM Linux
2011-06-12 15:45                 ` Nicolas Pitre
2011-06-13 20:24                 ` Dmitry Eremin-Solenikov
2011-06-13 22:05                   ` Russell King - ARM Linux
2011-06-13 23:33                     ` Grant Likely
2011-06-12 14:57           ` Grant Likely [this message]
2011-06-12 15:19             ` Russell King - ARM Linux
2011-06-12 15:47               ` Nicolas Pitre
2011-06-12 15:59                 ` Russell King - ARM Linux
2011-06-12 18:59                   ` Nicolas Pitre
2011-06-13  9:51                     ` Tony Lindgren
2011-06-13 14:14                       ` Nicolas Pitre
2011-06-13 14:20                         ` Russell King - ARM Linux
2011-06-13 15:02                           ` Tony Lindgren
2011-06-13 15:14                           ` Nicolas Pitre
2011-06-13 15:17                             ` Grant Likely
2011-06-12 19:26                   ` Warner Losh
2011-06-13  9:59                   ` Tony Lindgren
2011-06-12 15:41         ` Nicolas Pitre
2011-06-14  0:13           ` David Brown
2011-09-06 11:23             ` Linus Walleij
2011-06-21  1:40       ` David Gibson
2011-06-13  4:31 ` Grant Likely
2011-06-13 20:44   ` Nicolas Pitre
2011-09-05 15:43     ` Tony Lindgren
2011-09-05 19:32       ` Nicolas Pitre

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=20110612145751.GA4013@ponder.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).