PERFORCE change 193063 for review
John Baldwin
jhb at FreeBSD.org
Fri May 13 15:02:24 UTC 2011
http://p4web.freebsd.org/@@193063?ac=10
Change 193063 by jhb at jhb_fiver on 2011/05/13 15:01:44
Add a tunable so I can enable the pcib clearing at boot time for testing.
Affected files ...
.. //depot/projects/pci/sys/dev/pci/pci_pci.c#21 edit
Differences ...
==== //depot/projects/pci/sys/dev/pci/pci_pci.c#21 (text+ko) ====
@@ -108,6 +108,9 @@
DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, 0, 0);
#ifdef NEW_PCIB
+static int pcib_clear;
+TUNABLE_INT("hw.pci.pcib_clear", &pcib_clear);
+
/*
* NEW_PCIB todo:
* - properly handle the ISA enable bit. If it is set, we should change
@@ -254,19 +257,19 @@
dev = sc->dev;
-#if 0
/* XXX: Gross hack, disable all windows for testing. */
- pci_write_config(dev, PCIR_IOBASEL_1, 0xff, 1);
- pci_write_config(dev, PCIR_IOBASEH_1, 0xffff, 2);
- pci_write_config(dev, PCIR_IOLIMITL_1, 0, 1);
- pci_write_config(dev, PCIR_IOLIMITH_1, 0, 2);
- pci_write_config(dev, PCIR_MEMBASE_1, 0xffff, 2);
- pci_write_config(dev, PCIR_MEMLIMIT_1, 0, 2);
- pci_write_config(dev, PCIR_PMBASEL_1, 0xffff, 2);
- pci_write_config(dev, PCIR_PMBASEH_1, 0xffffffff, 4);
- pci_write_config(dev, PCIR_PMLIMITL_1, 0, 2);
- pci_write_config(dev, PCIR_PMLIMITH_1, 0, 4);
-#endif
+ if (pcib_clear) {
+ pci_write_config(dev, PCIR_IOBASEL_1, 0xff, 1);
+ pci_write_config(dev, PCIR_IOBASEH_1, 0xffff, 2);
+ pci_write_config(dev, PCIR_IOLIMITL_1, 0, 1);
+ pci_write_config(dev, PCIR_IOLIMITH_1, 0, 2);
+ pci_write_config(dev, PCIR_MEMBASE_1, 0xffff, 2);
+ pci_write_config(dev, PCIR_MEMLIMIT_1, 0, 2);
+ pci_write_config(dev, PCIR_PMBASEL_1, 0xffff, 2);
+ pci_write_config(dev, PCIR_PMBASEH_1, 0xffffffff, 4);
+ pci_write_config(dev, PCIR_PMLIMITL_1, 0, 2);
+ pci_write_config(dev, PCIR_PMLIMITH_1, 0, 4);
+ }
/* Determine if the I/O port window is implemented. */
val = pci_read_config(dev, PCIR_IOBASEL_1, 1);
More information about the p4-projects
mailing list