diff options
author | peter <peter@FreeBSD.org> | 1999-11-18 08:58:37 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-11-18 08:58:37 +0000 |
commit | 5a49af516f8189ae1cf02fbe8114baf89f6b51d5 (patch) | |
tree | 3620632ef7f0c094304dcb52c34d1f23da4902ba | |
parent | be3a1757c09b76b9818ca63134d7cf67b002879c (diff) | |
download | FreeBSD-src-5a49af516f8189ae1cf02fbe8114baf89f6b51d5.zip FreeBSD-src-5a49af516f8189ae1cf02fbe8114baf89f6b51d5.tar.gz |
If we have found pci devices via pci_cfgopen(), but don't find a
host->pci bridge specifically, then add a pcib0 device on the motherboard
for the pci bus to hang off.
Requested by: Anders Andersson <anders@sanyusan.se>
Obtained from: dfr
-rw-r--r-- | sys/amd64/pci/pci_bus.c | 14 | ||||
-rw-r--r-- | sys/amd64/pci/pci_cfgreg.c | 14 | ||||
-rw-r--r-- | sys/i386/isa/pcibus.c | 14 | ||||
-rw-r--r-- | sys/i386/pci/pci_bus.c | 14 | ||||
-rw-r--r-- | sys/i386/pci/pci_cfgreg.c | 14 | ||||
-rw-r--r-- | sys/i386/pci/pci_pir.c | 14 |
6 files changed, 84 insertions, 0 deletions
diff --git a/sys/amd64/pci/pci_bus.c b/sys/amd64/pci/pci_bus.c index 138da75..a640e14 100644 --- a/sys/amd64/pci/pci_bus.c +++ b/sys/amd64/pci/pci_bus.c @@ -420,6 +420,7 @@ static void nexus_pcib_identify(driver_t *driver, device_t parent) { pcicfgregs probe; + int found = 0; if (pci_cfgopen() == 0) return; @@ -455,9 +456,22 @@ nexus_pcib_identify(driver_t *driver, device_t parent) child = BUS_ADD_CHILD(parent, 100, "pcib", busnum); device_set_desc(child, s); + found = 1; } } } + + /* + * Make sure we add at least one bridge since some old + * hardware doesn't actually have a host-pci bridge device. + * Note that pci_cfgopen() thinks we have PCI devices.. + */ + if (!found) { + if (bootverbose) + printf( + "nexus_pcib_identify: no bridge found, adding pcib0 anyway\n"); + BUS_ADD_CHILD(parent, 100, "pcib", 0); + } } static int diff --git a/sys/amd64/pci/pci_cfgreg.c b/sys/amd64/pci/pci_cfgreg.c index 138da75..a640e14 100644 --- a/sys/amd64/pci/pci_cfgreg.c +++ b/sys/amd64/pci/pci_cfgreg.c @@ -420,6 +420,7 @@ static void nexus_pcib_identify(driver_t *driver, device_t parent) { pcicfgregs probe; + int found = 0; if (pci_cfgopen() == 0) return; @@ -455,9 +456,22 @@ nexus_pcib_identify(driver_t *driver, device_t parent) child = BUS_ADD_CHILD(parent, 100, "pcib", busnum); device_set_desc(child, s); + found = 1; } } } + + /* + * Make sure we add at least one bridge since some old + * hardware doesn't actually have a host-pci bridge device. + * Note that pci_cfgopen() thinks we have PCI devices.. + */ + if (!found) { + if (bootverbose) + printf( + "nexus_pcib_identify: no bridge found, adding pcib0 anyway\n"); + BUS_ADD_CHILD(parent, 100, "pcib", 0); + } } static int diff --git a/sys/i386/isa/pcibus.c b/sys/i386/isa/pcibus.c index 138da75..a640e14 100644 --- a/sys/i386/isa/pcibus.c +++ b/sys/i386/isa/pcibus.c @@ -420,6 +420,7 @@ static void nexus_pcib_identify(driver_t *driver, device_t parent) { pcicfgregs probe; + int found = 0; if (pci_cfgopen() == 0) return; @@ -455,9 +456,22 @@ nexus_pcib_identify(driver_t *driver, device_t parent) child = BUS_ADD_CHILD(parent, 100, "pcib", busnum); device_set_desc(child, s); + found = 1; } } } + + /* + * Make sure we add at least one bridge since some old + * hardware doesn't actually have a host-pci bridge device. + * Note that pci_cfgopen() thinks we have PCI devices.. + */ + if (!found) { + if (bootverbose) + printf( + "nexus_pcib_identify: no bridge found, adding pcib0 anyway\n"); + BUS_ADD_CHILD(parent, 100, "pcib", 0); + } } static int diff --git a/sys/i386/pci/pci_bus.c b/sys/i386/pci/pci_bus.c index 138da75..a640e14 100644 --- a/sys/i386/pci/pci_bus.c +++ b/sys/i386/pci/pci_bus.c @@ -420,6 +420,7 @@ static void nexus_pcib_identify(driver_t *driver, device_t parent) { pcicfgregs probe; + int found = 0; if (pci_cfgopen() == 0) return; @@ -455,9 +456,22 @@ nexus_pcib_identify(driver_t *driver, device_t parent) child = BUS_ADD_CHILD(parent, 100, "pcib", busnum); device_set_desc(child, s); + found = 1; } } } + + /* + * Make sure we add at least one bridge since some old + * hardware doesn't actually have a host-pci bridge device. + * Note that pci_cfgopen() thinks we have PCI devices.. + */ + if (!found) { + if (bootverbose) + printf( + "nexus_pcib_identify: no bridge found, adding pcib0 anyway\n"); + BUS_ADD_CHILD(parent, 100, "pcib", 0); + } } static int diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c index 138da75..a640e14 100644 --- a/sys/i386/pci/pci_cfgreg.c +++ b/sys/i386/pci/pci_cfgreg.c @@ -420,6 +420,7 @@ static void nexus_pcib_identify(driver_t *driver, device_t parent) { pcicfgregs probe; + int found = 0; if (pci_cfgopen() == 0) return; @@ -455,9 +456,22 @@ nexus_pcib_identify(driver_t *driver, device_t parent) child = BUS_ADD_CHILD(parent, 100, "pcib", busnum); device_set_desc(child, s); + found = 1; } } } + + /* + * Make sure we add at least one bridge since some old + * hardware doesn't actually have a host-pci bridge device. + * Note that pci_cfgopen() thinks we have PCI devices.. + */ + if (!found) { + if (bootverbose) + printf( + "nexus_pcib_identify: no bridge found, adding pcib0 anyway\n"); + BUS_ADD_CHILD(parent, 100, "pcib", 0); + } } static int diff --git a/sys/i386/pci/pci_pir.c b/sys/i386/pci/pci_pir.c index 138da75..a640e14 100644 --- a/sys/i386/pci/pci_pir.c +++ b/sys/i386/pci/pci_pir.c @@ -420,6 +420,7 @@ static void nexus_pcib_identify(driver_t *driver, device_t parent) { pcicfgregs probe; + int found = 0; if (pci_cfgopen() == 0) return; @@ -455,9 +456,22 @@ nexus_pcib_identify(driver_t *driver, device_t parent) child = BUS_ADD_CHILD(parent, 100, "pcib", busnum); device_set_desc(child, s); + found = 1; } } } + + /* + * Make sure we add at least one bridge since some old + * hardware doesn't actually have a host-pci bridge device. + * Note that pci_cfgopen() thinks we have PCI devices.. + */ + if (!found) { + if (bootverbose) + printf( + "nexus_pcib_identify: no bridge found, adding pcib0 anyway\n"); + BUS_ADD_CHILD(parent, 100, "pcib", 0); + } } static int |