From: Philip Homburg Date: Fri, 26 Aug 2005 11:36:57 +0000 (+0000) Subject: Added debug output for unsupported PCI-to-PCI bridges. X-Git-Tag: v3.1.0~267 X-Git-Url: http://zhaoyanbai.com/repos/%22https:/www.google.com/jsapi/static/gitweb.css?a=commitdiff_plain;h=9fc2555e6facd5c496130594b3fb7273cdf466d2;p=minix.git Added debug output for unsupported PCI-to-PCI bridges. --- diff --git a/drivers/libpci/pci.c b/drivers/libpci/pci.c index d4dbd0a8f..e3d2380d3 100644 --- a/drivers/libpci/pci.c +++ b/drivers/libpci/pci.c @@ -692,7 +692,8 @@ int busind; int devind, i; int ind, type; u16_t vid, did; - u8_t sbusn; + u8_t sbusn, baseclass, subclass, infclass; + u32_t t3; vid= did= 0; /* lint */ for (devind= 0; devind< nr_pcidev; devind++) @@ -711,7 +712,27 @@ int busind; break; } if (pci_pcibridge[i].vid == 0) + { + if (debug) + { + /* Report unsupported bridges */ + baseclass= pci_attr_r8(devind, PCI_BCR); + subclass= pci_attr_r8(devind, PCI_SCR); + infclass= pci_attr_r8(devind, PCI_PIFR); + t3= ((baseclass << 16) | (subclass << 8) | + infclass); + if (t3 != PCI_T3_PCI2PCI && + t3 != PCI_T3_PCI2PCI_SUBTR) + { + /* No a PCI-to-PCI bridge */ + continue; + } + printf( + "Ignoring unknown PCI-to-PCI bridge: %04X/%04X\n", + vid, did); + } continue; + } type= pci_pcibridge[i].type; if (debug) diff --git a/drivers/libpci/pci.h b/drivers/libpci/pci.h index 6e2a67972..41385445e 100644 --- a/drivers/libpci/pci.h +++ b/drivers/libpci/pci.h @@ -49,6 +49,10 @@ _PROTOTYPE( void pci_attr_w32, (int devind, int port, u32_t value) ); #define PCI_ILR 0x3C /* Interrupt Line Register */ #define PCI_IPR 0x3D /* Interrupt Pin Register */ +/* Device type values as ([PCI_BCR] << 16) | ([PCI_SCR] << 8) | [PCI_PIFR] */ +#define PCI_T3_PCI2PCI 0x060400 /* PCI-to-PCI Bridge device */ +#define PCI_T3_PCI2PCI_SUBTR 0x060401 /* Subtr. PCI-to-PCI Bridge */ + /* PCI bridge devices (AGP) */ #define PPB_SBUSN 0x19 /* Secondary Bus Number */