aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2012-10-30 13:25:53 -0400
committerBjorn Helgaas <bhelgaas@google.com>2012-11-07 17:24:19 -0500
commit21c5fd97380ba22c2a616b482307b2ef94429f31 (patch)
treeae2f982cc12c395451ae0620706612e0d9b97789 /drivers/pci
parent438be3c6b76fa129731a320ec7f0bb3d530bcb50 (diff)
PCI: Add workaround for PLX PCI 9050 BAR alignment erratum
The PLX PCI 9050 PCI Target bridge controller has a bug that prevents its local configuration registers being read through BAR0 (memory) or BAR1 (i/o) if the base address lies on an odd 128-byte boundary, i.e. if bit 7 of the base address is non-zero. This bug is described in the PCI 9050 errata list, version 1.4, May 2005. It was fixed in the pin-compatible PCI 9052, which can be distinguished from the PCI 9050 by checking the revision in the PCI header, which is hard-coded for these chips. Workaround the problem by re-allocating the affected regions to a 256-byte boundary. Note that BAR0 and/or BAR1 may have been disabled (size 0) during initialization of the PCI chip when its configuration is read from a serial EEPROM. Currently, the fix-up has only been used for devices with the default vendor and device ID of the PLX PCI 9050. The PCI 9052 shares the same default device ID as the PCI 9050 but they have different PCI revision codes. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/quirks.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 7a451ff56ecc..2d0d1c229c68 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1790,6 +1790,34 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TOSHIBA_2,
1790 PCI_DEVICE_ID_TOSHIBA_TC86C001_IDE, 1790 PCI_DEVICE_ID_TOSHIBA_TC86C001_IDE,
1791 quirk_tc86c001_ide); 1791 quirk_tc86c001_ide);
1792 1792
1793/*
1794 * PLX PCI 9050 PCI Target bridge controller has an errata that prevents the
1795 * local configuration registers accessible via BAR0 (memory) or BAR1 (i/o)
1796 * being read correctly if bit 7 of the base address is set.
1797 * The BAR0 or BAR1 region may be disabled (size 0) or enabled (size 128).
1798 * Re-allocate the regions to a 256-byte boundary if necessary.
1799 */
1800static void __devinit quirk_plx_pci9050(struct pci_dev *dev)
1801{
1802 unsigned int bar;
1803
1804 /* Fixed in revision 2 (PCI 9052). */
1805 if (dev->revision >= 2)
1806 return;
1807 for (bar = 0; bar <= 1; bar++)
1808 if (pci_resource_len(dev, bar) == 0x80 &&
1809 (pci_resource_start(dev, bar) & 0x80)) {
1810 struct resource *r = &dev->resource[bar];
1811 dev_info(&dev->dev,
1812 "Re-allocating PLX PCI 9050 BAR %u to length 256 to avoid bit 7 bug\n",
1813 bar);
1814 r->start = 0;
1815 r->end = 0xff;
1816 }
1817}
1818DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1819 quirk_plx_pci9050);
1820
1793static void __devinit quirk_netmos(struct pci_dev *dev) 1821static void __devinit quirk_netmos(struct pci_dev *dev)
1794{ 1822{
1795 unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4; 1823 unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4;