PCI: k1x: Add hold_phy_rst before phy enable

During the probe and resume processes, phy_enable will clear the app_hold_phy_rst bit.
app_hold_phy_rst must be set before this bit is cleared.

Change-Id: Ia9332c041199095dbfb9c0059b4704db743f189a
This commit is contained in:
huzhen
2025-07-14 13:54:51 +08:00
committed by 张猛
parent 120edd4c60
commit fdee3b35a0

View File

@@ -1547,6 +1547,19 @@ static int k1x_power_on(struct k1x_pcie *k1x, int on)
return 0;
}
static void k1x_pcie_hold_phy_rst(struct k1x_pcie *k1x)
{
u32 reg;
reg = k1x_pcie_readl(k1x, PCIECTRL_K1X_CONF_DEVICE_CMD);
if (reg & APP_HOLD_PHY_RST) {
dev_dbg(k1x->pci->dev, "k1x_pcie_hold_phy_rst: phy reset already held\n");
return;
}
reg |= APP_HOLD_PHY_RST;
k1x_pcie_writel(k1x, PCIECTRL_K1X_CONF_DEVICE_CMD, reg);
}
static int k1x_pcie_probe(struct platform_device *pdev)
{
u32 reg;
@@ -1650,6 +1663,8 @@ static int k1x_pcie_probe(struct platform_device *pdev)
k1x->pci = pci;
platform_set_drvdata(pdev, k1x);
k1x_pcie_hold_phy_rst(k1x);
pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev);
pm_runtime_get_noresume(&pdev->dev);
@@ -1818,6 +1833,8 @@ static int k1x_pcie_resume_noirq(struct device *dev)
struct dw_pcie_rp *pp = &pci->pp;
u32 reg;
k1x_pcie_hold_phy_rst(k1x);
/* soft no reset */
reg = k1x_pcie_readl(k1x, PCIE_CTRL_LOGIC);
reg &= ~(1 << 0);