summaryrefslogtreecommitdiffstats
path: root/sys/sparc64/pci/ofw_pcibus.c
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2007-11-30 23:02:42 +0000
committermarius <marius@FreeBSD.org>2007-11-30 23:02:42 +0000
commitedd33ddaa93e181a8c159d402224dbd528e62b42 (patch)
treeada97ecabb3c4798cb957de1d967a7ab648b93e7 /sys/sparc64/pci/ofw_pcibus.c
parentb629181a3df55f7f94227715d44156a27585142b (diff)
downloadFreeBSD-src-edd33ddaa93e181a8c159d402224dbd528e62b42.zip
FreeBSD-src-edd33ddaa93e181a8c159d402224dbd528e62b42.tar.gz
- Add the PCI side of the HOST-PCI bridge itself to the bus. This
is required by the X.Org PCI domains code and additionally needs a workaround for Hummingbird and Sabre bridges as these don't allow their config headers to be read at any width, which is an unusual behavior. - In psycho(4) take advantage of DEFINE_CLASS_0 and use more appropriate types for some softc members. MFC after: 3 days
Diffstat (limited to 'sys/sparc64/pci/ofw_pcibus.c')
-rw-r--r--sys/sparc64/pci/ofw_pcibus.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/sparc64/pci/ofw_pcibus.c b/sys/sparc64/pci/ofw_pcibus.c
index 0a03696..f771389 100644
--- a/sys/sparc64/pci/ofw_pcibus.c
+++ b/sys/sparc64/pci/ofw_pcibus.c
@@ -189,6 +189,19 @@ ofw_pcibus_attach(device_t dev)
domain, busno);
node = ofw_bus_get_node(dev);
+
+#ifndef SUN4V
+ /* Add the PCI side of the HOST-PCI bridge itself to the bus. */
+ if (strcmp(device_get_name(device_get_parent(pcib)), "nexus") == 0 &&
+ (dinfo = (struct ofw_pcibus_devinfo *)pci_read_device(pcib,
+ domain, busno, 0, 0, sizeof(*dinfo))) != NULL) {
+ if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, node) != 0)
+ pci_freecfg((struct pci_devinfo *)dinfo);
+ else
+ pci_add_child(dev, (struct pci_devinfo *)dinfo);
+ }
+#endif
+
for (child = OF_child(node); child != 0; child = OF_peer(child)) {
if (OF_getprop(child, "reg", &pcir, sizeof(pcir)) == -1)
continue;
OpenPOWER on IntegriCloud