Skip to content

Commit 3fce0e8

Browse files
Gateworksbjorn-helgaas
authored andcommitted
PCI: imx6: Delay enabling reference clock for SS until it stabilizes
According to the IMX6 reference manuals, REF_SSP_EN (Reference clock enable for SS function) must remain deasserted until the reference clock is running at the appropriate frequency. Delay enabling the reference clock for the SS function until it has stabilized. This prevents a high link failure rate (>5%) on certain IMX6 boards at various temperatures. [bhelgaas: reword changelog slightly] Tested-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Lucas Stach <l.stach@pengutronix.de>
1 parent 61da50d commit 3fce0e8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/pci/host/pci-imx6.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,6 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)
257257
struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp);
258258
int ret;
259259

260-
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
261-
IMX6Q_GPR1_PCIE_TEST_PD, 0 << 18);
262-
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
263-
IMX6Q_GPR1_PCIE_REF_CLK_EN, 1 << 16);
264-
265260
ret = clk_prepare_enable(imx6_pcie->pcie_phy);
266261
if (ret) {
267262
dev_err(pp->dev, "unable to enable pcie_phy clock\n");
@@ -283,6 +278,12 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)
283278
/* allow the clocks to stabilize */
284279
usleep_range(200, 500);
285280

281+
/* power up core phy and enable ref clock */
282+
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
283+
IMX6Q_GPR1_PCIE_TEST_PD, 0 << 18);
284+
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
285+
IMX6Q_GPR1_PCIE_REF_CLK_EN, 1 << 16);
286+
286287
/* Some boards don't have PCIe reset GPIO. */
287288
if (gpio_is_valid(imx6_pcie->reset_gpio)) {
288289
gpio_set_value(imx6_pcie->reset_gpio, 0);

0 commit comments

Comments
 (0)