aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/quirks.c
diff options
context:
space:
mode:
authorJon Mason <jon.mason@intel.com>2013-05-06 04:03:33 -0400
committerBjorn Helgaas <bhelgaas@google.com>2013-05-15 12:51:14 -0400
commit12b03188ab2afed784e416b4fb1366b4a6915ac0 (patch)
tree1ada2cce42bae495af2780f002c387b707b05aee /drivers/pci/quirks.c
parentf722406faae2d073cc1d01063d1123c35425939e (diff)
PCI: Work around Ivytown NTB BAR size issue
Certain NTB devices have a hardware erratum where, regardless of pre-configured value, reading the BAR size returns 4096. To work around this issue, add a PCI quirk to read the appropriate values from an alternative register in PCI config space and move the resource endpoints to the appropriate location. Signed-off-by: Jon Mason <jon.mason@intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r--drivers/pci/quirks.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 7d68aeebf56b..7f492574dcf4 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2865,6 +2865,31 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata);
2865DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata); 2865DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata);
2866 2866
2867 2867
2868/*
2869 * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum. To
2870 * work around this, query the size it should be configured to by the device and
2871 * modify the resource end to correspond to this new size.
2872 */
2873static void quirk_intel_ntb(struct pci_dev *dev)
2874{
2875 int rc;
2876 u8 val;
2877
2878 rc = pci_read_config_byte(dev, 0x00D0, &val);
2879 if (rc)
2880 return;
2881
2882 dev->resource[2].end = dev->resource[2].start + ((u64) 1 << val) - 1;
2883
2884 rc = pci_read_config_byte(dev, 0x00D1, &val);
2885 if (rc)
2886 return;
2887
2888 dev->resource[4].end = dev->resource[4].start + ((u64) 1 << val) - 1;
2889}
2890DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e08, quirk_intel_ntb);
2891DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e0d, quirk_intel_ntb);
2892
2868static ktime_t fixup_debug_start(struct pci_dev *dev, 2893static ktime_t fixup_debug_start(struct pci_dev *dev,
2869 void (*fn)(struct pci_dev *dev)) 2894 void (*fn)(struct pci_dev *dev))
2870{ 2895{