summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAaron Campbell <aaron@cvs.openbsd.org>2001-08-22 16:33:12 +0000
committerAaron Campbell <aaron@cvs.openbsd.org>2001-08-22 16:33:12 +0000
commit6ebfe2c6e0a05e01e5abc58171c07a059819db55 (patch)
treea92559e58f1715a7bd9f22d0689ae48ffb0eb668 /sys
parentdb57ff1264b567887dc5375fb8dd32d9ff47c499 (diff)
Initialize auto variable (win[{0,1}].win_flags). Also, if PCCBB_MEM_CACHABLE
isn't set, clear the prefetchable bits in the bridge control register. These fixes from NetBSD. Now OpenBSD won't hang when it tries to read the CIS from an ADMtek-based card through a Ricoh-based PCI-CardBus bridge.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/pccbb.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c
index 96f4e0acda5..12ad13b69fb 100644
--- a/sys/dev/pci/pccbb.c
+++ b/sys/dev/pci/pccbb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccbb.c,v 1.24 2001/08/19 15:25:44 mickey Exp $ */
+/* $OpenBSD: pccbb.c,v 1.25 2001/08/22 16:33:11 aaron Exp $ */
/* $NetBSD: pccbb.c,v 1.42 2000/06/16 23:41:35 cgd Exp $ */
/*
@@ -3020,10 +3020,9 @@ pccbb_winset(align, sc, bst)
struct pccbb_win_chain *chainp;
int offs;
- win[0].win_start = 0xffffffff;
- win[0].win_limit = 0;
- win[1].win_start = 0xffffffff;
- win[1].win_limit = 0;
+ win[0].win_start = win[1].win_start = 0xffffffff;
+ win[0].win_limit = win[1].win_limit = 0;
+ win[0].win_flags = win[1].win_flags = 0;
chainp = TAILQ_FIRST(&sc->sc_iowindow);
offs = 0x2c;
@@ -3117,16 +3116,14 @@ pccbb_winset(align, sc, bst)
pci_conf_read(pc, tag, offs + 12) + align));
if (bst == sc->sc_memt) {
- if (win[0].win_flags & PCCBB_MEM_CACHABLE) {
- pcireg_t bcr = pci_conf_read(pc, tag, PCI_BCR_INTR);
+ pcireg_t bcr = pci_conf_read(pc, tag, PCI_BCR_INTR);
+
+ bcr &= ~(CB_BCR_PREFETCH_MEMWIN0 | CB_BCR_PREFETCH_MEMWIN1);
+ if (win[0].win_flags & PCCBB_MEM_CACHABLE)
bcr |= CB_BCR_PREFETCH_MEMWIN0;
- pci_conf_write(pc, tag, PCI_BCR_INTR, bcr);
- }
- if (win[1].win_flags & PCCBB_MEM_CACHABLE) {
- pcireg_t bcr = pci_conf_read(pc, tag, PCI_BCR_INTR);
+ if (win[1].win_flags & PCCBB_MEM_CACHABLE)
bcr |= CB_BCR_PREFETCH_MEMWIN1;
- pci_conf_write(pc, tag, PCI_BCR_INTR, bcr);
- }
+ pci_conf_write(pc, tag, PCI_BCR_INTR, bcr);
}
}