summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/ppb.c27
-rw-r--r--sys/dev/pci/ppbreg.h7
2 files changed, 21 insertions, 13 deletions
diff --git a/sys/dev/pci/ppb.c b/sys/dev/pci/ppb.c
index b95b780b4fe..d243f67f69c 100644
--- a/sys/dev/pci/ppb.c
+++ b/sys/dev/pci/ppb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ppb.c,v 1.58 2014/07/12 18:48:52 tedu Exp $ */
+/* $OpenBSD: ppb.c,v 1.59 2014/09/15 14:22:07 kettenis Exp $ */
/* $NetBSD: ppb.c,v 1.16 1997/06/06 23:48:05 thorpej Exp $ */
/*
@@ -146,6 +146,7 @@ ppbattach(struct device *parent, struct device *self, void *aux)
struct pci_attach_args *pa = aux;
pci_chipset_tag_t pc = pa->pa_pc;
struct pcibus_attach_args pba;
+ pci_interface_t interface;
pci_intr_handle_t ih;
pcireg_t busdata, reg, blr;
char *name;
@@ -206,9 +207,18 @@ ppbattach(struct device *parent, struct device *self, void *aux)
printf("\n");
- if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_INTEL ||
- (PCI_PRODUCT(pa->pa_id) != PCI_PRODUCT_INTEL_82801BA_HPB &&
- PCI_PRODUCT(pa->pa_id) != PCI_PRODUCT_INTEL_82801BAM_HPB))
+ interface = PCI_INTERFACE(pa->pa_class);
+
+ /*
+ * The Intel 82801BAM Hub-to-PCI can decode subtractively but
+ * doesn't advertise itself as such.
+ */
+ if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_INTEL &&
+ (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INTEL_82801BA_HPB ||
+ PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INTEL_82801BAM_HPB))
+ interface = PPB_INTERFACE_SUBTRACTIVE;
+
+ if (interface != PPB_INTERFACE_SUBTRACTIVE)
ppb_alloc_resources(sc, pa);
for (pin = PCI_INTERRUPT_PIN_A; pin <= PCI_INTERRUPT_PIN_D; pin++) {
@@ -281,14 +291,7 @@ ppbattach(struct device *parent, struct device *self, void *aux)
}
}
- /*
- * The Intel 82801BAM Hub-to-PCI can decode subtractively.
- * XXX We probably should handle subtractive decode bridges
- * in general.
- */
- if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_INTEL &&
- (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INTEL_82801BA_HPB ||
- PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INTEL_82801BAM_HPB)) {
+ if (interface == PPB_INTERFACE_SUBTRACTIVE) {
if (sc->sc_ioex == NULL)
sc->sc_ioex = pa->pa_ioex;
if (sc->sc_memex == NULL)
diff --git a/sys/dev/pci/ppbreg.h b/sys/dev/pci/ppbreg.h
index 69fcfd51bf3..dc4f4828805 100644
--- a/sys/dev/pci/ppbreg.h
+++ b/sys/dev/pci/ppbreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ppbreg.h,v 1.4 2009/11/19 20:43:32 kettenis Exp $ */
+/* $OpenBSD: ppbreg.h,v 1.5 2014/09/15 14:22:07 kettenis Exp $ */
/* $NetBSD: ppbreg.h,v 1.3 2001/07/06 18:07:16 mcr Exp $ */
/*
@@ -40,6 +40,11 @@
*/
/*
+ * PCI Programming Interface register.
+ */
+#define PPB_INTERFACE_SUBTRACTIVE 0x01
+
+/*
* Register offsets
*/
#define PPB_REG_BASE0 0x10 /* Base Addr Reg. 0 */