summaryrefslogtreecommitdiffstats
path: root/sys/pccard
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-07-01 23:41:24 +0000
committerimp <imp@FreeBSD.org>2001-07-01 23:41:24 +0000
commit128e29a1c0dcf623dc5ad05b001664642932dbca (patch)
treef4db6a8fd46f1667f13651d128362be9b314c08e /sys/pccard
parentae6d28ac1550ca74c27e50bc539a87a30ba4bfbe (diff)
downloadFreeBSD-src-128e29a1c0dcf623dc5ad05b001664642932dbca.zip
FreeBSD-src-128e29a1c0dcf623dc5ad05b001664642932dbca.tar.gz
Write zeros into the base/bounds register bars. We need to do this
because NEWBUS (and I think some versions of Windows sometimes) writes 0xffffffff to these registers to disable them. When they are "disabled" like this, writing memory ranges to the pcic registers are ignored and you will get "card (null) (null)" when you insert a call otherwise.
Diffstat (limited to 'sys/pccard')
-rw-r--r--sys/pccard/pcic_pci.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/pccard/pcic_pci.c b/sys/pccard/pcic_pci.c
index 666d014..0660416 100644
--- a/sys/pccard/pcic_pci.c
+++ b/sys/pccard/pcic_pci.c
@@ -314,6 +314,22 @@ pcic_pci_cardbus_init(device_t dev)
/* Turn off legacy address */
pci_write_config(dev, CB_PCI_LEGACY16_IOADDR, 0, 2);
+
+ /*
+ * Write zeros into the remaining BARs. This seems to turn off
+ * the pci configuration of these things and make the cardbus
+ * bridge use the values for memory programmed into the pcic
+ * registers.
+ */
+ pci_write_config(dev, CB_PCI_MEMBASE0, 0, 4);
+ pci_write_config(dev, CB_PCI_MEMLIMIT0, 0, 4);
+ pci_write_config(dev, CB_PCI_MEMBASE1, 0, 4);
+ pci_write_config(dev, CB_PCI_MEMLIMIT1, 0, 4);
+ pci_write_config(dev, CB_PCI_IOBASE0, 0, 4);
+ pci_write_config(dev, CB_PCI_IOLIMIT0, 0, 4);
+ pci_write_config(dev, CB_PCI_IOBASE1, 0, 4);
+ pci_write_config(dev, CB_PCI_IOLIMIT1, 0, 4);
+
return;
}
OpenPOWER on IntegriCloud