From ac19291f358024aa9090ef5ab0d2166d982ea9b2 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Wed, 23 Feb 2000 20:25:06 +0000 Subject: Add a workaround to allow us to detect the second pci bus on an HP Netserver LS/2. Approved by: jkh --- sys/amd64/pci/pci_bus.c | 11 ++++++++++- sys/amd64/pci/pci_cfgreg.c | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'sys/amd64/pci') diff --git a/sys/amd64/pci/pci_bus.c b/sys/amd64/pci/pci_bus.c index fd34ad85380c..f09c907a4346 100644 --- a/sys/amd64/pci/pci_bus.c +++ b/sys/amd64/pci/pci_bus.c @@ -277,7 +277,8 @@ nexus_pcib_is_host_bridge(pcicfgregs *cfg, case 0x12258086: s = "Intel 824?? host to PCI bridge"; /* XXX This is a guess */ - *busnum = pci_cfgread(cfg, 0x41, 1); + /* *busnum = pci_cfgread(cfg, 0x41, 1); */ + *busnum = cfg->bus; break; case 0x71208086: s = "Intel 82810 (i810 GMCH) Host To Hub bridge"; @@ -437,11 +438,13 @@ nexus_pcib_identify(driver_t *driver, device_t parent) u_int8_t hdrtype; int found = 0; int pcifunchigh; + int found824xx = 0; if (pci_cfgopen() == 0) return; probe.hose = 0; probe.bus = 0; + retry: for (probe.slot = 0; probe.slot <= PCI_SLOTMAX; probe.slot++) { probe.func = 0; hdrtype = pci_cfgread(&probe, PCIR_HEADERTYPE, 1); @@ -478,9 +481,15 @@ nexus_pcib_identify(driver_t *driver, device_t parent) "pcib", busnum); device_set_desc(child, s); found = 1; + if (id == 0x12258086) + found824xx = 1; } } } + if (found824xx && probe.bus == 0) { + probe.bus++; + goto retry; + } /* * Make sure we add at least one bridge since some old diff --git a/sys/amd64/pci/pci_cfgreg.c b/sys/amd64/pci/pci_cfgreg.c index fd34ad85380c..f09c907a4346 100644 --- a/sys/amd64/pci/pci_cfgreg.c +++ b/sys/amd64/pci/pci_cfgreg.c @@ -277,7 +277,8 @@ nexus_pcib_is_host_bridge(pcicfgregs *cfg, case 0x12258086: s = "Intel 824?? host to PCI bridge"; /* XXX This is a guess */ - *busnum = pci_cfgread(cfg, 0x41, 1); + /* *busnum = pci_cfgread(cfg, 0x41, 1); */ + *busnum = cfg->bus; break; case 0x71208086: s = "Intel 82810 (i810 GMCH) Host To Hub bridge"; @@ -437,11 +438,13 @@ nexus_pcib_identify(driver_t *driver, device_t parent) u_int8_t hdrtype; int found = 0; int pcifunchigh; + int found824xx = 0; if (pci_cfgopen() == 0) return; probe.hose = 0; probe.bus = 0; + retry: for (probe.slot = 0; probe.slot <= PCI_SLOTMAX; probe.slot++) { probe.func = 0; hdrtype = pci_cfgread(&probe, PCIR_HEADERTYPE, 1); @@ -478,9 +481,15 @@ nexus_pcib_identify(driver_t *driver, device_t parent) "pcib", busnum); device_set_desc(child, s); found = 1; + if (id == 0x12258086) + found824xx = 1; } } } + if (found824xx && probe.bus == 0) { + probe.bus++; + goto retry; + } /* * Make sure we add at least one bridge since some old -- cgit v1.2.3