]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: imx6: Fix IMX6SX_GPR12_PCIE_TEST_POWERDOWN handling
authorRichard Zhu <hongxing.zhu@nxp.com>
Thu, 19 Mar 2026 09:08:44 +0000 (17:08 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 18 May 2026 22:52:05 +0000 (17:52 -0500)
The IMX6SX_GPR12_PCIE_TEST_POWERDOWN bit does not control the PCIe
reference clock on i.MX6SX. Instead, it is part of i.MX6SX PCIe core
reset sequence.

Move the IMX6SX_GPR12_PCIE_TEST_POWERDOWN assertion/deassertion into
the core reset functions to properly reflect its purpose. Remove the
.enable_ref_clk() callback for i.MX6SX since it was incorrectly
manipulating this bit.

Fixes: e3c06cd063d6 ("PCI: imx6: Add initial imx6sx support")
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260319090844.444987-1-hongxing.zhu@nxp.com
drivers/pci/controller/dwc/pci-imx6.c

index e35044cc52185ce884e2ec13a102cd827012a478..1034ac5c5f5c1509d4af6718148512634d67f6e6 100644 (file)
@@ -665,14 +665,6 @@ static int imx_pcie_attach_pd(struct device *dev)
        return 0;
 }
 
-static int imx6sx_pcie_enable_ref_clk(struct imx_pcie *imx_pcie, bool enable)
-{
-       regmap_update_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR12,
-                          IMX6SX_GPR12_PCIE_TEST_POWERDOWN,
-                          enable ? 0 : IMX6SX_GPR12_PCIE_TEST_POWERDOWN);
-       return 0;
-}
-
 static int imx6q_pcie_enable_ref_clk(struct imx_pcie *imx_pcie, bool enable)
 {
        if (enable) {
@@ -786,6 +778,9 @@ static int imx6sx_pcie_core_reset(struct imx_pcie *imx_pcie, bool assert)
        if (assert)
                regmap_set_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR12,
                                IMX6SX_GPR12_PCIE_TEST_POWERDOWN);
+       else
+               regmap_clear_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR12,
+                                 IMX6SX_GPR12_PCIE_TEST_POWERDOWN);
 
        /* Force PCIe PHY reset */
        regmap_update_bits(imx_pcie->iomuxc_gpr, IOMUXC_GPR5, IMX6SX_GPR5_PCIE_BTNRST_RESET,
@@ -1877,7 +1872,6 @@ static const struct imx_pcie_drvdata drvdata[] = {
                .mode_off[0] = IOMUXC_GPR12,
                .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE,
                .init_phy = imx6sx_pcie_init_phy,
-               .enable_ref_clk = imx6sx_pcie_enable_ref_clk,
                .core_reset = imx6sx_pcie_core_reset,
                .ops = &imx_pcie_host_ops,
        },