diff options
author | se <se@FreeBSD.org> | 1997-03-05 20:52:00 +0000 |
---|---|---|
committer | se <se@FreeBSD.org> | 1997-03-05 20:52:00 +0000 |
commit | 3fb3bbab68d0b68c65de74580b3f55ba41dc37e1 (patch) | |
tree | bae404308e700c0400e2154b643f816d4deb26d7 /sys/i386/pci | |
parent | d0ff874c8957e3190b701ea212f040add0fcb004 (diff) | |
download | FreeBSD-src-3fb3bbab68d0b68c65de74580b3f55ba41dc37e1.zip FreeBSD-src-3fb3bbab68d0b68c65de74580b3f55ba41dc37e1.tar.gz |
improve pcibus_check: Only assume PCI if at least one PCI to anything bridge
on bus 0.
This fixes problems with EISA-only systems mistakenly being assumed to support PCI.
Diffstat (limited to 'sys/i386/pci')
-rw-r--r-- | sys/i386/pci/pci_bus.c | 25 | ||||
-rw-r--r-- | sys/i386/pci/pci_cfgreg.c | 25 | ||||
-rw-r--r-- | sys/i386/pci/pci_pir.c | 25 |
3 files changed, 57 insertions, 18 deletions
diff --git a/sys/i386/pci/pci_bus.c b/sys/i386/pci/pci_bus.c index dfddb43..6af7ffd 100644 --- a/sys/i386/pci/pci_bus.c +++ b/sys/i386/pci/pci_bus.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id$ +** $Id: pcibus.c,v 1.31 1997/02/22 09:36:58 peter Exp $ ** ** pci bus subroutines for i386 architecture. ** @@ -167,14 +167,27 @@ pcibus_check (void) if (bootverbose) printf ("pcibus_check:\tdevice "); for (device = 0; device < pci_maxdevice; device++) { - unsigned long id; + unsigned long id, class, header; if (bootverbose) printf ("%d ", device); id = pcibus_read (pcibus_tag (0,device,0), 0); - if (id && id != 0xfffffffful) { - if (bootverbose) printf ("is there (id=%08lx)\n", id); - return 1; - } + if ((id == 0) || (id == 0xfffffffful)) + continue; + + class = pcibus_read (pcibus_tag (0,device,0), 8); + if (bootverbose) + printf ("[class=%x] ", class >> 8); + if ((class & 0xfff0ff00) != 0x06000000) + continue; + + header = pcibus_read (pcibus_tag (0,device,0), 12); + if (bootverbose) + printf ("[hdr=%x] ", (header >> 16) & 0xff); + if ((header & 0x007e0000) != 0) + continue; + + if (bootverbose) printf ("is there (id=%08lx)\n", id); + return 1; } if (bootverbose) printf ("-- nothing found\n"); diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c index dfddb43..6af7ffd 100644 --- a/sys/i386/pci/pci_cfgreg.c +++ b/sys/i386/pci/pci_cfgreg.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id$ +** $Id: pcibus.c,v 1.31 1997/02/22 09:36:58 peter Exp $ ** ** pci bus subroutines for i386 architecture. ** @@ -167,14 +167,27 @@ pcibus_check (void) if (bootverbose) printf ("pcibus_check:\tdevice "); for (device = 0; device < pci_maxdevice; device++) { - unsigned long id; + unsigned long id, class, header; if (bootverbose) printf ("%d ", device); id = pcibus_read (pcibus_tag (0,device,0), 0); - if (id && id != 0xfffffffful) { - if (bootverbose) printf ("is there (id=%08lx)\n", id); - return 1; - } + if ((id == 0) || (id == 0xfffffffful)) + continue; + + class = pcibus_read (pcibus_tag (0,device,0), 8); + if (bootverbose) + printf ("[class=%x] ", class >> 8); + if ((class & 0xfff0ff00) != 0x06000000) + continue; + + header = pcibus_read (pcibus_tag (0,device,0), 12); + if (bootverbose) + printf ("[hdr=%x] ", (header >> 16) & 0xff); + if ((header & 0x007e0000) != 0) + continue; + + if (bootverbose) printf ("is there (id=%08lx)\n", id); + return 1; } if (bootverbose) printf ("-- nothing found\n"); diff --git a/sys/i386/pci/pci_pir.c b/sys/i386/pci/pci_pir.c index dfddb43..6af7ffd 100644 --- a/sys/i386/pci/pci_pir.c +++ b/sys/i386/pci/pci_pir.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id$ +** $Id: pcibus.c,v 1.31 1997/02/22 09:36:58 peter Exp $ ** ** pci bus subroutines for i386 architecture. ** @@ -167,14 +167,27 @@ pcibus_check (void) if (bootverbose) printf ("pcibus_check:\tdevice "); for (device = 0; device < pci_maxdevice; device++) { - unsigned long id; + unsigned long id, class, header; if (bootverbose) printf ("%d ", device); id = pcibus_read (pcibus_tag (0,device,0), 0); - if (id && id != 0xfffffffful) { - if (bootverbose) printf ("is there (id=%08lx)\n", id); - return 1; - } + if ((id == 0) || (id == 0xfffffffful)) + continue; + + class = pcibus_read (pcibus_tag (0,device,0), 8); + if (bootverbose) + printf ("[class=%x] ", class >> 8); + if ((class & 0xfff0ff00) != 0x06000000) + continue; + + header = pcibus_read (pcibus_tag (0,device,0), 12); + if (bootverbose) + printf ("[hdr=%x] ", (header >> 16) & 0xff); + if ((header & 0x007e0000) != 0) + continue; + + if (bootverbose) printf ("is there (id=%08lx)\n", id); + return 1; } if (bootverbose) printf ("-- nothing found\n"); |