Further to my previous post, my systems have now had a reasonable amount of testing without further incident. Therefore, for Linux kernel 3.14.28 I updated the following sections in "drivers/pci/host/pci-imx6.c" as shown below.
Thanks go to Igor and the community.
@@ -276,6 +276,8 @@
val |= PCIE_PL_PFLR_FORCE_LINK;
writel(val, pp->dbi_base + PCIE_PL_PFLR);
+ usleep_range(30, 50);
+
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
IMX6Q_GPR12_PCIE_CTL_2, 0);
}
@@ -332,7 +334,7 @@
} else {
/* power up core phy and enable ref clock */
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
- IMX6Q_GPR1_PCIE_TEST_PD, 0);
+ IMX6Q_GPR1_PCIE_TEST_PD, 0 << 18);
/* sata_ref is not used by pcie on imx6sx */
ret = clk_prepare_enable(imx6_pcie->ref_100m);
@@ -355,6 +357,13 @@
/* allow the clocks to stabilize */
udelay(200);
+ if(!is_imx6sx_pcie(imx6_pcie))
+ {
+ udelay(10);
+ regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, IMX6Q_GPR1_PCIE_REF_CLK_EN, 1 << 16);
+ }
+
/* Some boards don't have PCIe reset GPIO. */
if (gpio_is_valid(imx6_pcie->reset_gpio)) {
gpio_set_value_cansleep(imx6_pcie->reset_gpio, 0);
@@ -442,7 +451,7 @@
int count = 200;
while (!dw_pcie_link_up(pp)) {
- udelay(100);
+ usleep_range(100, 1000);
if (--count)
continue;