MLK-14644 PCI: imx: toggle the perst after the release of rc's reset
authorRichard Zhu <hongxing.zhu@nxp.com>
Mon, 10 Apr 2017 05:36:23 +0000 (13:36 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:21:53 +0000 (15:21 -0500)
imxcommunity reports that Intel Wireless 3160 doesn't
work if the perst# is toggled before the release of rc
controller's reset.

Specification doesn't specify the exactly sequence of
the toggle of the perst# and the release of the rc
controller reset. Just find the following description
in the chapter 4.2.2 of the PCI Local Bus Specification.

"The system must guarantee that the bus remains in the idle
state for a minimum time delay following the deassertion
of RST# to a device before the system will permit the first
assertion of FRAME#."

Toggle the perst# after the release of rc's reset to
fix the issue.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
(cherry picked from commit ba75c5e4795ab36d7765fe3ac03f0c4320828c78)

drivers/pci/host/pci-imx6.c

index d81e2af..b0b369e 100644 (file)
@@ -460,16 +460,6 @@ static void imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie)
        /* allow the clocks to stabilize */
        udelay(200);
 
-       /* Some boards don't have PCIe reset GPIO. */
-       if (gpio_is_valid(imx6_pcie->reset_gpio)) {
-               gpio_set_value_cansleep(imx6_pcie->reset_gpio,
-                                       imx6_pcie->gpio_active_high);
-               mdelay(20);
-               gpio_set_value_cansleep(imx6_pcie->reset_gpio,
-                                       !imx6_pcie->gpio_active_high);
-               mdelay(20);
-       }
-
        switch (imx6_pcie->variant) {
        case IMX6SX:
                regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR5,
@@ -540,6 +530,16 @@ static void imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie)
                break;
        }
 
+       /* Some boards don't have PCIe reset GPIO. */
+       if (gpio_is_valid(imx6_pcie->reset_gpio)) {
+               gpio_set_value_cansleep(imx6_pcie->reset_gpio,
+                                       imx6_pcie->gpio_active_high);
+               mdelay(20);
+               gpio_set_value_cansleep(imx6_pcie->reset_gpio,
+                                       !imx6_pcie->gpio_active_high);
+               mdelay(20);
+       }
+
        return;
 
 err_ref_clk: