* use of aliases in device trees
@ 2007-11-04 1:02 Kumar Gala
2007-11-04 3:29 ` [U-Boot-Users] " Grant Likely
2007-11-04 9:24 ` Segher Boessenkool
0 siblings, 2 replies; 5+ messages in thread
From: Kumar Gala @ 2007-11-04 1:02 UTC (permalink / raw)
To: linux-ppc list; +Cc: U-Boot Users List
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 = "...";
};
I wanted to see what people think of this idea and about trying to
use common names for the aliases? If nothing else I believe we will
look at doing this on the FSL boards/parts.
- k
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [U-Boot-Users] use of aliases in device trees 2007-11-04 1:02 use of aliases in device trees Kumar Gala @ 2007-11-04 3:29 ` Grant Likely 2007-11-04 22:42 ` David Gibson 2007-11-04 9:24 ` Segher Boessenkool 1 sibling, 1 reply; 5+ messages in thread From: Grant Likely @ 2007-11-04 3:29 UTC (permalink / raw) To: Kumar Gala; +Cc: linux-ppc list, David Gibson, U-Boot Users List 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>; ... }; Cheers, g. > > I wanted to see what people think of this idea and about trying to > use common names for the aliases? If nothing else I believe we will > look at doing this on the FSL boards/parts. > > - k > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > U-Boot-Users mailing list > U-Boot-Users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/u-boot-users > -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. grant.likely@secretlab.ca (403) 399-0195 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [U-Boot-Users] use of aliases in device trees 2007-11-04 3:29 ` [U-Boot-Users] " Grant Likely @ 2007-11-04 22:42 ` David Gibson 2007-11-04 23:32 ` Grant Likely 0 siblings, 1 reply; 5+ messages in thread From: David Gibson @ 2007-11-04 22:42 UTC (permalink / raw) To: Grant Likely; +Cc: linux-ppc list, U-Boot Users List 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [U-Boot-Users] use of aliases in device trees 2007-11-04 22:42 ` David Gibson @ 2007-11-04 23:32 ` Grant Likely 0 siblings, 0 replies; 5+ messages in thread From: Grant Likely @ 2007-11-04 23:32 UTC (permalink / raw) To: Grant Likely, Kumar Gala, linux-ppc list, U-Boot Users List On 11/4/07, David Gibson <david@gibson.dropbear.id.au> wrote: > On Sat, Nov 03, 2007 at 09:29:48PM -0600, Grant Likely wrote: > > 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. Yeah, okay! I like both of those ideas. That certainly addresses my ease of maintenance concerns. Cheers, g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. grant.likely@secretlab.ca (403) 399-0195 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: use of aliases in device trees 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 9:24 ` Segher Boessenkool 1 sibling, 0 replies; 5+ messages in thread From: Segher Boessenkool @ 2007-11-04 9:24 UTC (permalink / raw) To: Kumar Gala; +Cc: linux-ppc list, U-Boot Users List > 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. > One common solution would be having a top level aliases like the pmac > tree's have: > > aliases { > enet0 = "..."; > enet1 = "..."; > pci0 = "..."; > pci1 = "..."; > }; It's not just Apple that uses this; this is standard OF stuff. > I wanted to see what people think of this idea and about trying to > use common names for the aliases? I'm obviously all for it, having suggested it myself a few times. For common names, I think a good starting point would be to use the generic names (as defined in the "generic names" recommended practice; this should be the name of the nodes pointed to as well), followed by a number; and/or a generic name without any suffix, which points to the "main" device of that type. This is a lot like your example, except that "enet" isn't a generic name (that would be "network" I believe). It is perfectly fine to have to or more aliases pointing to the same node though. This won't solve all identification problems of course, it only gives an ordering per class of devices, but in most cases this will be enough, esp. when platform code uses this. We'll likely need a few extra names for special cases, but let's use some restraint there, and esp. not define something as a generic solution when it isn't. Segher ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-11-04 23:32 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 2007-11-04 23:32 ` Grant Likely 2007-11-04 9:24 ` Segher Boessenkool
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).