[U-Boot-Users] [RFC][PATCH] fdt fixup
Grant Likely
grant.likely at secretlab.ca
Fri Nov 2 16:47:48 CET 2007
On 11/2/07, Sergej Stepanov <Sergej.Stepanov at ids.de> wrote:
> Am Freitag, den 02.11.2007, 08:56 -0600 schrieb Grant Likely:
>
> > It also an area where device_type might actually be a useful property
> > if it is used to auto enumerate devices of the same type. ie. If the
> > dtb doesn't explicitly specify eth* aliases, then u-boot could
> > enumerate them so that generic fixup routines can be used and so Linux
> > (or other OS) can use the same device numbering as u-boot.
> >
> sorry...
> in chosen-node select defaults, for example?
I don't understand what you mean or are asking, but let me clarify what I mean.
I'm not talking about selected defaults; but about device enumeration
(which is similar, but not exactly the same thing). If there is a
class of devices which is typically enumerated (like ethernet
devices), then the device_type property *might* be useful because it
would allow firmware to find all devices of a similar type and assign
numbers to them.
Also, OF has an 'aliases' mechanism defined which could be very
useful. The '/aliases' node contains a set of properties which assign
a set of 'simple' names to the full path of a node. For example, on
the efika, /aliases looks like this:
ok cd /aliases
ok .properties
name "aliases"
eth "/builtin/ethernet"
ok
Now; for our purposes, using name->full_path mapping is probably
sub-optimal and name->phandle might be better. But regardless, the
alias can be used as a shortcut to refer to a particular node. For
example, on the efika:
ok cd /
ok cd eth
ok pwd
/builtin at F0000000/ethernet at F0003000
ok
So, if the aliases node was populated with common names, or if u-boot
could auto-populate the /aliases node with enumerated values for
things like 'eth#' and 'serial#', then we could do something like this
for fixups:
do_fixup_by_name(blob, "eth0", "mac-address", bd->bi_enetaddr, 6)
do_fixup_by_name(blob, "eth1", "mac-address", bd->bi_enet1addr, 6)
do_fixup_by_name(blob, "eth2", "mac-address", bd->bi_enet2addr, 6)
Which will work for *any* board, regardless of where the ethernet
nodes are in the tree.
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195
More information about the U-Boot
mailing list