Skip to contentSkip to conversation

phy: freescale: imx8m-pcie: facing pcie link-up instability

PATCH Applied Marcel Ziswiler 5 participants 10 messages Mar 22, 2024 – Apr 15, 2024

Subsystems (2)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover phy: freescale: imx8m-pcie: facing pcie link-up instability

From: Marcel Ziswiler <[email protected]>

In our automated testing setup, we use Delock Mini-PCIe SATA cards [1]. While this setup has proven very stable overall we noticed upstream on the i.MX8M Mini fails quite regularly (about 50/50) to bring up the PCIe link while with NXP's downstream BSP 5.15.71_2.2.2 it always works. As that old downstream stuff was quite different, I first also tried NXP's latest downstream BSP 6.1.55_2.2.0 which from a PCIe point of view is fairly vanilla, however, also there the PCIe link-up was not stable. Comparing and debugging I noticed that upstream explicitly configures the AUX_PLL_REFCLK_SEL to I_PLL_REFCLK_FROM_SYSPLL while working downstream [2] leaving it at reset defaults of AUX_IN (PLL clock). Unfortunately, the TRM does not mention any further details about this register (both for the i.MX 8M Mini as well as the Plus). Maybe somebody from NXP could further comment on this?

BTW: On the i.MX 8M Plus we have not seen any issues with PCIe with the exact same setup which is why I left it unchanged.

[1] https://www.delock.com/produkt/95233/merkmale.html
[2] https://github.com/nxp-imx/linux-imx/blob/lf-5.15.71-2.2.0/drivers/pci/controller/dwc/pci-imx6.c#L1548

Marcel Ziswiler (1):
phy: freescale: imx8m-pcie: fix pcie link-up instability

 drivers/phy/freescale/phy-fsl-imx8m-pcie.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--
2.44.0

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#1 lore raw

PATCH 1/1 phy: freescale: imx8m-pcie: fix pcie link-up instability

From: Marcel Ziswiler <[email protected]>

Leaving AUX_PLL_REFCLK_SEL at its reset default of AUX_IN (PLL clock) proves to be more stable on the i.MX 8M Mini.

Fixes 1aa97b002258 ("phy: freescale: pcie: Initialize the imx8 pcie standalone phy driver")

---

 drivers/phy/freescale/phy-fsl-imx8m-pcie.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/phy/freescale/phy-fsl-imx8m-pcie.c +4 -2
index b700f52b7b67..11fcb1867118 100644
@@ -110,8 +110,10 @@ static int imx8_pcie_phy_power_on(struct phy *phy)
 		/* Source clock from SoC internal PLL */
 		writel(ANA_PLL_CLK_OUT_TO_EXT_IO_SEL,
 		       imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG062);
-		writel(AUX_PLL_REFCLK_SEL_SYS_PLL,
-		       imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG063);
+		if (imx8_phy->drvdata->variant != IMX8MM) {
+			writel(AUX_PLL_REFCLK_SEL_SYS_PLL,
+			       imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG063);
+		}
 		val = ANA_AUX_RX_TX_SEL_TX | ANA_AUX_TX_TERM;
 		writel(val | ANA_AUX_RX_TERM_GND_EN,
 		       imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG064);

--
2.44.0

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
Reviewed-by on v1 1/1
#2 lore raw

RE: [PATCH v1 1/1] phy: freescale: imx8m-pcie: fix pcie link-up instability

Quoted 15 lines

-----Original Message-----
From: Marcel Ziswiler <[email protected]>
Sent: 2024年3月22日 21:07
To: [email protected]
Cc: dl-linux-imx <[email protected]>; Lucas Stach <[email protected]>; [email protected]; [email protected]; Hongxing Zhu <[email protected]>; [email protected]; Marcel Ziswiler <[email protected]>; Fabio Estevam <[email protected]>; Heiko Stuebner <[email protected]>; Kishon Vijay Abraham I <[email protected]>; Marc Kleine-Budde <[email protected]>; Rob Herring <[email protected]>; Sascha Hauer <[email protected]>; Shawn Guo <[email protected]>; [email protected]; Vinod Koul <[email protected]>; Yang Li <[email protected]>; [email protected]
Subject: [PATCH v1 1/1] phy: freescale: imx8m-pcie: fix pcie link-up instability

Quoted 8 lines

From: Marcel Ziswiler <[email protected]>

Leaving AUX_PLL_REFCLK_SEL at its reset default of AUX_IN (PLL clock) proves to be more stable on the i.MX 8M Mini.

Fixes 1aa97b002258 ("phy: freescale: pcie: Initialize the imx8 pcie standalone

phy driver")

Hi Marcel
I took look back at the validation codes.
i.MX8MM PCIe doesn't configure cmn_reg063 (offset: 0x18C) indeed.

It's my bad to treat i.MX8MM same as i.MX8MP refer to my assumption on the
literal meaning of these bit definitions.

Best Regards
Richard Zhu

Quoted 26 lines

---

 drivers/phy/freescale/phy-fsl-imx8m-pcie.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/phy/freescale/phy-fsl-imx8m-pcie.c +4 -3
index b700f52b7b67..11fcb1867118 100644
@@ -110,8 +110,10 @@ static int imx8_pcie_phy_power_on(struct phy *phy)
 		/* Source clock from SoC internal PLL */
 		writel(ANA_PLL_CLK_OUT_TO_EXT_IO_SEL,
 		       imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG062);
-		writel(AUX_PLL_REFCLK_SEL_SYS_PLL,
-		       imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG063);
+		if (imx8_phy->drvdata->variant != IMX8MM) {
+			writel(AUX_PLL_REFCLK_SEL_SYS_PLL,
+			       imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG063);
+		}
 		val = ANA_AUX_RX_TX_SEL_TX | ANA_AUX_TX_TERM;
 		writel(val | ANA_AUX_RX_TERM_GND_EN,
 		       imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG064);
--

2.44.0

maintainer
#3 lore raw

Re: [PATCH v1 1/1] phy: freescale: imx8m-pcie: fix pcie link-up instability

In reply to Marcel Ziswiler
Quoted 7 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Leaving AUX_PLL_REFCLK_SEL at its reset default of AUX_IN (PLL clock) proves to be more stable on the i.MX 8M Mini.

Fixes 1aa97b002258 ("phy: freescale: pcie: Initialize the imx8 pcie standalone phy driver")

Please dont keep an empty line b/w Fixes and s-o-b line...

Quoted 31 lines

---

 drivers/phy/freescale/phy-fsl-imx8m-pcie.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/phy/freescale/phy-fsl-imx8m-pcie.c +4 -3
index b700f52b7b67..11fcb1867118 100644
@@ -110,8 +110,10 @@ static int imx8_pcie_phy_power_on(struct phy *phy)
 		/* Source clock from SoC internal PLL */
 		writel(ANA_PLL_CLK_OUT_TO_EXT_IO_SEL,
 		       imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG062);
-		writel(AUX_PLL_REFCLK_SEL_SYS_PLL,
-		       imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG063);
+		if (imx8_phy->drvdata->variant != IMX8MM) {
+			writel(AUX_PLL_REFCLK_SEL_SYS_PLL,
+			       imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG063);
+		}
 		val = ANA_AUX_RX_TX_SEL_TX | ANA_AUX_TX_TERM;
 		writel(val | ANA_AUX_RX_TERM_GND_EN,
 		       imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG064);
--

2.44.0

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
Signature · 1 line
~Vinod
maintainer
#4 lore raw

Re: [PATCH v1 1/1] phy: freescale: imx8m-pcie: fix pcie link-up instability

In reply to Marcel Ziswiler
Quoted 4 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Leaving AUX_PLL_REFCLK_SEL at its reset default of AUX_IN (PLL clock) proves to be more stable on the i.MX 8M Mini.

This doesn't apply on phy/fixes

Please rebase

Signature · 1 line
~Vinod
reviewer
#5 lore raw
In reply to Marcel Ziswiler

Hi Marcel,

Quoted 18 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

In our automated testing setup, we use Delock Mini-PCIe SATA cards [1]. While this setup has proven very stable overall we noticed upstream on the i.MX8M Mini fails quite regularly (about 50/50) to bring up the PCIe link while with NXP's downstream BSP 5.15.71_2.2.2 it always works. As that old downstream stuff was quite different, I first also tried NXP's latest downstream BSP 6.1.55_2.2.0 which from a PCIe point of view is fairly vanilla, however, also there the PCIe link-up was not stable. Comparing and debugging I noticed that upstream explicitly configures the AUX_PLL_REFCLK_SEL to I_PLL_REFCLK_FROM_SYSPLL while working downstream [2] leaving it at reset defaults of AUX_IN (PLL clock). Unfortunately, the TRM does not mention any further details about this register (both for the i.MX 8M Mini as well as the Plus). Maybe somebody from NXP could further comment on this?

Quoted 5 lines

BTW: On the i.MX 8M Plus we have not seen any issues with PCIe with the exact same setup which is why I left it unchanged.

[1] https://www.delock.com/produkt/95233/merkmale.html
[2] https://github.com/nxp-imx/linux-imx/blob/lf-5.15.71-2.2.0/drivers/pci/controller/dwc/pci-imx6.c#L1548

The detailed information above is important. It should be in the commit log of the patch IMHO.

Thanks for the fix.

maintainer Applied
#6 lore raw
In reply to Marcel Ziswiler
Quoted 14 lines · Marcel Ziswiler

In our automated testing setup, we use Delock Mini-PCIe SATA cards [1]. While this setup has proven very stable overall we noticed upstream on the i.MX8M Mini fails quite regularly (about 50/50) to bring up the PCIe link while with NXP's downstream BSP 5.15.71_2.2.2 it always works. As that old downstream stuff was quite different, I first also tried NXP's latest downstream BSP 6.1.55_2.2.0 which from a PCIe point of view is fairly vanilla, however, also there the PCIe link-up was not stable. Comparing and debugging I noticed that upstream explicitly configures the AUX_PLL_REFCLK_SEL to I_PLL_REFCLK_FROM_SYSPLL while working downstream [2] leaving it at reset defaults of AUX_IN (PLL clock). Unfortunately, the TRM does not mention any further details about this register (both for the i.MX 8M Mini as well as the Plus). Maybe somebody from NXP could further comment on this?

Quoted 1 line

[...]

Applied, thanks!

[1/1] phy: freescale: imx8m-pcie: fix pcie link-up instability

      commit: 3a161017f1de55cc48be81f6156004c151f32677

Best regards,

Signature · 1 line
~Vinod
#7 lore raw

Hi Vinod

Quoted 16 lines · Vinod Koul
Quoted 14 lines · Marcel Ziswiler

In our automated testing setup, we use Delock Mini-PCIe SATA cards [1]. While this setup has proven very stable overall we noticed upstream on the i.MX8M Mini fails quite regularly (about 50/50) to bring up the PCIe link while with NXP's downstream BSP 5.15.71_2.2.2 it always works. As that old downstream stuff was quite different, I first also tried NXP's latest downstream BSP 6.1.55_2.2.0 which from a PCIe point of view is fairly vanilla, however, also there the PCIe link-up was not stable. Comparing and debugging I noticed that upstream explicitly configures the AUX_PLL_REFCLK_SEL to I_PLL_REFCLK_FROM_SYSPLL while working downstream [2] leaving it at reset defaults of AUX_IN (PLL clock). Unfortunately, the TRM does not mention any further details about this register (both for the i.MX 8M Mini as well as the Plus). Maybe somebody from NXP could further comment on this?

Quoted 6 lines
Quoted 1 line

[...]

Applied, thanks!

[1/1] phy: freescale: imx8m-pcie: fix pcie link-up instability
      commit: 3a161017f1de55cc48be81f6156004c151f32677

Sorry, but it is slightly confusing whether v1 or v2 now got applied. I believe v1 but then only the commit messages differ. However, please note that only v2 included information on how to proceed concerning backporting to stable 6.1.x.

Thanks!

Quoted 3 lines

Best regards,
--
-Vinod

Cheers

Marcel

maintainer
#8 lore raw
Quoted 21 lines · Marcel Ziswiler

Hi Vinod

Quoted 18 lines · Vinod Koul
Quoted 15 lines · Marcel Ziswiler

In our automated testing setup, we use Delock Mini-PCIe SATA cards [1]. While this setup has proven very stable overall we noticed upstream on the i.MX8M Mini fails quite regularly (about 50/50) to bring up the PCIe link while with NXP's downstream BSP 5.15.71_2.2.2 it always works. As that old downstream stuff was quite different, I first also tried NXP's latest downstream BSP 6.1.55_2.2.0 which from a PCIe point of view is fairly vanilla, however, also there the PCIe link-up was not stable. Comparing and debugging I noticed that upstream explicitly configures the AUX_PLL_REFCLK_SEL to I_PLL_REFCLK_FROM_SYSPLL while working downstream [2] leaving it at reset defaults of AUX_IN (PLL clock). Unfortunately, the TRM does not mention any further details about this register (both for the i.MX 8M Mini as well as the Plus). Maybe somebody from NXP could further comment on this?

[...]

Quoted 8 lines
Quoted 4 lines

Applied, thanks!

[1/1] phy: freescale: imx8m-pcie: fix pcie link-up instability
      commit: 3a161017f1de55cc48be81f6156004c151f32677

Sorry, but it is slightly confusing whether v1 or v2 now got applied. I believe v1 but then only the commit messages differ. However, please note that only v2 included information on how to proceed concerning backporting to stable 6.1.x.

V2 was picked, you can check phy tree

Somehow b4 sent email for v1 as well

Signature · 1 line
~Vinod
#9 lore raw

Hi Vinod

Quoted 24 lines · Vinod Koul
Quoted 23 lines · Marcel Ziswiler

Hi Vinod

Quoted 20 lines · Vinod Koul
Quoted 14 lines · Marcel Ziswiler

In our automated testing setup, we use Delock Mini-PCIe SATA cards [1]. While this setup has proven very stable overall we noticed upstream on the i.MX8M Mini fails quite regularly (about 50/50) to bring up the PCIe link while with NXP's downstream BSP 5.15.71_2.2.2 it always works. As that old downstream stuff was quite different, I first also tried NXP's latest downstream BSP 6.1.55_2.2.0 which from a PCIe point of view is fairly vanilla, however, also there the PCIe link-up was not stable. Comparing and debugging I noticed that upstream explicitly configures the AUX_PLL_REFCLK_SEL to I_PLL_REFCLK_FROM_SYSPLL while working downstream [2] leaving it at reset defaults of AUX_IN (PLL clock). Unfortunately, the TRM does not mention any further details about this register (both for the i.MX 8M Mini as well as the Plus). Maybe somebody from NXP could further comment on this?

Quoted 1 line

[...]

Applied, thanks!

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

[1/1] phy: freescale: imx8m-pcie: fix pcie link-up instability
      commit: 3a161017f1de55cc48be81f6156004c151f32677

Sorry, but it is slightly confusing whether v1 or v2 now got applied. I believe v1 but then only the commit messages differ. However, please note that only v2 included information on how to proceed concerning backporting to stable 6.1.x.

V2 was picked, you can check phy tree

Okay, however it uses the commit message of v1 which is rather strange.

Quoted 1 line

Somehow b4 sent email for v1 as well

Cheers

Marcel

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy