summaryrefslogtreecommitdiff
path: root/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c')
-rw-r--r--drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c b/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c
index 43dede26cc7c..d07cddb9c404 100644
--- a/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c
+++ b/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c
@@ -81,12 +81,27 @@ static bool ls_g4_pcie_is_bridge(struct ls_g4_pcie *pcie)
return header_type == PCI_HEADER_TYPE_BRIDGE;
}
+static void workaround_A011451(struct ls_g4_pcie *pcie)
+{
+ struct mobiveil_pcie *mv_pci = &pcie->pci;
+ u32 val;
+
+ /* Set ACK latency timeout */
+ val = mobiveil_csr_readl(mv_pci, GPEX_ACK_REPLAY_TO);
+ val &= ~(ACK_LAT_TO_VAL_MASK << ACK_LAT_TO_VAL_SHIFT);
+ val |= (4 << ACK_LAT_TO_VAL_SHIFT);
+ mobiveil_csr_writel(mv_pci, val, GPEX_ACK_REPLAY_TO);
+}
+
static int ls_g4_pcie_host_init(struct mobiveil_pcie *pci)
{
struct ls_g4_pcie *pcie = to_ls_g4_pcie(pci);
pcie->rev = mobiveil_csr_readb(pci, PCI_REVISION_ID);
+ if (pcie->rev == REV_1_0)
+ workaround_A011451(pcie);
+
return 0;
}