]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
Revert "Revert "pcie: host: tegra: enable refclk during boot""
authorVidya Sagar <vidyas@nvidia.com>
Thu, 8 Jan 2015 05:44:54 +0000 (11:14 +0530)
committerVenkat Moganty <vmoganty@nvidia.com>
Mon, 6 Apr 2015 09:23:36 +0000 (02:23 -0700)
This reverts commit 048120657bd7ddf8208d44c2d12933455814fd1e.
Also disable clk_override_en excluding laguna t124 and t132
due to HW bug

Bug 200066253

Change-Id: Ic3024a4c197e22492eea001cd1cc200aec4dad28
Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
Reviewed-on: http://git-master/r/670534
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Shreshtha Sahu <ssahu@nvidia.com>
Tested-by: Shreshtha Sahu <ssahu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
drivers/pci/host/pci-tegra.c

index cc9cd635c5db6661d4cb63851f9f1d5214145613..5e15f3822199ba68eab044e6d2d4283c117d4ed6 100644 (file)
@@ -1657,9 +1657,11 @@ static void tegra_pcie_port_enable(struct tegra_pcie_port *port)
 
        PR_FUNC_LINE;
 
-       /* enable reference clock */
+       /* enable reference clock. Enable SW override so as to allow device
+          to get enumerated. SW override will be removed after enumeration
+       */
        value = afi_readl(port->pcie, ctrl);
-       value |= AFI_PEX_CTRL_REFCLK_EN;
+       value |= (AFI_PEX_CTRL_REFCLK_EN | AFI_PEX_CTRL_OVERRIDE_EN);
        /* t124 doesn't support pll power down due to RTL bug and some */
        /* platforms don't support clkreq, both needs to disable clkreq and */
        /* enable refclk override to have refclk always ON independent of EP */
@@ -1753,6 +1755,7 @@ static bool t210_war;
 static void tegra_pcie_apply_sw_war(struct tegra_pcie_port *port,
                                bool enum_done)
 {
+       unsigned long ctrl;
        unsigned int data;
 #if defined(CONFIG_ARCH_TEGRA_21x_SOC)
        struct tegra_pcie *pcie = port->pcie;
@@ -1769,6 +1772,13 @@ static void tegra_pcie_apply_sw_war(struct tegra_pcie_port *port,
                t210_war = 1;
 #endif
        if (enum_done) {
+               if (!port->disable_clock_request) {
+                       /* Remove SW override for REFCLK */
+                       ctrl = tegra_pcie_port_get_pex_ctrl(port);
+                       data = afi_readl(port->pcie, ctrl);
+                       data &= ~(AFI_PEX_CTRL_OVERRIDE_EN);
+                       afi_writel(port->pcie, data, ctrl);
+               }
                /* disable msi for port driver to avoid panic */
                for_each_pci_dev(pdev)
                        if (pci_pcie_type(pdev) == PCI_EXP_TYPE_ROOT_PORT)
@@ -3006,7 +3016,7 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
                if (!(rp->base))
                        return -EADDRNOTAVAIL;
                rp->disable_clock_request = of_property_read_bool(port,
-                       "nvidia,disable_clock_request");
+                       "nvidia,disable-clock-request");
                rp->status = of_device_is_available(port);
 
                list_add_tail(&rp->list, &pcie->ports);