]> git.karo-electronics.de Git - linux-beck.git/commitdiff
PCI: tegra: Make sure the PCIe PLL is really reset
authorEric Yuen <eyuen@nvidia.com>
Tue, 26 Aug 2014 15:11:37 +0000 (17:11 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 16 Sep 2014 22:55:33 +0000 (16:55 -0600)
Depending on the prior state of the controller, the PLL reset may not be
pulsed.  Clear the register bit and set it after a small delay to ensure
that the PLL is really reset.

Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Eric Yuen <eyuen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/host/pci-tegra.c

index 6329be3d4695ed3aa29783735f915a2cce7a4e0f..79fd92c969a971c0e8be65902d02220c1211cb3b 100644 (file)
@@ -849,6 +849,13 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie)
        value |= PADS_PLL_CTL_REFCLK_INTERNAL_CML | soc->tx_ref_sel;
        pads_writel(pcie, value, soc->pads_pll_ctl);
 
+       /* reset PLL */
+       value = pads_readl(pcie, soc->pads_pll_ctl);
+       value &= ~PADS_PLL_CTL_RST_B4SM;
+       pads_writel(pcie, value, soc->pads_pll_ctl);
+
+       usleep_range(20, 100);
+
        /* take PLL out of reset  */
        value = pads_readl(pcie, soc->pads_pll_ctl);
        value |= PADS_PLL_CTL_RST_B4SM;