summaryrefslogtreecommitdiff
path: root/sys/arch/sgi/pci
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-08-09 08:16:54 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-08-09 08:16:54 +0000
commitf21f0c147e1ed0728852a1a2a5da4c4fdddc79d9 (patch)
tree801624d1a4a07f569248ae173c46758a1a23b9a0 /sys/arch/sgi/pci
parent5710f2bc91329936ff63eadcb769a90f66e5c736 (diff)
Clear the upper part of 64 bit memory BARs, for they show up as 0xffffffff
otherwise. Found the hard way by jasper@, playing with a bge card.
Diffstat (limited to 'sys/arch/sgi/pci')
-rw-r--r--sys/arch/sgi/pci/macepcibridge.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/arch/sgi/pci/macepcibridge.c b/sys/arch/sgi/pci/macepcibridge.c
index dcc3c304409..e6a14c03005 100644
--- a/sys/arch/sgi/pci/macepcibridge.c
+++ b/sys/arch/sgi/pci/macepcibridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: macepcibridge.c,v 1.30 2009/07/26 19:57:45 miod Exp $ */
+/* $OpenBSD: macepcibridge.c,v 1.31 2009/08/09 08:16:53 miod Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
@@ -767,11 +767,13 @@ mace_pcibr_device_fixup(struct mace_pcibr_softc *sc, int dev, int nfuncs)
}
/*
- * The firmware fails to initialize I/O BARs. Worse, it
- * fills them with crap. So here we disable I/O space and
- * reset the I/O BARs to 0. Device drivers will allocate
- * resources themselves and enable I/O space on an as-needed
- * basis.
+ * The firmware will only initialize memory BARs, and only
+ * the lower half of them if they are 64 bit.
+ * So here we disable I/O space and reset the I/O BARs to 0,
+ * and make sure the upper part of 64 bit memory BARs is
+ * correct.
+ * Device drivers will allocate resources themselves and
+ * enable I/O space on an as-needed basis.
*/
csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG,
@@ -784,7 +786,7 @@ mace_pcibr_device_fixup(struct mace_pcibr_softc *sc, int dev, int nfuncs)
switch (type) {
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
reg += 4;
- break;
+ /* FALLTHROUGH */
case PCI_MAPREG_TYPE_IO:
pci_conf_write(pc, tag, reg, 0);
break;