[OpenBIOS] Device node naming for device_type pci?
Tarl.Neustaedter at Sun.COM
Thu Oct 18 04:14:10 CEST 2007
Asif Haswarey wrote:
> After looking at the pci bus-binding, [...]
> Well this does not seem to be the case on the SPARC system I am using:
> /pci at 1f,700000
> If I use the first phy-hi value from the reg property, and extract the
> dev# and fun# as described in the OpenFirmware
> PCI Bus Binding, I get dev# = 0x00, fun# = 0x04.
> So how does Sun get:
> dev# = 0x1f
> fun# = 0x700000 [and valid fun#s range from 0 .. 7]
> Perhaps I am supposed to look at another property.
> Does anyone know which one that would be?
The unit address of a device node (and the reg property) is
defined by the *parent's* encode-unit. The root nexus on your
00000400 0ff00000 (binary form from the reg property)
into 1f,700000 (text form). See the encode-unit and decode-unit
methods in the top level "/" node. I recall this particular
pattern is from our first sun4s systems (excalibur et.al.), and
I don't recall the reason for the bits being scattered about
like that. But it's irrelevant to the pci nodes, the pci driver
itself does not need to know the translation.
More information about the OpenBIOS