Subject: Re: OFW based PCI probe routine.
To: matthew green <mrg@eterna.com.au>
From: Chris G. Demetriou <cgd@sibyte.com>
List: tech-kern
Date: 02/12/2001 16:45:38
matthew green <mrg@eterna.com.au> writes:
> the one remaining problem is getting the OFW node for children that need
> it, such as the ebus on sparc64. i'd really like to get rid of the hack
> that finds the `ebus' node from that driver...
If you find that you have a general problem like that, it may well
make sense to define a machine-dependent (or even common to OFW-using
ports) function which translates from PCI chipset + tag -> ofw node.
That should be reasonable to do -- but probably no less of a hack (to
some eyes 8-) -- than the code in ebus.c.
maybe something like "pci_find_ofw_node(chipset, tag)".
That's about the best I can suggest. Given that it's MD, though, it
kinda does make sense... c.f. the 'decompose tag' fns used by some
ports. This is, in some ways, a more complex version of one of
them. 8-)
(of course, it looks like people have started to use
pci_decompose_tag() in MI code without actually defining that as an MI
API... but that's another problem. 8-)
cgd