phy: rockchip-snps-pcie3: add support for rockchip,rx-common-refclk-mode
authorNiklas Cassel <cassel@kernel.org>
Fri, 12 Apr 2024 12:58:16 +0000 (14:58 +0200)
committerVinod Koul <vkoul@kernel.org>
Sat, 13 Apr 2024 06:06:15 +0000 (11:36 +0530)
commita1fe1eca0d8be69ccc1f3d615e5a529df1c82e66
treefcbe12d6e4d1b6f18e6bcadbcd37f9ee45335ea0
parent46492d10067660785a09db4ce9244545126a17b8
phy: rockchip-snps-pcie3: add support for rockchip,rx-common-refclk-mode

>From the RK3588 Technical Reference Manual, Part1,
section 6.19 PCIe3PHY_GRF Register Description:
"rxX_cmn_refclk_mode"
RX common reference clock mode for lane X. This mode should be enabled
only when the far-end and near-end devices are running with a common
reference clock.

The hardware reset value for this field is 0x1 (enabled).
Note that this register field is only available on RK3588, not on RK3568.

The link training either fails or is highly unstable (link state will jump
continuously between L0 and recovery) when this mode is enabled while
using an endpoint running in Separate Reference Clock with No SSC (SRNS)
mode or Separate Reference Clock with SSC (SRIS) mode.
(Which is usually the case when using a real SoC as endpoint, e.g. the
RK3588 PCIe controller can run in both Root Complex and Endpoint mode.)

Add support for the device tree property rockchip,rx-common-refclk-mode,
such that the PCIe PHY can be used in configurations where the Root
Complex and Endpoint are not using a common reference clock.

Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://lore.kernel.org/r/20240412125818.17052-3-cassel@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/rockchip/phy-rockchip-snps-pcie3.c