linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: linux-ppc list <linuxppc-dev@ozlabs.org>,
	U-Boot Users List <u-boot-users@lists.sourceforge.net>
Subject: Re: [U-Boot-Users] use of aliases in device trees
Date: Mon, 5 Nov 2007 09:42:56 +1100	[thread overview]
Message-ID: <20071104224256.GC15444@localhost.localdomain> (raw)
In-Reply-To: <fa686aa40711032029x3871b76m5b44a6e93d8d7217@mail.gmail.com>

On Sat, Nov 03, 2007 at 09:29:48PM -0600, Grant Likely wrote:
> On 11/3/07, Kumar Gala <galak@kernel.crashing.org> wrote:
> > In some discussion on the u-boot dev list it became clear that having
> > aliases in the device tree might be useful as a common way to deal
> > with finding specific nodes that need fixing up by the firmware.
> > This problem also exists in the kernel bootwrappers.
> >
> > The common example is how to associate a given MAC address with the
> > proper ethernet node.  In u-boot an explicit path is hard coded into
> > the u-boot build for each ethernet device.  In the bootwrapper we use
> > "linux,network-index = <N>" in the given ethernet node.
> >
> > One common solution would be having a top level aliases like the pmac
> > tree's have:
> >
> > aliases {
> >         enet0 = "...";
> >         enet1 = "...";
> >         pci0 = "...";
> >         pci1 = "...";
> > };
> 
> One question to ask is do we use full paths or phandles to point at nodes?
> 
> OF, of course, uses full paths, but that does require more memory and
> processing power, but it might not be significant enough to worry
> about.
> 
> If we use phandles, then we should use names that don't conflict with
> full path alias names.  It would also be desirable to be able to
> generate a phandle alias from the full path alias in order to maintain
> some level of compatibility with OF.  It also think it will make
> maintaining aliases in .dts files simpler because trivial changes to
> node paths won't break the phandle alias.
> 
> Maybe something like:
> aliases {
>       enet0,phandle = <&enet0>;
>       enet1,phandle = <&enet1>;
>       ...
> };

The fairly small advantages of using phandles here are not worth the
hassle of defining a new alias format, when the OF one with full paths
already exists.

I would, however, like to extend dtc so that we can do something like:
	aliases {
		enet0 = &enet0;
	};
and the reference in non-cell context will expand to the full path.
That could be used for things like linux,stdout-path in /chosen, too.

I'd also like to extend dtc so that the label can be tagged somehow, say:
	*enet0: { ... };
and as well as creating a normal dtc label, an alias will also be
automatically added to /aliases.

-- 
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

  reply	other threads:[~2007-11-04 22:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-04  1:02 use of aliases in device trees Kumar Gala
2007-11-04  3:29 ` [U-Boot-Users] " Grant Likely
2007-11-04 22:42   ` David Gibson [this message]
2007-11-04 23:32     ` Grant Likely
2007-11-04  9:24 ` Segher Boessenkool

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=20071104224256.GC15444@localhost.localdomain \
    --to=david@gibson.dropbear.id.au \
    --cc=grant.likely@secretlab.ca \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=u-boot-users@lists.sourceforge.net \
    /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).