On 9/20/2025 2:41 AM, Dmitry Baryshkov wrote: > On Fri, Sep 19, 2025 at 10:24:29PM +0800, Xiangxu Yin wrote: >> Add QCS615-specific configuration for USB/DP PHY, including DP init >> routines, voltage swing tables, and platform data. Add compatible >> "qcs615-qmp-usb3-dp-phy". >> >> Signed-off-by: Xiangxu Yin <xiangxu....@oss.qualcomm.com> >> --- >> drivers/phy/qualcomm/phy-qcom-qmp-usbc.c | 395 >> +++++++++++++++++++++++++++++++ >> 1 file changed, 395 insertions(+) >> >> + >> + writel(0x3f, qmp->dp_tx + QSERDES_V2_TX_TRANSCEIVER_BIAS_EN); >> + writel(0x10, qmp->dp_tx + QSERDES_V2_TX_HIGHZ_DRVR_EN); >> + writel(0x0a, qmp->dp_tx + QSERDES_V2_TX_TX_POL_INV); >> + writel(0x3f, qmp->dp_tx2 + QSERDES_V2_TX_TRANSCEIVER_BIAS_EN); >> + writel(0x10, qmp->dp_tx2 + QSERDES_V2_TX_HIGHZ_DRVR_EN); >> + writel(0x0a, qmp->dp_tx2 + QSERDES_V2_TX_TX_POL_INV); > Are you sure that these don't need to be adjusted based on > qmp->orientation or selected lanes count? > > In fact... I don't see orientation handling for DP at all. Don't we need > it?
Thanks for the review. I agree with your reasoning and compared talos 14nm HPG with hana/kona 7nm PHY HPG; the 7nm COMBO PHY series has orientation/lane-count dependent configs, but the 14nm PHY series does not. On QCS615 (talos), the TX_* registers you pointed to are programmed with constant values regardless of orientation or lane count. This has been confirmed from both the HPG and the downstream reference driver. For orientation, from reference the only difference is DP_PHY_MODE, which is set by qmp_usbc_configure_dp_mode(). The DP PHY does have an SW_PORTSELECT-related register, but due to talos lane mapping from the DP controller to the PHY not being the standard <0 1 2 3> sequence, it cannot reliably handle orientation flip. Also, QCS615 is a fixed- orientation platform (not DP-over-TypeC), so there is no validated hardware path for orientation flip on this platform. > >> + >> + writel(0x18, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); >> + writel(0x19, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); >> + >> + if (readl_poll_timeout(qmp->dp_dp_phy + QSERDES_V2_DP_PHY_STATUS, >> + status, >> + ((status & BIT(1)) > 0), >> + 500, >> + 10000)){ >> + dev_err(qmp->dev, "PHY_READY not ready\n"); >> + return -ETIMEDOUT; >> + } >> + >> + return 0; >> +} >> +