> @ in this case seperates the type of resources (pci) from the instance
> of it (device, function).
>
> So @ is a seperator. Using _ will add ambiguity as it is NOT a
> seperator. same problem for -.
>
> Stepan, will the OFW guys kill us if we allow ':' as well as @.

The general syntax of a pathname component in OF is:

        [EMAIL PROTECTED]:args

"name" is the name of the node, like "pci" or "cpu" or "rtc".

"unit-addr" is (the text representation of) the address for the node,
in the parent's address space.  On simple memory-mapped busses, you
would see for example "[EMAIL PROTECTED]"; on a pci bus, you see "[EMAIL 
PROTECTED]"
for dev 4 fn 0, or "[EMAIL PROTECTED],1" for dev 4 fn 1 (pci bus number is
implicit here); and on simple enumerated (pseudo-)busses you can find
"[EMAIL PROTECTED]" for a cpu with id 2.

"args" is used when you open a device node; for example, on a storage
device it can select a partition and a file name on a filesystem on
there, or on a network device node it can tell you what ip address to
or to perform dhcp etc. etc.

The text representation of a unit address corresponds directly to the
binary representation of it, which typically comes from the "reg"
property in the device node.  In "real" OF, this mapping is done via
the encode-unit and decode-unit methods in the parent node, and the
text representation isn't actually stored in the (static) tree.

In the "flat tree" system however, the text representation of the unit
address is stored together with the node name as one string.  This
doesn't cause too many problems for consumers of the flat tree, but
_producers_ of flat trees run into more and more problems, that 
currently
are "solved" in various ad-hoc ways.

If you want to stay close to original OF with your use of the device 
tree
(I think you should, but it's entirely up to you), I can push for 
creating
a new revision of the flat tree format that will include a decent 
solution
to this problem once and for all.

Comments?  Questions?


Segher


-- 
coreboot mailing list
coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to