Index: include/pci_cfgreg.h =================================================================== RCS file: /home/ncvs/src/sys/i386/include/pci_cfgreg.h,v retrieving revision 1.4 diff -u -r1.4 pci_cfgreg.h --- include/pci_cfgreg.h 2000/10/16 19:49:30 1.4 +++ include/pci_cfgreg.h 2001/08/20 10:13:46 @@ -51,3 +51,5 @@ extern u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes); extern void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes); extern int pci_cfgintr(int bus, int device, int pin); +extern int pci_kill_pcibios(void); +extern int pci_pcibios_active(void); Index: pci/pci_bus.c =================================================================== RCS file: /home/ncvs/src/sys/i386/pci/pci_bus.c,v retrieving revision 1.75 diff -u -r1.75 pci_bus.c --- pci/pci_bus.c 2000/12/08 22:11:06 1.75 +++ pci/pci_bus.c 2001/08/20 10:13:46 @@ -268,6 +268,7 @@ int pcifunchigh; int found824xx = 0; int found_orion = 0; + int found_pcibios_flaming_death = 0; device_t child; devclass_t pci_devclass; @@ -355,6 +356,23 @@ } if (found824xx && bus == 0) { bus++; + goto retry; + } + + /* + * This is just freaking brilliant! Some BIOS writers have + * decided that we must be forcibly prevented from using + * PCIBIOS to query the host->pci bridges. If you try and + * access configuration registers, it pretends there is + * no pci device at that bus:device:function address. + */ + if (!found && pci_pcibios_active() && !found_pcibios_flaming_death) { + /* retry with the old mechanism, or fail */ + if (pci_kill_pcibios()) + return; + printf("nexus_pcib_identify: found broken PCIBIOS - disabling it and retrying.\n"); + printf("nexus_pcib_identify: it is bogusly censoring host->pci bridges.\n"); + found_pcibios_flaming_death = 1; goto retry; } Index: pci/pci_cfgreg.c =================================================================== RCS file: /home/ncvs/src/sys/i386/pci/pci_cfgreg.c,v retrieving revision 1.76 diff -u -r1.76 pci_cfgreg.c --- pci/pci_cfgreg.c 2001/05/11 04:52:29 1.76 +++ pci/pci_cfgreg.c 2001/08/20 10:13:46 @@ -71,6 +71,19 @@ static struct PIR_table *pci_route_table; static int pci_route_count; +int +pci_pcibios_active(void) +{ + return usebios; +} + +int +pci_kill_pcibios(void) +{ + usebios = 0; + return pcireg_cfgopen(); +} + /* * Initialise access to PCI configuration space */