linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Timur Tabi <timur@freescale.com>
Cc: linuxppc-dev@ozlabs.org, Arnd Bergmann <arnd@arndb.de>
Subject: Re: Could the DTS experts look at this?
Date: Wed, 13 Feb 2008 10:26:39 +1100	[thread overview]
Message-ID: <20080212232639.GD21230@localhost.localdomain> (raw)
In-Reply-To: <47B1EEA8.4040904@freescale.com>

[snip]
On Tue, Feb 12, 2008 at 01:08:24PM -0600, Timur Tabi wrote:
> Grant Likely wrote:
> > On Feb 12, 2008 8:44 AM, Timur Tabi <timur@freescale.com> wrote:
> >> Arnd Bergmann wrote:
>  >  I think it
> > is a slippery slope to try and encode conditionals into the structure;
> 
> Perhaps, which is why I said it should be simple conditionals - two
> values and a comparison.

I can pretty much guarantee you that someone will find that
insufficient and want to expand the conditional representation.  This
way madness lies.

> > but it is entirely reasonable to encode *data* into the dt that helps
> > make those conditional decisions.
> 
> That's okay too, except that if we just add additional nodes that
> describe conditions, then we need to make sure that whatever parses
> that DTB must also parse those additional nodes.  The only way to do
> that is create a new version number, like 18, which is marked as
> being incompatible with the current version (17).  Otherwise, a
> person could pass that DTB to an old version of U-Boot, and U-boot
> will just pass it on to the kernel as-is.

No.  As Grant says, that's not what the version number is for.  It
represents the version of the encoding, not the content.  If you must
version the content (which you should try really hard to avoid) the
correct way is to add versioning properties to the root node.

> > We've already got that issue.  If you pass the device tree for the
> > wrong board it will still validate correctly, but the board is not
> > going to boot.
> 
> There's nothing stopping U-Boot today from scanning the device tree
> and making sure the SOC's compatible node is correct.  That's not
> currently done, but it could be.
> 
>  >  The device tree must match what the bootloader
> > expects.  Changing the version number will do nothing to help this.
> > The version number ensures that the tree is parsable.  It does not
> > ensure that it is correct.
> 
> I think you're missing the point.  If we add conditional expressions
> to the device tree (whether attached to a node or as part of a
> separate node or whatever), we must also add a mechanism to ensure
> that these conditions are parsed by the boot loader.  As far as I
> know, the only mechanism that can do this is the version identifier.

No. a) the version identifier is not a mechanism for doing that and b)
the conditional mechanism is inherently agent-specific, therefore in
any case you *must* match an input incomplete tree (by which I mean
*anything* that requires processing before it's ready for consumption
by the kernel) to the specific bootloader or agent that will process
it and pass to the kernel.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

  parent reply	other threads:[~2008-02-12 23:26 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08 23:30 Could the DTS experts look at this? Sean MacLennan
2008-02-10  5:47 ` Arnd Bergmann
2008-02-10  6:05   ` Sean MacLennan
2008-02-11 17:57   ` Timur Tabi
2008-02-11 23:54     ` David Gibson
2008-02-11 23:56       ` David Gibson
2008-02-12  0:21         ` Arnd Bergmann
2008-02-12  0:36           ` David Gibson
2008-02-12 18:51             ` Scott Wood
2008-02-12 23:17               ` David Gibson
2008-02-12 23:41                 ` Timur Tabi
2008-02-12 23:50                   ` David Gibson
2008-02-12 15:44           ` Timur Tabi
2008-02-12 18:58             ` Grant Likely
2008-02-12 19:08               ` Timur Tabi
2008-02-12 19:34                 ` Grant Likely
2008-02-12 19:45                   ` Timur Tabi
2008-02-12 20:43                     ` Grant Likely
2008-02-12 23:35                     ` David Gibson
2008-02-12 23:50                       ` Timur Tabi
2008-02-13  0:10                       ` Grant Likely
2008-02-12 23:26                 ` David Gibson [this message]
2008-02-12 23:47                   ` Timur Tabi
2008-02-13  0:08                     ` David Gibson
2008-02-13  0:15                     ` Grant Likely
2008-02-12 23:21             ` David Gibson
2008-02-11  0:14 ` David Gibson
2008-02-11  2:40   ` Sean MacLennan
2008-02-11  3:11     ` David Gibson
2008-02-11  3:49       ` Sean MacLennan
2008-02-11 23:59         ` David Gibson
2008-02-12  1:07           ` Sean MacLennan
2008-02-12  0:20             ` David Gibson
2008-02-12  0:41               ` Sean MacLennan
2008-02-12  0:48                 ` David Gibson
2008-02-12 18:52                 ` Scott Wood
2008-02-12 19:03                   ` Grant Likely
2008-02-12 19:10                     ` Scott Wood
2008-02-17 10:22                       ` David Woodhouse

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=20080212232639.GD21230@localhost.localdomain \
    --to=david@gibson.dropbear.id.au \
    --cc=arnd@arndb.de \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=timur@freescale.com \
    /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).