[PATCH 5/5] phy: rockchip-snps-pcie3: Only check PHY1 status when using it
Shawn Lin
shawn.lin at rock-chips.com
Tue Dec 23 23:10:10 PST 2025
RK3588_LANE_AGGREGATION and RK3588_BIFURCATION_LANE_2_3 should be
used to check if it need to check PHY1 status. Because in other
cases, only PHY0 could show locked status.
Signed-off-by: Shawn Lin <shawn.lin at rock-chips.com>
---
drivers/phy/rockchip/phy-rockchip-snps-pcie3.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c b/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c
index 6cc38e3..36b2142 100644
--- a/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c
+++ b/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c
@@ -183,6 +183,7 @@ static int rockchip_p3phy_rk3588_init(struct rockchip_p3phy_priv *priv)
}
reg = mode;
+ priv->pcie30_phymode = mode;
regmap_write(priv->phy_grf, RK3588_PCIE3PHY_GRF_CMN_CON0,
RK3588_PCIE30_PHY_MODE_EN | reg);
@@ -208,10 +209,13 @@ static int rockchip_p3phy_rk3588_calibrate(struct rockchip_p3phy_priv *priv)
RK3588_PCIE3PHY_GRF_PHY0_STATUS1,
reg, RK3588_SRAM_INIT_DONE(reg),
0, RK_SRAM_INIT_TIMEOUT_US);
- ret |= regmap_read_poll_timeout(priv->phy_grf,
- RK3588_PCIE3PHY_GRF_PHY1_STATUS1,
- reg, RK3588_SRAM_INIT_DONE(reg),
- 0, RK_SRAM_INIT_TIMEOUT_US);
+ if (priv->pcie30_phymode & (RK3588_LANE_AGGREGATION | RK3588_BIFURCATION_LANE_2_3)) {
+ ret |= regmap_read_poll_timeout(priv->phy_grf,
+ RK3588_PCIE3PHY_GRF_PHY1_STATUS1,
+ reg, RK3588_SRAM_INIT_DONE(reg),
+ 0, RK_SRAM_INIT_TIMEOUT_US);
+ }
+
if (ret)
dev_err(&priv->phy->dev, "lock failed 0x%x, check input refclk and power supply\n",
reg);
--
2.7.4
More information about the Linux-rockchip
mailing list