diff options
author | Murali Karicheri <m-karicheri2@ti.com> | 2014-09-08 13:03:34 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-09-16 17:31:21 -0400 |
commit | c15982dfa8227f3e8fd2a6e2e13a009a9991d96c (patch) | |
tree | d4f37a5e49bf0f30f2c7900ffd84433f0b35fc49 /drivers/pci/host | |
parent | 0c4ffcfe1fbc1ef564ec137eab21137cb013b00e (diff) |
PCI: keystone: Limit MRSS for all downstream devices
Keystone PCIe controller has a limitation that memory read request size
must not exceed 256 bytes. This is a hardware limitation. Add a quirk to
force this limit on all downstream devices by updating MRRS.
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/host')
-rw-r--r-- | drivers/pci/host/pci-keystone.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/pci/host/pci-keystone.c b/drivers/pci/host/pci-keystone.c index c1cfaef7faf3..c58a9eb60141 100644 --- a/drivers/pci/host/pci-keystone.c +++ b/drivers/pci/host/pci-keystone.c | |||
@@ -42,8 +42,53 @@ | |||
42 | /* DEV_STAT_CTRL */ | 42 | /* DEV_STAT_CTRL */ |
43 | #define PCIE_CAP_BASE 0x70 | 43 | #define PCIE_CAP_BASE 0x70 |
44 | 44 | ||
45 | /* PCIE controller device IDs */ | ||
46 | #define PCIE_RC_K2HK 0xb008 | ||
47 | #define PCIE_RC_K2E 0xb009 | ||
48 | #define PCIE_RC_K2L 0xb00a | ||
49 | |||
45 | #define to_keystone_pcie(x) container_of(x, struct keystone_pcie, pp) | 50 | #define to_keystone_pcie(x) container_of(x, struct keystone_pcie, pp) |
46 | 51 | ||
52 | static void quirk_limit_mrrs(struct pci_dev *dev) | ||
53 | { | ||
54 | struct pci_bus *bus = dev->bus; | ||
55 | struct pci_dev *bridge = bus->self; | ||
56 | static const struct pci_device_id rc_pci_devids[] = { | ||
57 | { PCI_DEVICE(PCI_VENDOR_ID_TI, PCIE_RC_K2HK), | ||
58 | .class = PCI_CLASS_BRIDGE_PCI << 8, .class_mask = ~0, }, | ||
59 | { PCI_DEVICE(PCI_VENDOR_ID_TI, PCIE_RC_K2E), | ||
60 | .class = PCI_CLASS_BRIDGE_PCI << 8, .class_mask = ~0, }, | ||
61 | { PCI_DEVICE(PCI_VENDOR_ID_TI, PCIE_RC_K2L), | ||
62 | .class = PCI_CLASS_BRIDGE_PCI << 8, .class_mask = ~0, }, | ||
63 | { 0, }, | ||
64 | }; | ||
65 | |||
66 | if (pci_is_root_bus(bus)) | ||
67 | return; | ||
68 | |||
69 | /* look for the host bridge */ | ||
70 | while (!pci_is_root_bus(bus)) { | ||
71 | bridge = bus->self; | ||
72 | bus = bus->parent; | ||
73 | } | ||
74 | |||
75 | if (bridge) { | ||
76 | /* | ||
77 | * Keystone PCI controller has a h/w limitation of | ||
78 | * 256 bytes maximum read request size. It can't handle | ||
79 | * anything higher than this. So force this limit on | ||
80 | * all downstream devices. | ||
81 | */ | ||
82 | if (pci_match_id(rc_pci_devids, bridge)) { | ||
83 | if (pcie_get_readrq(dev) > 256) { | ||
84 | dev_info(&dev->dev, "limiting MRRS to 256\n"); | ||
85 | pcie_set_readrq(dev, 256); | ||
86 | } | ||
87 | } | ||
88 | } | ||
89 | } | ||
90 | DECLARE_PCI_FIXUP_ENABLE(PCI_ANY_ID, PCI_ANY_ID, quirk_limit_mrrs); | ||
91 | |||
47 | static int ks_pcie_establish_link(struct keystone_pcie *ks_pcie) | 92 | static int ks_pcie_establish_link(struct keystone_pcie *ks_pcie) |
48 | { | 93 | { |
49 | struct pcie_port *pp = &ks_pcie->pp; | 94 | struct pcie_port *pp = &ks_pcie->pp; |