aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/controller
diff options
context:
space:
mode:
authorFrank Li <[email protected]>2024-11-19 19:44:24 +0000
committerBjorn Helgaas <[email protected]>2025-01-16 20:21:53 +0000
commitde22e20589b79f35f92543119c33051f8179dba0 (patch)
tree40622c6b82d926c6d09a6e3567dbe07750145143 /drivers/pci/controller
parentPCI: imx6: Add Refclk for i.MX95 PCIe (diff)
downloadkernel-de22e20589b79f35f92543119c33051f8179dba0.tar.gz
kernel-de22e20589b79f35f92543119c33051f8179dba0.zip
PCI: imx6: Configure PHY based on Root Complex or Endpoint mode
Pass PHY_MODE_PCIE_EP if the PCI controller operates in Endpoint (EP) mode, and fix the Root Complex (RC) mode being hardcoded using a drvdata mode check. Fixes: 8026f2d8e8a9 ("PCI: imx6: Call common PHY API to set mode, speed, and submode") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Frank Li <[email protected]> [kwilczynski: commit log] Signed-off-by: Krzysztof WilczyƄski <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Richard Zhu <[email protected]>
Diffstat (limited to 'drivers/pci/controller')
-rw-r--r--drivers/pci/controller/dwc/pci-imx6.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 4beb12b6e6ea..59d3ce6f9e9b 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -968,7 +968,9 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp)
goto err_clk_disable;
}
- ret = phy_set_mode_ext(imx_pcie->phy, PHY_MODE_PCIE, PHY_MODE_PCIE_RC);
+ ret = phy_set_mode_ext(imx_pcie->phy, PHY_MODE_PCIE,
+ imx_pcie->drvdata->mode == DW_PCIE_EP_TYPE ?
+ PHY_MODE_PCIE_EP : PHY_MODE_PCIE_RC);
if (ret) {
dev_err(dev, "unable to set PCIe PHY mode\n");
goto err_phy_exit;