summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/amd64/pci/pchb.c20
-rw-r--r--sys/arch/i386/pci/pchb.c19
2 files changed, 37 insertions, 2 deletions
diff --git a/sys/arch/amd64/pci/pchb.c b/sys/arch/amd64/pci/pchb.c
index 5e2f7b627be..1eb74fed4b2 100644
--- a/sys/arch/amd64/pci/pchb.c
+++ b/sys/arch/amd64/pci/pchb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pchb.c,v 1.29 2009/04/11 14:59:59 kettenis Exp $ */
+/* $OpenBSD: pchb.c,v 1.30 2009/09/18 20:17:17 kettenis Exp $ */
/* $NetBSD: pchb.c,v 1.1 2003/04/26 18:39:50 fvdl Exp $ */
/*
* Copyright (c) 2000 Michael Shalayeff
@@ -142,6 +142,7 @@ pchbattach(struct device *parent, struct device *self, void *aux)
{
struct pchb_softc *sc = (struct pchb_softc *)self;
struct pci_attach_args *pa = aux;
+ pcireg_t bcreg;
int i, r;
switch (PCI_VENDOR(pa->pa_id)) {
@@ -197,6 +198,23 @@ pchbattach(struct device *parent, struct device *self, void *aux)
}
printf("\n");
break;
+ case PCI_VENDOR_VIATECH:
+ switch (PCI_PRODUCT(pa->pa_id)) {
+ case PCI_PRODUCT_VIATECH_VT8251_VLINK:
+ /*
+ * For some strange reason, the VIA VT8251
+ * chipset can be configured to its PCIe
+ * bridge show up as a host bridge. We whack
+ * it into PCI bridge mode here such that we
+ * can see the devices behind it.
+ */
+ bcreg = pci_conf_read(pa->pa_pc, pa->pa_tag, 0xfc);
+ bcreg &= ~0x00000004; /* XXX Magic */
+ pci_conf_write(pa->pa_pc, pa->pa_tag, 0xfc, bcreg);
+ break;
+ }
+ printf("\n");
+ break;
default:
printf("\n");
break;
diff --git a/sys/arch/i386/pci/pchb.c b/sys/arch/i386/pci/pchb.c
index 8b68557f586..5da60a085c2 100644
--- a/sys/arch/i386/pci/pchb.c
+++ b/sys/arch/i386/pci/pchb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pchb.c,v 1.77 2009/04/11 14:59:59 kettenis Exp $ */
+/* $OpenBSD: pchb.c,v 1.78 2009/09/18 20:17:17 kettenis Exp $ */
/* $NetBSD: pchb.c,v 1.65 2007/08/15 02:26:13 markd Exp $ */
/*
@@ -345,6 +345,23 @@ pchbattach(struct device *parent, struct device *self, void *aux)
}
printf("\n");
break;
+ case PCI_VENDOR_VIATECH:
+ switch (PCI_PRODUCT(pa->pa_id)) {
+ case PCI_PRODUCT_VIATECH_VT8251_VLINK:
+ /*
+ * For some strange reason, the VIA VT8251
+ * chipset can be configured to its PCIe
+ * bridge show up as a host bridge. We whack
+ * it into PCI bridge mode here such that we
+ * can see the devices behind it.
+ */
+ bcreg = pci_conf_read(pa->pa_pc, pa->pa_tag, 0xfc);
+ bcreg &= ~0x00000004; /* XXX Magic */
+ pci_conf_write(pa->pa_pc, pa->pa_tag, 0xfc, bcreg);
+ break;
+ }
+ printf("\n");
+ break;
default:
printf("\n");
break;