PCI bus numbering and orphaned devices
John-Mark Gurney
gurney_j at efn.org
Mon Jun 9 21:09:36 PDT 2003
Bernd Walter scribbled this message on Jun 10:
> On Mon, Jun 09, 2003 at 04:58:38PM -0700, John-Mark Gurney wrote:
> > +#ifdef __sparc64__
> > + /*
> > + * XXX - some sparc hardware has valid hardware when the
> > + * function 0 doesn't probe. Scan all functions.
> > + */
> > + pcifunchigh = PCI_FUNCMAX;
> > +#else
> > pcifunchigh = 0;
> > +#endif
> > for (f = 0; f <= pcifunchigh; f++) {
> > dinfo = pci_read_device(pcib, busno, s, f, dinfo_size);
> > if (dinfo != NULL) {
>
> This is problematic as it ignores the fact about single function
> devices which may react to all function numbers.
Wouldn't this happen with the current logic? since if function 0 is
found, it scans the rest... (Might be getting confused with SCSI
buses).
> What about reverting the logic:
> Initialy set pcifunchigh = PCI_FUNCMAX and set pcifunchigh = 0 in case
> we catched a single function device.
> I don't think it should be sparc specific.
Actually, I was thinking that we could check to see if the next word
is not -1. The chip responds to the rest of the registers, but just
doesn't respond to the DEVVENDOR (first word). So, if we check if the
first function's first word returns -1, check the second word, and if
that is not -1, then probe all the rest of the functions.
-bash-2.05b$ pciconf -r pci1:5:0 0x0:0x4
ffffffff 02800002
I'm also thinking of adding support code to the pci bus to let the
userland add a new device node to be probed. It shouldn't be too hard,
but would be help in these cases.
--
John-Mark Gurney Voice: +1 415 225 5579
"All that I will do, has been done, All that I have, has not."
More information about the freebsd-sparc64
mailing list