phy: qualcomm: qmp-combo: Add USB4/TBT3 configuration data for Hamoa
Subsystems (2)
PATCH v6 1/1 phy: qualcomm: qmp-combo: Add USB4/TBT3 configuration data for Hamoa
From: Konrad Dybcio <[email protected]>
Add the offsets and configuration tables to support USB4 and Thunderbolt 3 operation on the USB4-capable PHYs found on Hamoa chips.
---
The USB43DP QMP PHY, as the name suggests, supports USB4 in addition to DP/USB. This series provides the necessary plumbing to switch to that mode of operation on hamoa/purwa.
This is achieved by exposing a third struct phy * for the USB4 sub- PHY, which will be toggled by the USB4 router driver, living within the Thunderbolt framework, which will be posted separately.
Find more details in the individual commit messages. Tested on a X1E80100 CRD.
No external dependencies.
---
Changes in v6:
- No changes, resend the last patch that silently wasn't applied
despite reaching out..
- Link to v5: https://patch.msgid.link/[email protected]
Changes in v5:
- Reabse on next-20260907 (NOP)
- By popular demand, wrap a comment at 80 lines
- Link to v4: https://patch.msgid.link/[email protected]
Changes in v4:
- Rebase on next-20260820
- Rename phy-tbt.h to phy-thunderbolt.h
- Add missing error unrolling in usb4 phy_init()
- Rename usb4phy_init_count to usb4_init_count
- Refactor the submode acceptance logic in usb4 phy_set_mode()
- Pick up tags
- Link to v3: https://patch.msgid.link/[email protected]
Changes in v3:
- Fix up assisted-by tag
- Pick up tags
- Link to v2: https://patch.msgid.link/[email protected]
Changes in v2:
- Massage the bindings to only allow the p2rr2p clock on Hamoa
- Pick up tags
- Rebase (nop)
- Link to v1: https://patch.msgid.link/[email protected]
To: Vinod Koul <[email protected]>
To: Neil Armstrong <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
To: Bjorn Andersson <[email protected]>
To: Konrad Dybcio <[email protected]>
To: Manivannan Sadhasivam <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 200 ++++++++++++++++++++- drivers/phy/qualcomm/phy-qcom-qmp-pcs-aon-v6.h | 2 + drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h | 15 ++ .../phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h | 45 +++++ 4 files changed, 256 insertions(+), 6 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +194 -6
@@ -240,6 +240,7 @@ static const unsigned int qmp_v6_n4_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = { [QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] = QPHY_V6_PCS_USB3_LFPS_RXTERM_IRQ_CLEAR, [QPHY_PCS_CLAMP_ENABLE] = QPHY_V6_PCS_AON_CLAMP_ENABLE, + [QPHY_PCS_USB4_CLAMP_ENABLE] = QPHY_V6_PCS_AON_USB4_CLAMP_ENABLE, [QPHY_COM_RESETSM_CNTRL] = QSERDES_V6_COM_RESETSM_CNTRL, [QPHY_COM_C_READY_STATUS] = QSERDES_V6_COM_C_READY_STATUS,
@@ -1967,7 +1968,85 @@ static const struct qmp_phy_init_tbl sc8280xp_usb43dp_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07), }; -static const struct qmp_phy_init_tbl x1e80100_usb43dp_serdes_tbl[] = { +static const struct qmp_phy_init_tbl x1e80100_usb4_serdes_tbl[] = { +QMP_PHY_INIT_CFG (QSERDES_V6_COM_SSC_EN_CENTER ,0x01 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_SSC_PER1 ,0x62 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_SSC_PER2 ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_SSC_STEP_SIZE1_MODE0 ,0xd9 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_SSC_STEP_SIZE2_MODE0 ,0x03 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_SSC_STEP_SIZE1_MODE1 ,0xb2 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_SSC_STEP_SIZE2_MODE1 ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_SYSCLK_BUF_ENABLE ,0x0a ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_CP_CTRL_MODE0 ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_CP_CTRL_MODE1 ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_PLL_RCTRL_MODE0 ,0x18 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_PLL_RCTRL_MODE1 ,0x18 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_PLL_CCTRL_MODE0 ,0x36 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_PLL_CCTRL_MODE1 ,0x36 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_SYSCLK_EN_SEL ,0x1a ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_LOCK_CMP_EN ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_LOCK_CMP_CFG ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_LOCK_CMP1_MODE0 ,0x1a ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_LOCK_CMP2_MODE0 ,0x41 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_LOCK_CMP1_MODE1 ,0x24 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_LOCK_CMP2_MODE1 ,0x43 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_DEC_START_MODE0 ,0x82 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_DEC_START_MSB_MODE0 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_DEC_START_MODE1 ,0x86 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_DEC_START_MSB_MODE1 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_DIV_FRAC_START1_MODE0 ,0x55 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_DIV_FRAC_START2_MODE0 ,0x55 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_DIV_FRAC_START3_MODE0 ,0x03 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_DIV_FRAC_START1_MODE1 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_DIV_FRAC_START2_MODE1 ,0xa7 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_DIV_FRAC_START3_MODE1 ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_VCO_TUNE_MAP ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_VCO_TUNE1_MODE0 ,0xba ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_VCO_TUNE2_MODE0 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_VCO_TUNE1_MODE1 ,0x3c ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_VCO_TUNE2_MODE1 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_HSCLK_SEL_1 ,0x11 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_HSCLK_HS_SWITCH_SEL_1 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_PLL_CORE_CLK_DIV_MODE0 ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_CORECLK_DIV_MODE1 ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_CMN_CONFIG_1 ,0x76 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_CORE_CLK_EN ,0xb0 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_PLL_IVCO ,0x7f ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_PLL_IVCO_MODE1 ,0x7f ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_INTEGLOOP_GAIN0_MODE0 ,0x1f ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_INTEGLOOP_GAIN0_MODE1 ,0x1f ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_CMN_IPTRIM ,0x17 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_SVS_MODE_CLK_SEL ,0x0a ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_CMN_MODE ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_PLL_VCO_DC_LEVEL_CTRL ,0x07 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_ADDITIONAL_MISC_2 ,0x0f ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_VCO_TUNE_INITVAL2 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_VCO_TUNE_MAXVAL2 ,0x01 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_PLL_POST_DIV_MUX ,0x60 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_BG_TIMER ,0x0a ), +}; + +static const struct qmp_phy_init_tbl x1e80100_usb4_tb3_serdes_tbl[] = { +QMP_PHY_INIT_CFG (QSERDES_V6_COM_SSC_PER1 ,0x15 ), +QMP_PHY_INIT_CFG (QSERDES_V6_COM_VCO_TUNE_MAP ,0x54 ), +}; + +static const struct qmp_phy_init_tbl x1e80100_usb4_tx_tbl[] = { +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_LANE_MODE_1 ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_LANE_MODE_2 ,0x50 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_LANE_MODE_3 ,0x40 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_RES_CODE_LANE_OFFSET_TX ,0x1f ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_RES_CODE_LANE_OFFSET_RX ,0x0a ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_RX_MARG_COARSE_THRESH1_RATE210 ,0x1f ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_RX_MARG_COARSE_THRESH1_RATE3 ,0x1f ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_RX_MARG_COARSE_THRESH2_RATE210 ,0x1f ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_RX_MARG_COARSE_THRESH2_RATE3 ,0x1f ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_RX_MARG_COARSE_THRESH3_RATE210 ,0x1f ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_RX_MARG_COARSE_THRESH3_RATE3 ,0x1f ), +QMP_PHY_INIT_CFG (QSERDES_V6_TX_LDO_TIMER_CTRL ,0x03 ), +}; + +static const struct qmp_phy_init_tbl x1e80100_usb3dp_serdes_tbl[] = {QMP_PHY_INIT_CFG (QSERDES_V6_COM_SSC_EN_CENTER ,0x01 ),QMP_PHY_INIT_CFG (QSERDES_V6_COM_SSC_PER1 ,0x62 ),QMP_PHY_INIT_CFG (QSERDES_V6_COM_SSC_PER2 ,0x02 ),
@@ -2028,6 +2107,68 @@ static const struct qmp_phy_init_tbl x1e80100_usb43dp_tx_tbl[] = { QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_RES_CODE_LANE_OFFSET_RX, 0x0a), }; +static const struct qmp_phy_init_tbl x1e80100_usb4_rx_tbl[] = { +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_SIGDET_CNTRL ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_SIGDET_DEGLITCH_CNTRL ,0x0e ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_SIGDET_ENABLES ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_MODE_RATE2_B0 ,0xd3 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_MODE_RATE2_B1 ,0xee ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_MODE_RATE2_B2 ,0x58 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_MODE_RATE2_B4 ,0x24 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_MODE_RATE3_B0 ,0xbf ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_MODE_RATE3_B1 ,0x7f ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_MODE_RATE3_B2 ,0xa2 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_MODE_RATE3_B3 ,0xdd ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_MODE_RATE3_B4 ,0x6a ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_MODE_RATE3_B5 ,0xdb ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_MODE_RATE3_B6 ,0xe3 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_LOW_RATE2 ,0x30 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_HIGH_RATE2 ,0x14 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_LOW_RATE3 ,0xff ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_HIGH_RATE3 ,0x3f ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_UCDR_PI_CTRL1 ,0xd0 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_UCDR_PI_CTRL2 ,0x48 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_UCDR_SB2_THRESH1_RATE3 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_UCDR_SB2_GAIN2_RATE2 ,0x0a ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_UCDR_SB2_GAIN1_RATE3 ,0x1f ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_UCDR_SB2_GAIN2_RATE3 ,0x1f ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_IVCM_CAL_CODE_OVERRIDE ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_RX_IVCM_CAL_CTRL2 ,0x80 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_RX_SUMMER_CAL_SPD_MODE ,0x2f ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_DFE_CTLE_POST_CAL_OFFSET ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_DCC_CMUX_POSTCAL_OFFSET ,0x1d ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_UCDR_FO_GAIN_RATE2 ,0x09 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_UCDR_FO_GAIN_RATE3 ,0x06 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_UCDR_SO_GAIN_RATE2 ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_UCDR_SO_GAIN_RATE3 ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_UCDR_PI_CONTROLS ,0x15 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_UCDR_FASTLOCK_FO_GAIN_RATE3 ,0x1f ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_UCDR_FASTLOCK_SO_GAIN_RATE3 ,0x08 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_UCDR_SO_SATURATION ,0x36 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_RX_IVCM_POSTCAL_OFFSET ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_VGA_CAL_CNTRL1 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_VGA_CAL_MAN_VAL ,0x08 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_DFE_DAC_ENABLE1 ,0x88 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_DFE_DAC_ENABLE2 ,0x08 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_DFE_1 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_DFE_2 ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_DFE_3 ,0x45 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_DFE_TAP3_CTRL ,0x06 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_DFE_TAP4_CTRL ,0x06 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_DFE_TAP5_CTRL ,0x06 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_GM_CAL ,0x0d ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_RX_EQ_OFFSET_ADAPTOR_CNTRL1 ,0x24 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_RX_OFFSET_ADAPTOR_CNTRL3 ,0x08 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_EOM_CTRL1 ,0x10 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_EOM_CTRL2 ,0x21 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_DFE_TAP3_MANVAL_KTAP ,0x06 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_DFE_TAP4_MANVAL_KTAP ,0x06 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_DFE_TAP5_MANVAL_KTAP ,0x06 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_VTHRESH_CAL_MAN_VAL_RATE3 ,0x78 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_Q_PI_INTRINSIC_BIAS_RATE32 ,0x27 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_RX_BKUP_CTRL1 ,0x14 ), +}; +static const struct qmp_phy_init_tbl x1e80100_usb43dp_rx_tbl[] = {QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_SIGDET_CNTRL ,0x04 ),QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_SIGDET_DEGLITCH_CNTRL ,0x0e ),
@@ -2066,6 +2207,23 @@ static const struct qmp_phy_init_tbl x1e80100_usb43dp_rx_tbl[] = { QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_RX_BKUP_CTRL1, 0x14), }; +static const struct qmp_phy_init_tbl x1e80100_usb4_pcs_tbl[] = { +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_POWER_STATE_CONFIG3 ,0x4f ), +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_LOCK_DETECT_CONFIG1 ,0x03 ), +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_LOCK_DETECT_CONFIG2 ,0xc0 ), +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_RX_SIGDET_LVL ,0x55 ), +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_PCS_PCS_TX_RX_CONFIG1 ,0x51 ), +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_EQ_CONFIG1 ,0x2e ), +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_G3_EQ_CONFIG1 ,0x4b ), +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_G3_EQ_CONFIG5 ,0x1e ), +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_G2_FOM_EQ_CONFIG1 ,0x83 ), +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_G2_FOM_EQ_CONFIG3 ,0x2e ), +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_G2_FOM_EQ_CONFIG5 ,0x10 ), +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_G3_FOM_EQ_CONFIG3 ,0x25 ), +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_G3_FOM_EQ_CONFIG5 ,0x22 ), +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_LPFS_TX_ECSTART ,0x0f ), +}; +static const struct qmp_phy_init_tbl x1e80100_usb43dp_pcs_tbl[] = {QMP_PHY_INIT_CFG (QPHY_V6_N4_PCS_RCVR_DTCT_DLY_P1U2_L ,0xe7 ),QMP_PHY_INIT_CFG (QPHY_V6_N4_PCS_RCVR_DTCT_DLY_P1U2_H ,0x03 ),
@@ -2720,6 +2878,23 @@ static const struct qmp_combo_offsets qmp_combo_offsets_v5 = { .dp_dp_phy = 0x2200, }; +static const struct qmp_combo_offsets qmp_combo_offsets_v6_n4 = { + .com =0x0000 , + .usb3_pcs_aon =0x0100 , + .txa =0x0400 , + .rxa =0x0600 , + .txb =0x0a00 , + .rxb =0x0c00 , + .usb3_serdes =0x1000 , + .usb3_pcs_misc =0x1200 , + .usb3_pcs =0x1400 , + .usb3_pcs_usb =0x1700 , + .dp_serdes =0x2000 , + .dp_dp_phy =0x2200 , + .usb4_serdes =0x3000 , + .usb4_pcs =0x3400 , +}; +static const struct qmp_combo_offsets qmp_combo_offsets_v8 = { .com =0x0000 , .txa =0x1400 ,
@@ -2995,11 +3170,11 @@ static const struct qmp_phy_cfg sc8280xp_usb43dpphy_cfg = { .regs = qmp_v5_5nm_usb3phy_regs_layout, }; -static const struct qmp_phy_cfg x1e80100_usb3dpphy_cfg = { - .offsets = &qmp_combo_offsets_v5, +static const struct qmp_phy_cfg x1e80100_usb43dpphy_cfg = { + .offsets = &qmp_combo_offsets_v6_n4, - .serdes_tbl = x1e80100_usb43dp_serdes_tbl, - .serdes_tbl_num =ARRAY_SIZE (x1e80100_usb43dp_serdes_tbl), + .serdes_tbl = x1e80100_usb3dp_serdes_tbl, + .serdes_tbl_num =ARRAY_SIZE (x1e80100_usb3dp_serdes_tbl), .tx_tbl = x1e80100_usb43dp_tx_tbl, .tx_tbl_num =ARRAY_SIZE (x1e80100_usb43dp_tx_tbl), .rx_tbl = x1e80100_usb43dp_rx_tbl,
@@ -3033,6 +3208,19 @@ static const struct qmp_phy_cfg x1e80100_usb3dpphy_cfg = { .configure_dp_clocks = qmp_v3_configure_dp_clocks, .configure_dp_phy = qmp_v4_configure_dp_phy, + .usb4_serdes_tbl = x1e80100_usb4_serdes_tbl, + .usb4_serdes_tbl_num = ARRAY_SIZE(x1e80100_usb4_serdes_tbl), + .usb4_serdes_tb3_ovrd_tbl = x1e80100_usb4_tb3_serdes_tbl, + .usb4_serdes_tb3_ovrd_num = ARRAY_SIZE(x1e80100_usb4_tb3_serdes_tbl), + + .usb4_tx_tbl = x1e80100_usb4_tx_tbl, + .usb4_tx_tbl_num = ARRAY_SIZE(x1e80100_usb4_tx_tbl), + .usb4_rx_tbl = x1e80100_usb4_rx_tbl, + .usb4_rx_tbl_num = ARRAY_SIZE(x1e80100_usb4_rx_tbl), + + .usb4_pcs_tbl = x1e80100_usb4_pcs_tbl, + .usb4_pcs_tbl_num = ARRAY_SIZE(x1e80100_usb4_pcs_tbl), + .reset_list = msm8996_usb3phy_reset_l, .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), .vreg_list = qmp_phy_vreg_l,
@@ -5683,7 +5871,7 @@ static const struct of_device_id qmp_combo_of_match_table[] = { }, { .compatible = "qcom,x1e80100-qmp-usb3-dp-phy", - .data = &x1e80100_usb3dpphy_cfg, + .data = &x1e80100_usb43dpphy_cfg, }, { } };
drivers/phy/qualcomm/phy-qcom-qmp-pcs-aon-v6.h +2 -0
@@ -8,5 +8,7 @@/* Only for QMP V6 PHY - PCS_AON registers */ #define QPHY_V6_PCS_AON_CLAMP_ENABLE 0x00 +/* Valid only for USB43DP variants */ +#define QPHY_V6_PCS_AON_USB4_CLAMP_ENABLE 0x04#endif
drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h +15 -0
@@ -14,4 +14,19 @@#define QPHY_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L 0x40#define QPHY_V6_PCS_USB3_RCVR_DTCT_DLY_U3_H 0x44 +#define QPHY_V6_PCS_USB4_POWER_STATE_CONFIG3 0x98 +#define QPHY_V6_PCS_USB4_LOCK_DETECT_CONFIG1 0xd0 +#define QPHY_V6_PCS_USB4_LOCK_DETECT_CONFIG2 0xd4 +#define QPHY_V6_PCS_USB4_RX_SIGDET_LVL 0x17c +#define QPHY_V6_PCS_USB4_PCS_PCS_TX_RX_CONFIG1 0x1a8 +#define QPHY_V6_PCS_USB4_EQ_CONFIG1 0x1b8 +#define QPHY_V6_PCS_USB4_G3_EQ_CONFIG1 0x1d8 +#define QPHY_V6_PCS_USB4_G3_EQ_CONFIG5 0x1e8 +#define QPHY_V6_PCS_USB4_G2_FOM_EQ_CONFIG1 0x1f4 +#define QPHY_V6_PCS_USB4_G2_FOM_EQ_CONFIG3 0x1fc +#define QPHY_V6_PCS_USB4_G2_FOM_EQ_CONFIG5 0x204 +#define QPHY_V6_PCS_USB4_G3_FOM_EQ_CONFIG3 0x210 +#define QPHY_V6_PCS_USB4_G3_FOM_EQ_CONFIG5 0x218 +#define QPHY_V6_PCS_USB4_LPFS_TX_ECSTART 0x220 +#endif
drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h +45 -0
78 lines not on this page · raw message
---
base-commit: f5f84daefcd92d7a630066635ecea1433ed5eac7
change-id: 20260518-topic-usb4phy-e9612f5ba008
Best regards,
Signature · 1 line
Konrad Dybcio <[email protected]>
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Low] phy: qualcomm: incorrectly named TX macro for RX UCDR FASTLOCK registers - [Low] phy: qualcomm…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] phy: qualcomm: incorrectly named TX macro for RX UCDR FASTLOCK registers
- [Low] phy: qualcomm: typo LPFS instead of LFPS in PCS USB4 macro
--
commit 9fb8a660167beb5727c0f55ed2ce925959a5e21c
Author: Konrad Dybcio <[email protected]>
phy: qualcomm: qmp-combo: Add USB4/TBT3 configuration data for Hamoa
This commit adds offsets and configuration tables to support USB4 and Thunderbolt 3 operation on USB4-capable PHYs for Hamoa chips. It exposes a third PHY structure for the USB4 sub-PHY to be toggled by the USB4 router driver.
Quoted 4 lines
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +0
-0
[ ... ]
Quoted 5 lines
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +1
-0@@ -2028,6 +2107,68 @@ static const struct qmp_phy_init_tbl x1e80100_usb43dp_tx_tbl[] = { QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_RES_CODE_LANE_OFFSET_RX, 0x0a), }; +static const struct qmp_phy_init_tbl x1e80100_usb4_rx_tbl[] = {
[ ... ]
drivers/phy/qualcomm/phy-qcom-qmp-combo.c static const struct qmp_phy_init_tbl x1e80100_usb43dp_tx_tbl[] = { · line 2128
Quoted 5 lines
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +5
-0+QMP_PHY_INIT_CFG (QSERDES_V6_N4_RX_MODE_RATE3_B6 ,0xe3 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_LOW_RATE2 ,0x30 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_HIGH_RATE2 ,0x14 ), +QMP_PHY_INIT_CFG (QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_LOW_RATE3 ,0xff ), + QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_HIGH_RATE3, 0x3f),
[Severity: Low]
Do these macros have an incorrect _TX_ prefix instead of _RX_? They are being used in the RX initialization table x1e80100_usb4_rx_tbl and evaluate to an offset within the RX block address space.
Quoted 1 line
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +1
-0+ QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_UCDR_PI_CTRL1, 0xd0),
[ ... ]
Quoted 6 lines
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +2
-0@@ -2066,6 +2207,23 @@ static const struct qmp_phy_init_tbl x1e80100_usb43dp_rx_tbl[] = { QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_RX_BKUP_CTRL1, 0x14), }; +static const struct qmp_phy_init_tbl x1e80100_usb4_pcs_tbl[] = { +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_POWER_STATE_CONFIG3 ,0x4f ),
[ ... ]
drivers/phy/qualcomm/phy-qcom-qmp-combo.c static const struct qmp_phy_init_tbl x1e80100_usb43dp_rx_tbl[] = { · line 2224
Quoted 3 lines
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +3
-0+QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_G3_FOM_EQ_CONFIG3 ,0x25 ), +QMP_PHY_INIT_CFG (QPHY_V6_PCS_USB4_G3_FOM_EQ_CONFIG5 ,0x22 ), + QMP_PHY_INIT_CFG(QPHY_V6_PCS_USB4_LPFS_TX_ECSTART, 0x0f),
[Severity: Low]
This is a minor typo, but should LPFS be LFPS (Low Frequency Periodic Signaling) in this macro name?
Quoted 1 line
+};
[ ... ]
Quoted 4 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h +0
-0
[ ... ]
Quoted 5 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h +1
-0@@ -14,4 +14,19 @@#define QPHY_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L 0x40#define QPHY_V6_PCS_USB3_RCVR_DTCT_DLY_U3_H 0x44 +#define QPHY_V6_PCS_USB4_POWER_STATE_CONFIG3 0x98
[ ... ]
drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h line 30
Quoted 3 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h +3
-0+#define QPHY_V6_PCS_USB4_G3_FOM_EQ_CONFIG3 0x210 +#define QPHY_V6_PCS_USB4_G3_FOM_EQ_CONFIG5 0x218 +#define QPHY_V6_PCS_USB4_LPFS_TX_ECSTART 0x220
[Severity: Low]
Is this another instance where LPFS should be LFPS?
Quoted 6 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h +1
-0+#endif drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h +0
-0
[ ... ]
Quoted 4 lines
drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h +0
-0@@ -23,27 +23,63 @@#define QSERDES_V6_N4_TX_TRAN_DRVR_EMP_EN 0xac#define QSERDES_V6_N4_TX_TX_BAND 0xd8#define QSERDES_V6_N4_TX_INTERFACE_SELECT 0xe4
[ ... ]
drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h line 69
Quoted 4 lines
drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h +4
-0+#define QSERDES_V6_N4_RX_UCDR_FASTLOCK_FO_GAIN_RATE3 0x200 +#define QSERDES_V6_N4_RX_UCDR_FASTLOCK_SO_GAIN_RATE3 0x210 +#define QSERDES_V6_N4_RX_UCDR_SO_SATURATION 0x214 +#define QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_LOW_RATE1 0x224
[Severity: Low]
Does this define incorrectly use the _TX_ prefix instead of _RX_? This block of macros appears to fall within the RX address space based on the surrounding offsets.
Quoted 6 lines
drivers/phy/qualcomm/phy-qcom-qmp-qserdes-txrx-v6_n4.h +5
-0+#define QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_HIGH_RATE1 0x228 +#define QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_LOW_RATE2 0x22c +#define QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_HIGH_RATE2 0x230 +#define QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_LOW_RATE3 0x234 +#define QSERDES_V6_N4_TX_UCDR_FASTLOCK_COUNTER_HIGH_RATE3 0x238#define QSERDES_V6_N4_RX_UCDR_PI_CTRL1 0x23c
[ ... ]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Manivannan Sadhasivam
reviewerQuoted 3 lines · On 2026-09-28 11:40 +0000, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] phy: qualcomm: incorrectly named TX macro for RX UCDR FASTLOCK registers
- [Low] phy: qualcomm: typo LPFS instead of LFPS in PCS USB4 macro
Can you please take a look at these nits?
- Mani