Skip to content

Commit de22e20

Browse files
nxpfranklibjorn-helgaas
authored andcommitted
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: 8026f2d ("PCI: imx6: Call common PHY API to set mode, speed, and submode") Link: https://lore.kernel.org/r/20241119-pci_fixup_addr-v8-6-c4bfa5193288@nxp.com Signed-off-by: Frank Li <Frank.Li@nxp.com> [kwilczynski: commit log] Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
1 parent 1372509 commit de22e20

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/pci/controller/dwc/pci-imx6.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,9 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp)
968968
goto err_clk_disable;
969969
}
970970

971-
ret = phy_set_mode_ext(imx_pcie->phy, PHY_MODE_PCIE, PHY_MODE_PCIE_RC);
971+
ret = phy_set_mode_ext(imx_pcie->phy, PHY_MODE_PCIE,
972+
imx_pcie->drvdata->mode == DW_PCIE_EP_TYPE ?
973+
PHY_MODE_PCIE_EP : PHY_MODE_PCIE_RC);
972974
if (ret) {
973975
dev_err(dev, "unable to set PCIe PHY mode\n");
974976
goto err_phy_exit;

0 commit comments

Comments
 (0)