Skip to contentSkip to conversation

PCI: imx6: Fix reference clock source selection

PATCH Applied Franz Schnyder 3 participants 3 messages Mar 25 – Apr 4

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: imx6: Fix reference clock source selection

From: Franz Schnyder <[email protected]>

In the PCIe PHY init for the iMX95, the reference clock source selection uses a conditional instead of always passing the mask. This currently breaks functionality if the internal refclk is used.

Pass always IMX95_PCIE_REF_USE_PAD as the mask and clear the bit if external refclk is not used.

Fixes d8574ce57d76 ("PCI: imx6: Add external reference clock input mode support")
---
 drivers/pci/controller/dwc/pci-imx6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/pci-imx6.c +2 -2
index 81a7093494c8..e0580d6efa57 100644
@@ -268,8 +268,8 @@ static int imx95_pcie_init_phy(struct imx_pcie *imx_pcie)
 			IMX95_PCIE_PHY_CR_PARA_SEL);
 
 	regmap_update_bits(imx_pcie->iomuxc_gpr, IMX95_PCIE_PHY_GEN_CTRL,
-			   ext ? IMX95_PCIE_REF_USE_PAD : 0,
-			   IMX95_PCIE_REF_USE_PAD);
+			   IMX95_PCIE_REF_USE_PAD,
+			   ext ? IMX95_PCIE_REF_USE_PAD : 0);
 	regmap_update_bits(imx_pcie->iomuxc_gpr, IMX95_PCIE_SS_RW_REG_0,
 			   IMX95_PCIE_REF_CLKEN,
 			   ext ? 0 : IMX95_PCIE_REF_CLKEN);
Signature · 1 line
2.43.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 22 lines

-----Original Message-----
From: Franz Schnyder <[email protected]>
Sent: 2026年3月25日 17:31
To: Hongxing Zhu <[email protected]>; Lucas Stach <[email protected]>; Lorenzo Pieralisi <[email protected]>; Krzysztof Wilczyński <[email protected]>; Manivannan Sadhasivam <[email protected]>; Rob Herring <[email protected]>; Bjorn Helgaas <[email protected]>; Frank Li <[email protected]>; Sascha Hauer <[email protected]>; Pengutronix Kernel Team <[email protected]>; Fabio Estevam <[email protected]>
Cc: Franz Schnyder <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; Francesco Dolcini <[email protected]>; [email protected]
Subject: [PATCH v1] PCI: imx6: Fix reference clock source selection

From: Franz Schnyder <[email protected]>

In the PCIe PHY init for the iMX95, the reference clock source selection uses a conditional instead of always passing the mask. This currently breaks functionality if the internal refclk is used.

Quoted 7 lines

Pass always IMX95_PCIE_REF_USE_PAD as the mask and clear the bit if external refclk is not used.

Fixes d8574ce57d76 ("PCI: imx6: Add external reference clock input mode

support")

Apologies, I made an error when organizing the code.
This bug was not caught during local testing because the external OSC clock
input is permanently enabled on the EVK board.

Best Regards
Richard Zhu

Quoted 24 lines
---
 drivers/pci/controller/dwc/pci-imx6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/pci-imx6.c +2 -2
index 81a7093494c8..e0580d6efa57 100644
@@ -268,8 +268,8 @@ static int imx95_pcie_init_phy(struct imx_pcie
 *imx_pcie)
 			IMX95_PCIE_PHY_CR_PARA_SEL);
 
 	regmap_update_bits(imx_pcie->iomuxc_gpr,
 IMX95_PCIE_PHY_GEN_CTRL,
-			   ext ? IMX95_PCIE_REF_USE_PAD : 0,
-			   IMX95_PCIE_REF_USE_PAD);
+			   IMX95_PCIE_REF_USE_PAD,
+			   ext ? IMX95_PCIE_REF_USE_PAD : 0);
 	regmap_update_bits(imx_pcie->iomuxc_gpr, IMX95_PCIE_SS_RW_REG_0,
drivers/pci/controller/dwc/pci-imx6.c +0 -1
 			   IMX95_PCIE_REF_CLKEN,
 			   ext ? 0 : IMX95_PCIE_REF_CLKEN);
--

2.43.0

#2 lore raw
In reply to Franz Schnyder
Quoted 8 lines · Franz Schnyder

In the PCIe PHY init for the iMX95, the reference clock source selection uses a conditional instead of always passing the mask. This currently breaks functionality if the internal refclk is used.

Pass always IMX95_PCIE_REF_USE_PAD as the mask and clear the bit if external refclk is not used.

[...]

Applied, thanks!

[1/1] PCI: imx6: Fix reference clock source selection

      commit: 575d7268ca07fcb1d1a50399e1399ba60df3cb27

Best regards,

Signature · 1 line
Manivannan Sadhasivam <[email protected]>