aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Marangi2024-06-24 23:03:38 +0200
committerTom Rini2024-07-08 11:45:50 -0600
commitca54ef2434e4451f5f07bce201fee4d3a32b02ca (patch)
treec475ace46a5a8f2442e4a9a86d3b6ce6dd89617e
parent63d0f683efb70399a93ea7f95eeb78062cc613f0 (diff)
pci: mediatek: make pcie-phy optional for gen3
Set pcie-phy optional for PCIe gen3. MT7988 doesn't require it and making it mandatory prevent the driver to correctly probe. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
-rw-r--r--drivers/pci/pcie_mediatek_gen3.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/pci/pcie_mediatek_gen3.c b/drivers/pci/pcie_mediatek_gen3.c
index 673813b8b75..0149edae0bf 100644
--- a/drivers/pci/pcie_mediatek_gen3.c
+++ b/drivers/pci/pcie_mediatek_gen3.c
@@ -284,9 +284,8 @@ static int mtk_pcie_power_on(struct udevice *dev)
pcie->priv = dev;
- err = generic_phy_get_by_name(dev, "pcie-phy", &pcie->phy);
- if (err)
- return err;
+ /* pcie-phy is optional (mt7988 doesn't need it) */
+ generic_phy_get_by_name(dev, "pcie-phy", &pcie->phy);
/*
* Upstream linux kernel devine these clock without clock-names
@@ -308,13 +307,15 @@ static int mtk_pcie_power_on(struct udevice *dev)
if (err)
return err;
- err = generic_phy_init(&pcie->phy);
- if (err)
- return err;
+ if (pcie->phy.dev) {
+ err = generic_phy_init(&pcie->phy);
+ if (err)
+ return err;
- err = generic_phy_power_on(&pcie->phy);
- if (err)
- goto err_phy_on;
+ err = generic_phy_power_on(&pcie->phy);
+ if (err)
+ goto err_phy_on;
+ }
err = clk_enable(&pcie->pl_250m_ck);
if (err)
@@ -348,7 +349,8 @@ err_clk_tl_26m:
err_clk_pl_250m:
clk_disable(&pcie->pl_250m_ck);
err_phy_on:
- generic_phy_exit(&pcie->phy);
+ if (pcie->phy.dev)
+ generic_phy_exit(&pcie->phy);
return err;
}