[coreboot] patch: more path support

Segher Boessenkool segher at kernel.crashing.org
Thu Feb 14 19:12:54 CET 2008

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

	name at unit-addr: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 "pci at f2000000"; on a pci bus, you see "ethernet at 4"
for dev 4 fn 0, or "ethernet at 4,1" for dev 4 fn 1 (pci bus number is
implicit here); and on simple enumerated (pseudo-)busses you can find
"cpu at 2" 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 
are "solved" in various ad-hoc ways.

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

Comments?  Questions?


More information about the coreboot mailing list