[PATCH 4/5] phy: rockchip-snps-pcie3: Check more sram init status for RK3588

Alexey Charkov alchark at flipper.net
Fri Nov 13 00:46:51 PST 2026


Hi Shawn,

On Wed, Dec 24, 2025 at 11:10 AM Shawn Lin <shawn.lin at rock-chips.com> wrote:
>
> All the lower 4 bits should be checked which shows the mpllx_state.
>
> Signed-off-by: Shawn Lin <shawn.lin at rock-chips.com>
> ---
>
>  drivers/phy/rockchip/phy-rockchip-snps-pcie3.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c b/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c
> index f5a5d0af..6cc38e3 100644
> --- a/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c
> +++ b/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c
> @@ -43,7 +43,7 @@
>  #define RK3588_PCIE3PHY_GRF_PHY0_LN1_CON1      0x1104
>  #define RK3588_PCIE3PHY_GRF_PHY1_LN0_CON1      0x2004
>  #define RK3588_PCIE3PHY_GRF_PHY1_LN1_CON1      0x2104
> -#define RK3588_SRAM_INIT_DONE(reg)             (reg & BIT(0))
> +#define RK3588_SRAM_INIT_DONE(reg)              ((reg & 0xf) == 0xf)

This breaks PCIe3x4 on my Radxa ROCK 5B, which then cannot find its
NVMe root filesystem. Sebastian's rockchip-devel branch carries this
series, and kernels built from it fail with:

  phy phy-fee80000.phy.13: lock failed 0x7, check input refclk and power supply
  rockchip-dw-pcie a40000000.pcie: phy lock failed
  rockchip-dw-pcie a40000000.pcie: probe with driver rockchip-dw-pcie
failed with error -110

The RK3588 TRM (V1.0, Part 1) describes PCIe3PHY_GRF_PHY{0,1}_STATUS1
as follows:

  bit 0     sram_init_done
  bit 1     pcs_pwr_en     (reset value 1)
  bit 2     pma_pwr_en     (reset value 1)
  bit 3     mplla_state
  bits 5:4  reserved
  bit 6     mpllb_state

So the lower four bits are not all PLL states: bits 1 and 2 are power
switch enables, and the only PLL among them is MPLLA, while MPLLB is
bit 6.

On this board MPLLA is off even on a working link. With this patch
reverted, PHY0_STATUS1 and PHY1_STATUS1 both read 0x47 once the link
has trained at 8 GT/s x4: SRAM initialised, MPLLB running, MPLLA off.
When the check fails they read 0x7, so neither PLL is running yet at
that point, and checking for MPLLB instead would fail too.

Reverting only this patch, with the rest of the series applied
(rockchip-devel at d7436346fc31, v7.4-rc2), brings PCIe3x4 and the
NVMe back.

What is the check meant to catch? If it is PLL lock, which bits, and
at what point, would be right for a link that runs on MPLLB?
Otherwise, sram_init_done (bit 0) alone looks like the right condition
here.

Best regards,
Alexey



More information about the Linux-rockchip mailing list