pcie: host: disable AFI dynamic clock gating
Ken Chang [Tue, 25 Apr 2017 04:46:02 +0000 (12:46 +0800)]
Override AFI clock enable to disable dynamic clock gating logic.

Bug 200366033

Change-Id: I15a4f67f0a0fd0fb5d28504f9317a9228fca9531
Reviewed-on: http://git-master/r/1469192
(cherry picked from commit fbacedca8e25ebc5400191156316efc52edc3888)
Signed-off-by: Ken Chang <kenc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1602161
GVS: Gerrit_Virtual_Submit
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Sandipan Patra <spatra@nvidia.com>
Tested-by: Sandipan Patra <spatra@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

drivers/pci/host/pci-tegra.c

index 0ff4576..91e7c6b 100644 (file)
 #define AFI_MSI_EN_VEC7_0                                              0xa8
 
 #define AFI_CONFIGURATION                                              0xac
-#define AFI_CONFIGURATION_EN_FPCI                              (1 << 0)
+#define AFI_CONFIGURATION_EN_FPCI                                      (1 << 0)
+#define AFI_CONFIGURATION_CLKEN_OVERRIDE                               (1 << 31)
 
 #define AFI_FPCI_ERROR_MASKS                                           0xb0
 
@@ -1369,7 +1370,8 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie)
 
        /* Finally enable PCIe */
        val = afi_readl(pcie, AFI_CONFIGURATION);
-       val |=  AFI_CONFIGURATION_EN_FPCI;
+       val |=  (AFI_CONFIGURATION_EN_FPCI |
+                       AFI_CONFIGURATION_CLKEN_OVERRIDE);
        afi_writel(pcie, val, AFI_CONFIGURATION);
 
        val = (AFI_INTR_EN_INI_SLVERR | AFI_INTR_EN_INI_DECERR |