diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-09-18 20:17:18 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-09-18 20:17:18 +0000 |
commit | a96c8885af9c39fefdd26be523e5516dc9d1c028 (patch) | |
tree | 2243717a0968cc762a9cff87e92e0c1d4a48e145 /sys/arch/amd64/pci | |
parent | 0b4d73772f38f9c1604a1045e8f2b6556a49601a (diff) |
For some dark reason there's a bit on the VLINK device of this chipset
that makes the PCIE device show up as a host bridge instead of a
PCI-PCI bridge. As a result any devices sitting behind it won't be
detected. Whack the device into PCI-PCI mode such that we can walk the
PCI bus hierarchy the normal way and detect all devices. Fixes PR 6215.
ok dlg@
Diffstat (limited to 'sys/arch/amd64/pci')
-rw-r--r-- | sys/arch/amd64/pci/pchb.c | 20 |
1 files changed, 19 insertions, 1 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; |