[PATCH 3/5] phy: rockchip-snps-pcie3: Increase sram init timeout
Shawn Lin
shawn.lin at rock-chips.com
Wed Jan 14 16:30:58 PST 2026
在 2026/01/14 星期三 21:29, Vinod Koul 写道:
> On 24-12-25, 15:10, Shawn Lin wrote:
>> Per massive test, 500us is not enough for all chips, increase it
>> to 20000us for worse case recommended.
>>
>> Signed-off-by: Shawn Lin <shawn.lin at rock-chips.com>
>> ---
>>
>> drivers/phy/rockchip/phy-rockchip-snps-pcie3.c | 10 +++++++---
>> 1 file changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c b/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c
>> index 9933cda..f5a5d0af 100644
>> --- a/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c
>> +++ b/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c
>> @@ -19,6 +19,9 @@
>> #include <linux/regmap.h>
>> #include <linux/reset.h>
>>
>> +/* Common definition */
>> +#define RK_SRAM_INIT_TIMEOUT_US 20000
>> +
>> /* Register for RK3568 */
>> #define GRF_PCIE30PHY_CON1 0x4
>> #define GRF_PCIE30PHY_CON6 0x18
>> @@ -28,6 +31,7 @@
>> #define GRF_PCIE30PHY_WR_EN (0xf << 16)
>> #define SRAM_INIT_DONE(reg) (reg & BIT(14))
>>
>> +
>
> why this empty line here?
>
Oops, will fix it.
>> #define RK3568_BIFURCATION_LANE_0_1 BIT(0)
>>
>> /* Register for RK3588 */
>> @@ -134,7 +138,7 @@ static int rockchip_p3phy_rk3568_calibrate(struct rockchip_p3phy_priv *priv)
>> ret = regmap_read_poll_timeout(priv->phy_grf,
>> GRF_PCIE30PHY_STATUS0,
>> reg, SRAM_INIT_DONE(reg),
>> - 0, 500);
>> + 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);
>> @@ -203,11 +207,11 @@ static int rockchip_p3phy_rk3588_calibrate(struct rockchip_p3phy_priv *priv)
>> ret = regmap_read_poll_timeout(priv->phy_grf,
>> RK3588_PCIE3PHY_GRF_PHY0_STATUS1,
>> reg, RK3588_SRAM_INIT_DONE(reg),
>> - 0, 500);
>> + 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, 500);
>> + 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