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>
This commit is contained in:
Christian Marangi
2024-06-24 23:03:38 +02:00
committed by Tom Rini
parent 63d0f683ef
commit ca54ef2434

View File

@@ -284,9 +284,8 @@ static int mtk_pcie_power_on(struct udevice *dev)
pcie->priv = dev; pcie->priv = dev;
err = generic_phy_get_by_name(dev, "pcie-phy", &pcie->phy); /* pcie-phy is optional (mt7988 doesn't need it) */
if (err) generic_phy_get_by_name(dev, "pcie-phy", &pcie->phy);
return err;
/* /*
* Upstream linux kernel devine these clock without clock-names * Upstream linux kernel devine these clock without clock-names
@@ -308,13 +307,15 @@ static int mtk_pcie_power_on(struct udevice *dev)
if (err) if (err)
return err; return err;
err = generic_phy_init(&pcie->phy); if (pcie->phy.dev) {
if (err) err = generic_phy_init(&pcie->phy);
return err; if (err)
return err;
err = generic_phy_power_on(&pcie->phy); err = generic_phy_power_on(&pcie->phy);
if (err) if (err)
goto err_phy_on; goto err_phy_on;
}
err = clk_enable(&pcie->pl_250m_ck); err = clk_enable(&pcie->pl_250m_ck);
if (err) if (err)
@@ -348,7 +349,8 @@ err_clk_tl_26m:
err_clk_pl_250m: err_clk_pl_250m:
clk_disable(&pcie->pl_250m_ck); clk_disable(&pcie->pl_250m_ck);
err_phy_on: err_phy_on:
generic_phy_exit(&pcie->phy); if (pcie->phy.dev)
generic_phy_exit(&pcie->phy);
return err; return err;
} }