AnsweredAssumed Answered

How to force iMX6 PCIe into Gen 1 mode

Question asked by Alex Harford on Oct 4, 2013
Latest reply on Oct 13, 2013 by Yixing Kong
Branched to a new discussion

I am evaluating the Sabre SD board with a PCIe switch, and I am having issues getting it to work in Gen 2 mode.

 

This is using the Linux kernel 3.0.35-4.0.0 BSP.

 

I would like to force it into Gen 1 mode for testing, and this patch has worked to get it going for initial bring up.

 

===========================================================================

--- patched-linux-3.0.35-imx/arch/arm/mach-mx6/pcie.c   2013-09-26 14:49:46.000000000 -0700

+++ linux-3.0.35-imx/arch/arm/mach-mx6/pcie.c   2013-09-26 15:37:49.720701981 -0700

@@ -1021,8 +1021,13 @@ static int __devinit imx_pcie_pltfm_prob

        if (!(pdata->type_ep)) {

                /*Only RC: togle the external card's reset */

                card_reset(dev) ;

+               usleep_range(4000, 5000);

 

 

                imx_pcie_regions_setup(dev, dbi_base);

+               usleep_range(4000, 5000);

+                /* Force GEN1 */

+                writel(((readl(dbi_base + LNK_CAP) & 0xfffffff0) | 0x1), dbi_base + LNK_CAP);

+               usleep_range(4000, 5000);

        }

 

 

        pr_info("PCIE: %s start link up.\n", __func__);

 

===========================================================================

 

However, now I am testing suspend to RAM, and I am having problems getting it working. Is there a recommended way I can force it to Gen1 that will survive a suspend/resume cycle? Note that I have applied the L2 reset patch and I am able to successfully suspend/resume using an e1000e based card. I have tried rewriting the LNK_CAP register after coming out of suspend but it does not seem to have any effect. I am thinking that I'm simply not setting it at the correct time, and hope that someone can suggest where it should go.

Outcomes