Add support for USB phys in IPQ9650
v5 cover Add support for USB phys in IPQ9650
This series
- Adds dt-bindings and driver changes for the high speed and super speed phys in IPQ9650.
- IPQ9650 specific init tables to QMP super speed phy driver.
- The Femto high speed phy driver is refactored to accomodate differences in the init sequences between SoCs first and then support for IPQ9650 is included.
---
Changes in v5:
- Use FIELD_PREP_CONST to define FSEL_24MHZ
- Change commit subject to 'Fix order of arguments to qcom_snps_hsphy_write_mask'
- Use data->{pre,post}_tuning in qcom_snps_hsphy_init() instead of a temporary local variable
- Pick R-b from Dmitry for two patches
- Link to v4: https://lore.kernel.org/r/[email protected]
Changes in v4:
- Rebase to top of tree
- Split 4th patch 'phy: qcom: snps-femto-v2: Move PHY init registers to config tables' as follows:
phy: qcom: snps-femto-v2: Fix qcom_snps_hsphy_write_mask argument mixup
phy: qcom: snps-femto-v2: Move PHY init registers to config tables
- Link to v3: https://lore.kernel.org/r/[email protected]
Changes in v3:
- No code changes
- Rebase to top of tree
- Pick two R-b tags
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Pick one R-b from Krzysztof
- Use qcom,ipq9650-usb-hs-phy directly instead of adding a 6nm compatible and falling back to it
- Change pre/post to pre_tuning/post_tuning
- Use array count instead of terminating entries
- Fix value/mask mixup in 2 places
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Varadarajan Narayanan (6):
dt-bindings: phy: qcom,qmp-usb: Add IPQ9650 USB3 PHY
dt-bindings: phy: qcom,usb-snps-femto-v2: Add IPQ9650 compatible
phy: qcom: qmp-usb: Add IPQ9650 USB3 PHY configuration
phy: qcom: snps-femto-v2: Fix order of arguments to qcom_snps_hsphy_write_mask
phy: qcom: snps-femto-v2: Move PHY init registers to config tables
phy: qcom: snps-femto-v2: Add IPQ9650 support
.../phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml | 2 + .../bindings/phy/qcom,usb-snps-femto-v2.yaml | 2 + drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 118 +++++++++++++ drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 193 ++++++++++++++++----- 4 files changed, 268 insertions(+), 47 deletions(-)
---
base-commit: 15551282e82db772bfc862f96a8abf14a60f4ea5
change-id: 20260820-phy-664ed5ec0292
Best regards,
Signature · 1 line
Varadarajan Narayanan <[email protected]>
PATCH v5 1/6 dt-bindings: phy: qcom,qmp-usb: Add IPQ9650 USB3 PHY
Document the Qualcomm IPQ9650 USB3 QMP PHY compatible.
Use a standalone compatible because the IPQ9650 PHY has register configuration data that differs from the currently supported SoCs and should not fall back to an existing definition.
--- .../devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml +2 -0
@@ -23,6 +23,7 @@ properties: - qcom,ipq6018-qmp-usb3-phy - qcom,ipq8074-qmp-usb3-phy - qcom,ipq9574-qmp-usb3-phy + - qcom,ipq9650-qmp-usb3-phy - qcom,msm8996-qmp-usb3-phy - qcom,qcs8300-qmp-usb3-uni-phy - qcom,qdu1000-qmp-usb3-uni-phy
@@ -102,6 +103,7 @@ allOf: - qcom,ipq6018-qmp-usb3-phy - qcom,ipq8074-qmp-usb3-phy - qcom,ipq9574-qmp-usb3-phy + - qcom,ipq9650-qmp-usb3-phy - qcom,msm8996-qmp-usb3-phy - qcom,sdx55-qmp-usb3-uni-phy - qcom,sdx65-qmp-usb3-uni-phy
Signature · 1 line
2.34.1
PATCH v5 2/6 dt-bindings: phy: qcom,usb-snps-femto-v2: Add IPQ9650 compatible
In reply to Varadarajan NarayananAdd qcom,ipq9650-usb-hs-phy to the list of supported compatibles. Unlike the existing SoCs, IPQ9650 does not share a generic "qcom,usb-snps-hs-*nm-phy" fallback, since it requires its own tuning/override sequence, so list it as a standalone entry.
--- Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml +2 -0
@@ -15,6 +15,8 @@ description: | properties: compatible: oneOf: + - enum: + - qcom,ipq9650-usb-hs-phy - items: - enum: - qcom,sa8775p-usb-hs-phy
Signature · 1 line
2.34.1
PATCH v5 3/6 phy: qcom: qmp-usb: Add IPQ9650 USB3 PHY configuration
In reply to Varadarajan NarayananAdd the USB3 QMP PHY configuration for IPQ9650, including the SoC-specific init tables and compatible data.
IPQ9650 uses settings that do not match any existing supported SoC, so add a dedicated configuration to allow the driver to support it.
--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 118 ++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+)
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +118 -0
@@ -400,6 +400,101 @@ static const struct qmp_phy_init_tbl ipq8074_usb3_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V3_PCS_TXDEEMPH_M3P5DB_V0, 0x0f), }; +static const struct qmp_phy_init_tbl ipq9650_usb3_serdes_tbl[] = { +QMP_PHY_INIT_CFG (QSERDES_V4_COM_PLL_IVCO ,0x0f ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_SSC_EN_CENTER ,0x01 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_SSC_PER1 ,0x7d ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_SSC_PER2 ,0x01 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_SSC_STEP_SIZE1_MODE0 ,0x0a ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_SSC_STEP_SIZE2_MODE0 ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_SYSCLK_BUF_ENABLE ,0x0a ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_CMN_IPTRIM ,0x20 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_CP_CTRL_MODE0 ,0x06 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_PLL_RCTRL_MODE0 ,0x16 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_PLL_CCTRL_MODE0 ,0x36 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_SYSCLK_EN_SEL ,0x1a ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_BG_TIMER ,0x0b ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_LOCK_CMP_EN ,0x42 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_LOCK_CMP1_MODE0 ,0xd4 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_LOCK_CMP2_MODE0 ,0x14 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_DEC_START_MODE0 ,0x68 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_DIV_FRAC_START1_MODE0 ,0xab ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_DIV_FRAC_START2_MODE0 ,0xaa ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_DIV_FRAC_START3_MODE0 ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_VCO_TUNE_MAP ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_VCO_TUNE1_MODE0 ,0x24 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_VCO_TUNE2_MODE0 ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_HSCLK_SEL ,0x01 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_BIN_VCOCAL_CMP_CODE1_MODE0 ,0xa2 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_BIN_VCOCAL_CMP_CODE2_MODE0 ,0x18 ), +QMP_PHY_INIT_CFG (QSERDES_V4_COM_BIN_VCOCAL_HSCLK_SEL ,0x01 ), +}; + +static const struct qmp_phy_init_tbl ipq9650_usb3_tx_tbl[] = { +QMP_PHY_INIT_CFG (QSERDES_V4_TX_RES_CODE_LANE_OFFSET_TX ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V4_TX_RES_CODE_LANE_OFFSET_RX ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V4_TX_LANE_MODE_1 ,0xb5 ), +QMP_PHY_INIT_CFG (QSERDES_V4_TX_LANE_MODE_2 ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_V4_TX_RCV_DETECT_LVL_2 ,0x12 ), +QMP_PHY_INIT_CFG (QSERDES_V4_TX_PI_QEC_CTRL ,0x00 ), +}; + +static const struct qmp_phy_init_tbl ipq9650_usb3_rx_tbl[] = { +QMP_PHY_INIT_CFG (QSERDES_V4_RX_UCDR_FO_GAIN ,0x0a ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_UCDR_SO_GAIN ,0x06 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_UCDR_FASTLOCK_FO_GAIN ,0x0f ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_UCDR_SO_SATURATION_AND_ENABLE ,0x7f ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_UCDR_FASTLOCK_COUNT_LOW ,0xff ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_UCDR_FASTLOCK_COUNT_HIGH ,0x0f ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_UCDR_PI_CONTROLS ,0x99 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_UCDR_SB2_THRESH1 ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_UCDR_SB2_THRESH2 ,0x08 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_UCDR_SB2_GAIN1 ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_UCDR_SB2_GAIN2 ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_VGA_CAL_CNTRL1 ,0x54 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_VGA_CAL_CNTRL2 ,0x0c ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_GM_CAL ,0x11 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL2 ,0x0f ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL3 ,0x4a ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL4 ,0x0a ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_IDAC_TSETTLE_LOW ,0xc0 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_IDAC_TSETTLE_HIGH ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_EQ_OFFSET_ADAPTOR_CNTRL1 ,0x47 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_OFFSET_ADAPTOR_CNTRL2 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_SIGDET_CNTRL ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_SIGDET_DEGLITCH_CNTRL ,0x0e ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_01_LOW ,0xe4 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_01_HIGH ,0x64 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_01_HIGH2 ,0xf6 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_01_HIGH3 ,0x89 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_01_HIGH4 ,0x35 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_DFE_EN_TIMER ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_DFE_CTLE_POST_CAL_OFFSET ,0x38 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_DCC_CTRL1 ,0x0c ), +}; + +static const struct qmp_phy_init_tbl ipq9650_usb3_pcs_tbl[] = { +QMP_PHY_INIT_CFG (QPHY_V4_PCS_RATE_SLEW_CNTRL1 ,0x03 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_LOCK_DETECT_CONFIG1 ,0xd0 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_LOCK_DETECT_CONFIG2 ,0x07 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_LOCK_DETECT_CONFIG3 ,0x20 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_LOCK_DETECT_CONFIG6 ,0x13 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_REFGEN_REQ_CONFIG1 ,0x21 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_RX_SIGDET_LVL ,0xaa ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_RCVR_DTCT_DLY_P1U2_L ,0xe7 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_RCVR_DTCT_DLY_P1U2_H ,0x03 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCS_TX_RX_CONFIG ,0x0c ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_FLL_CNTRL2 ,0x83 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_FLL_CNTRL1 ,0x02 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_FLL_CNT_VAL_L ,0x09 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_FLL_CNT_VAL_H_TOL ,0xa2 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_FLL_MAN_CODE ,0x40 ), +}; + +static const struct qmp_phy_init_tbl ipq9650_usb3_pcs_usb_tbl[] = { +QMP_PHY_INIT_CFG (QPHY_V4_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL ,0xf8 ), +}; +static const struct qmp_phy_init_tbl msm8996_usb3_serdes_tbl[] = {QMP_PHY_INIT_CFG (QSERDES_V2_COM_SYSCLK_EN_SEL ,0x14 ),QMP_PHY_INIT_CFG (QSERDES_V2_COM_BIAS_EN_CLKBUFLR_EN ,0x08 ),
@@ -1572,6 +1667,26 @@ static const struct qmp_phy_cfg ipq9574_usb3phy_cfg = { .regs = qmp_v3_usb3phy_regs_layout, }; +static const struct qmp_phy_cfg ipq9650_usb3phy_cfg = { + .offsets = &qmp_usb_offsets_v4, + + .serdes_tbl = ipq9650_usb3_serdes_tbl, + .serdes_tbl_num =ARRAY_SIZE (ipq9650_usb3_serdes_tbl), + .tx_tbl = ipq9650_usb3_tx_tbl, + .tx_tbl_num =ARRAY_SIZE (ipq9650_usb3_tx_tbl), + .rx_tbl = ipq9650_usb3_rx_tbl, + .rx_tbl_num =ARRAY_SIZE (ipq9650_usb3_rx_tbl), + .pcs_tbl = ipq9650_usb3_pcs_tbl, + .pcs_tbl_num =ARRAY_SIZE (ipq9650_usb3_pcs_tbl), + .pcs_usb_tbl = ipq9650_usb3_pcs_usb_tbl, + .pcs_usb_tbl_num =ARRAY_SIZE (ipq9650_usb3_pcs_usb_tbl), + .vreg_list = qmp_phy_vreg_l, + .num_vregs =ARRAY_SIZE (qmp_phy_vreg_l), + .regs = qmp_v4_usb3phy_regs_layout, + + .has_pwrdn_delay = true, +}; +static const struct qmp_phy_cfg msm8996_usb3phy_cfg = { .offsets = &qmp_usb_offsets_v3_msm8996,
@@ -2459,6 +2574,9 @@ static const struct of_device_id qmp_usb_of_match_table[] = { }, { .compatible = "qcom,ipq9574-qmp-usb3-phy", .data = &ipq9574_usb3phy_cfg, + }, { + .compatible = "qcom,ipq9650-qmp-usb3-phy", + .data = &ipq9650_usb3phy_cfg, }, { .compatible = "qcom,msm8996-qmp-usb3-phy", .data = &msm8996_usb3phy_cfg,
Signature · 1 line
2.34.1
PATCH v5 4/6 phy: qcom: snps-femto-v2: Fix order of arguments to qcom_snps_hsphy_write_mask
In reply to Varadarajan NarayananFix the register bit field mask & value argument order while programming USB2_PHY_USB_PHY_REFCLK_CTRL in qcom_snps_hsphy_init() and USB2_AUTO_RESUME in qcom_snps_hsphy_suspend().
--- drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c +2 -2
@@ -193,7 +193,7 @@ static int qcom_snps_hsphy_suspend(struct qcom_snps_hsphy *hsphy)usleep_range (500 ,1000 );qcom_snps_hsphy_write_mask (hsphy->base,USB2_PHY_USB_PHY_HS_PHY_CTRL2 , -0 ,USB2_AUTO_RESUME ); +USB2_AUTO_RESUME ,0 ); }return 0 ;
@@ -426,7 +426,7 @@ static int qcom_snps_hsphy_init(struct phy *phy)USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1 , PLLBTUNE, PLLBTUNE);qcom_snps_hsphy_write_mask (hsphy->base,USB2_PHY_USB_PHY_REFCLK_CTRL , -REFCLK_SEL_DEFAULT ,REFCLK_SEL_MASK ); +REFCLK_SEL_MASK ,REFCLK_SEL_DEFAULT );qcom_snps_hsphy_write_mask (hsphy->base,USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1 ,VBUSVLDEXTSEL0 ,VBUSVLDEXTSEL0 );
Signature · 1 line
2.34.1
PATCH v5 5/6 phy: qcom: snps-femto-v2: Move PHY init registers to config tables
In reply to Varadarajan NarayananThe driver currently programs the common PHY register sequence directly in qcom_snps_hsphy_init(), with the fixed register writes split around the override parameter handling. This makes it hard to support SoCs that need a different sequence or different values.
Move the fixed pre- and post-override register programming into per- compatible configuration tables, and keep the 7 nm override parameters in the same match-data structure. This allows the driver to share the common sequence while adding SoC-specific sequences for future platforms such as IPQ9650.
--- drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 129 +++++++++++++++++--------- 1 file changed, 83 insertions(+), 46 deletions(-)
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c +83 -46
@@ -104,6 +104,20 @@ struct phy_override_seq {u8 mask; }; +struct phy_reg_config { +u32 offset; +u32 mask; +u32 val; +}; + +struct phy_config_data { +const struct phy_reg_config *pre_tuning; +const struct override_param_map *override; +const struct phy_reg_config *post_tuning; +const u32 num_pre_tuning; +const u32 num_post_tuning; +}; +#define NUM_HSPHY_TUNING_PARAMS (9)/**
@@ -383,13 +397,39 @@ static const struct override_param_map sc7280_snps_7nm_phy[] = { {}, }; +static const struct phy_reg_config hs_5nm_phy_pre_tuning[] = { + {USB2_PHY_USB_PHY_CFG0 ,UTMI_PHY_CMN_CTRL_OVERRIDE_EN ,UTMI_PHY_CMN_CTRL_OVERRIDE_EN }, + {USB2_PHY_USB_PHY_UTMI_CTRL5 ,POR ,POR }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0 ,FSEL_MASK ,0 }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1 ,PLLBTUNE ,PLLBTUNE }, + {USB2_PHY_USB_PHY_REFCLK_CTRL ,REFCLK_SEL_MASK ,REFCLK_SEL_DEFAULT }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1 ,VBUSVLDEXTSEL0 ,VBUSVLDEXTSEL0 }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL1 ,VBUSVLDEXT0 ,VBUSVLDEXT0 }, +}; + +static const struct phy_reg_config hs_5nm_phy_post_tuning[] = { + {USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON2 ,VREGBYPASS ,VREGBYPASS }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL2 ,USB2_SUSPEND_N_SEL |USB2_SUSPEND_N , +USB2_SUSPEND_N_SEL |USB2_SUSPEND_N }, + {USB2_PHY_USB_PHY_UTMI_CTRL0 ,SLEEPM ,SLEEPM }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0 ,SIDDQ ,0 }, + {USB2_PHY_USB_PHY_UTMI_CTRL5 ,POR ,0 }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL2 ,USB2_SUSPEND_N_SEL ,0 }, + {USB2_PHY_USB_PHY_CFG0 ,UTMI_PHY_CMN_CTRL_OVERRIDE_EN ,0 }, +}; +static int qcom_snps_hsphy_init (struct phy *phy) {struct qcom_snps_hsphy *hsphy =phy_get_drvdata (phy); +const struct phy_config_data *data;int ret, i;dev_vdbg (&phy->dev,"%s(): Initializing SNPS HS phy\n" , __func__); + data =of_device_get_match_data (hsphy->dev); +if (!data) +return -ENODEV ; + ret =regulator_bulk_enable (ARRAY_SIZE (hsphy->vregs), hsphy->vregs);if (ret)return ret;
@@ -414,24 +454,11 @@ static int qcom_snps_hsphy_init(struct phy *phy) goto disable_clks; } -qcom_snps_hsphy_write_mask (hsphy->base,USB2_PHY_USB_PHY_CFG0 , -UTMI_PHY_CMN_CTRL_OVERRIDE_EN , -UTMI_PHY_CMN_CTRL_OVERRIDE_EN ); -qcom_snps_hsphy_write_mask (hsphy->base,USB2_PHY_USB_PHY_UTMI_CTRL5 , -POR ,POR ); -qcom_snps_hsphy_write_mask (hsphy->base, -USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0 , -FSEL_MASK ,0 ); -qcom_snps_hsphy_write_mask (hsphy->base, -USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1 , -PLLBTUNE ,PLLBTUNE ); -qcom_snps_hsphy_write_mask (hsphy->base,USB2_PHY_USB_PHY_REFCLK_CTRL , -REFCLK_SEL_MASK ,REFCLK_SEL_DEFAULT ); -qcom_snps_hsphy_write_mask (hsphy->base, -USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1 , -VBUSVLDEXTSEL0 ,VBUSVLDEXTSEL0 ); -qcom_snps_hsphy_write_mask (hsphy->base,USB2_PHY_USB_PHY_HS_PHY_CTRL1 , -VBUSVLDEXT0 ,VBUSVLDEXT0 ); +for (i =0 ; i < data->num_pre_tuning; i++) +qcom_snps_hsphy_write_mask (hsphy->base, + data->pre_tuning[i].offset, + data->pre_tuning[i].mask, + data->pre_tuning[i].val);for (i =0 ; i <ARRAY_SIZE (hsphy->update_seq_cfg); i++) {if (hsphy->update_seq_cfg[i].need_update)
@@ -441,28 +468,11 @@ static int qcom_snps_hsphy_init(struct phy *phy) hsphy->update_seq_cfg[i].value); } -qcom_snps_hsphy_write_mask (hsphy->base, -USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON2 , -VREGBYPASS ,VREGBYPASS ); - -qcom_snps_hsphy_write_mask (hsphy->base,USB2_PHY_USB_PHY_HS_PHY_CTRL2 , -USB2_SUSPEND_N_SEL |USB2_SUSPEND_N , -USB2_SUSPEND_N_SEL |USB2_SUSPEND_N ); - -qcom_snps_hsphy_write_mask (hsphy->base,USB2_PHY_USB_PHY_UTMI_CTRL0 , -SLEEPM ,SLEEPM ); - -qcom_snps_hsphy_write_mask (hsphy->base,USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0 , -SIDDQ ,0 ); - -qcom_snps_hsphy_write_mask (hsphy->base,USB2_PHY_USB_PHY_UTMI_CTRL5 , -POR ,0 ); - -qcom_snps_hsphy_write_mask (hsphy->base,USB2_PHY_USB_PHY_HS_PHY_CTRL2 , -USB2_SUSPEND_N_SEL ,0 ); - -qcom_snps_hsphy_write_mask (hsphy->base,USB2_PHY_USB_PHY_CFG0 , -UTMI_PHY_CMN_CTRL_OVERRIDE_EN ,0 ); +for (i =0 ; i < data->num_post_tuning; i++) +qcom_snps_hsphy_write_mask (hsphy->base, + data->post_tuning[i].offset, + data->post_tuning[i].mask, + data->post_tuning[i].val); hsphy->phy_initialized = true;
@@ -495,14 +505,38 @@ static const struct phy_ops qcom_snps_hsphy_gen_ops = { .owner = THIS_MODULE, }; +static const struct phy_config_data hs_5nm_phy = { + .pre_tuning = hs_5nm_phy_pre_tuning, + .num_pre_tuning =ARRAY_SIZE (hs_5nm_phy_pre_tuning), + .post_tuning = hs_5nm_phy_post_tuning, + .num_post_tuning =ARRAY_SIZE (hs_5nm_phy_post_tuning), +}; + +static const struct phy_config_data hs_7nm_phy = { + .pre_tuning = hs_5nm_phy_pre_tuning, + .num_pre_tuning =ARRAY_SIZE (hs_5nm_phy_pre_tuning), + .override = sc7280_snps_7nm_phy, + .post_tuning = hs_5nm_phy_post_tuning, + .num_post_tuning =ARRAY_SIZE (hs_5nm_phy_post_tuning), +}; +static const struct of_device_id qcom_snps_hsphy_of_match_table[] = { - { .compatible ="qcom,sm8150-usb-hs-phy" , }, - { .compatible ="qcom,usb-snps-hs-5nm-phy" , }, + { + .compatible ="qcom,sm8150-usb-hs-phy" , + .data = &hs_5nm_phy, + }, + { + .compatible ="qcom,usb-snps-hs-5nm-phy" , + .data = &hs_5nm_phy, + }, { .compatible ="qcom,usb-snps-hs-7nm-phy" , - .data = &sc7280_snps_7nm_phy, + .data = &hs_7nm_phy, + }, + { + .compatible ="qcom,usb-snps-femto-v2-phy" , + .data = &hs_5nm_phy, }, - { .compatible ="qcom,usb-snps-femto-v2-phy" , }, { } };MODULE_DEVICE_TABLE (of, qcom_snps_hsphy_of_match_table);
@@ -541,11 +575,14 @@ static void qcom_snps_hsphy_read_override_param_seq(struct device *dev)s32 val;int ret, i;struct qcom_snps_hsphy *hsphy; -const struct override_param_map *cfg =of_device_get_match_data (dev); +const struct phy_config_data *data =of_device_get_match_data (dev); +const struct override_param_map *cfg; -if (!cfg) +if (!data || !data->override)return ; + cfg = data->override; + hsphy =dev_get_drvdata (dev);for (i =0 ; cfg[i].prop_name !=NULL ; i++) {
Signature · 1 line
2.34.1
PATCH v5 6/6 phy: qcom: snps-femto-v2: Add IPQ9650 support
In reply to Varadarajan NarayananAdd the 6 nm SNPS femto USB2 PHY configuration needed by IPQ9650. The PHYs on this SoC require a dedicated init sequence and override parameters before they can be enabled.
--- drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 62 +++++++++++++++++++++++++++ 1 file changed, 62 insertions(+)
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c +62 -0
@@ -29,12 +29,15 @@#define USB2_PHY_USB_PHY_UTMI_CTRL5 (0x50)#define POR BIT(1) +#define ATERESET BIT(0)#define USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0 (0x54)#define SIDDQ BIT(2)#define RETENABLEN BIT(3)#define FSEL_MASK GENMASK(6, 4)#define FSEL_DEFAULT (0x3 << 4) +#define FSEL_24MHZ FIELD_PREP_CONST(FSEL_MASK, 2) +#define VATESTENB_MASK GENMASK(1, 0)#define USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1 (0x58)#define VBUSVLDEXTSEL0 BIT(4)
@@ -57,6 +60,13 @@#define USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X3 (0x78)#define PARAM_OVRD_MASK 0xFF +#define USB2_PHY_USB_PHY_HS_PHY_TEST0 0x80 +#define TESTDATAIN_MASK GENMASK(7, 0) + +#define USB2_PHY_USB_PHY_HS_PHY_TEST1 0x84 +#define TESTDATAOUTSEL BIT(4) +#define TESTCLK BIT(6) +#define USB2_PHY_USB_PHY_CFG0 (0x94)#define UTMI_PHY_DATAPATH_CTRL_OVERRIDE_EN BIT(0)#define UTMI_PHY_CMN_CTRL_OVERRIDE_EN BIT(1)
@@ -78,6 +88,9 @@#define LS_FS_OUTPUT_IMPEDANCE_MASK GENMASK(3, 0) +#define USB2_PHY_USB_PHY_FSEL_SEL 0xb8 +#define FSEL_SEL BIT(0) +static const char *const qcom_snps_hsphy_vreg_names[] = {"vdda-pll" ,"vdda33" ,"vdda18" , };
@@ -330,6 +343,17 @@ static const struct override_param ls_fs_output_impedance_sc7280[] = { { 1310, 0 }, }; +static const struct override_param_map ipq9650_snps_6nm_phy[] = { + { + "qcom,pre-emphasis-amplitude-bp", + preemphasis_amplitude_sc7280, + ARRAY_SIZE(preemphasis_amplitude_sc7280), + USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X1, + PREEMPHASIS_AMPLITUDE_MASK, + }, + {}, +}; + static const struct override_param_map sc7280_snps_7nm_phy[] = { { "qcom,hs-disconnect-bp",
@@ -418,6 +442,32 @@ static const struct phy_reg_config hs_5nm_phy_post_tuning[] = { { USB2_PHY_USB_PHY_CFG0, UTMI_PHY_CMN_CTRL_OVERRIDE_EN, 0 }, }; +static const struct phy_reg_config hs_6nm_phy_pre_tuning[] = { + {USB2_PHY_USB_PHY_CFG0 ,UTMI_PHY_CMN_CTRL_OVERRIDE_EN ,UTMI_PHY_CMN_CTRL_OVERRIDE_EN }, + {USB2_PHY_USB_PHY_UTMI_CTRL5 ,POR ,POR }, + {USB2_PHY_USB_PHY_FSEL_SEL ,FSEL_SEL ,FSEL_SEL }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0 ,FSEL_MASK ,FSEL_24MHZ }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1 ,PLLBTUNE ,PLLBTUNE }, + {USB2_PHY_USB_PHY_REFCLK_CTRL ,REFCLK_SEL_MASK ,REFCLK_SEL_DEFAULT }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1 ,VBUSVLDEXTSEL0 ,VBUSVLDEXTSEL0 }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL1 ,VBUSVLDEXT0 ,VBUSVLDEXT0 }, +}; + +static const struct phy_reg_config hs_6nm_phy_post_tuning[] = { + {USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON2 ,VREGBYPASS ,VREGBYPASS }, + {USB2_PHY_USB_PHY_UTMI_CTRL5 ,ATERESET ,0 }, + {USB2_PHY_USB_PHY_HS_PHY_TEST1 ,TESTDATAOUTSEL ,0 }, + {USB2_PHY_USB_PHY_HS_PHY_TEST1 ,TESTCLK ,0 }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0 ,VATESTENB_MASK ,0 }, + {USB2_PHY_USB_PHY_HS_PHY_TEST0 ,TESTDATAIN_MASK ,0 }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL2 ,USB2_SUSPEND_N_SEL |USB2_SUSPEND_N , +USB2_SUSPEND_N_SEL |USB2_SUSPEND_N }, + {USB2_PHY_USB_PHY_UTMI_CTRL0 ,SLEEPM ,SLEEPM }, + {USB2_PHY_USB_PHY_UTMI_CTRL5 ,POR ,0 }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL2 ,USB2_SUSPEND_N_SEL ,0 }, + {USB2_PHY_USB_PHY_CFG0 ,UTMI_PHY_CMN_CTRL_OVERRIDE_EN ,0 }, +}; +static int qcom_snps_hsphy_init (struct phy *phy) {struct qcom_snps_hsphy *hsphy =phy_get_drvdata (phy);
@@ -512,6 +562,14 @@ static const struct phy_config_data hs_5nm_phy = { .num_post_tuning = ARRAY_SIZE(hs_5nm_phy_post_tuning), }; +static const struct phy_config_data hs_6nm_phy = { + .pre_tuning = hs_6nm_phy_pre_tuning, + .num_pre_tuning =ARRAY_SIZE (hs_6nm_phy_pre_tuning), + .override = ipq9650_snps_6nm_phy, + .post_tuning = hs_6nm_phy_post_tuning, + .num_post_tuning =ARRAY_SIZE (hs_6nm_phy_post_tuning), +}; +static const struct phy_config_data hs_7nm_phy = { .pre_tuning = hs_5nm_phy_pre_tuning, .num_pre_tuning =ARRAY_SIZE (hs_5nm_phy_pre_tuning),
@@ -529,6 +587,10 @@ static const struct of_device_id qcom_snps_hsphy_of_match_table[] = { .compatible = "qcom,usb-snps-hs-5nm-phy", .data = &hs_5nm_phy, }, + { + .compatible = "qcom,ipq9650-usb-hs-phy", + .data = &hs_6nm_phy, + }, { .compatible = "qcom,usb-snps-hs-7nm-phy", .data = &hs_7nm_phy,
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v5 6/6] phy: qcom: snps-femto-v2: Add IPQ9650 support
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] phy: qcom: missing SIDDQ clear in 6nm PHY post-tuning - [Low] build: missing <linux/bitfield.h>…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] phy: qcom: missing SIDDQ clear in 6nm PHY post-tuning
- [Low] build: missing <linux/bitfield.h> for FIELD_PREP_CONST
--
commit bd845c9b97c7b3b1c9ec07fec6daa12f9b0766d5
Author: Varadarajan Narayanan <[email protected]>
phy: qcom: snps-femto-v2: Add IPQ9650 support
Add the 6 nm SNPS femto USB2 PHY configuration needed by IPQ9650. The PHYs on this SoC require a dedicated init sequence and override parameters before they can be enabled.
Quoted 6 lines
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c +0
-0@@ -29,12 +29,15 @@
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c line 39
Quoted 10 lines
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c +2
-0#define USB2_PHY_USB_PHY_UTMI_CTRL5 (0x50)#define POR BIT(1) +#define ATERESET BIT(0)#define USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0 (0x54)#define SIDDQ BIT(2)#define RETENABLEN BIT(3)#define FSEL_MASK GENMASK(6, 4)#define FSEL_DEFAULT (0x3 << 4) +#define FSEL_24MHZ FIELD_PREP_CONST(FSEL_MASK, 2)
[Severity: Low]
Is it possible this could cause build failures on architectures where linux/bitfield.h is not transitively included? Relying on transitive header inclusions might break when implicit include chains differ.
[ ... ]
Quoted 11 lines
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c +7
-0@@ -418,6 +442,32 @@ static const struct phy_reg_config hs_5nm_phy_post_tuning[] = { { USB2_PHY_USB_PHY_CFG0, UTMI_PHY_CMN_CTRL_OVERRIDE_EN, 0 }, }; +static const struct phy_reg_config hs_6nm_phy_pre_tuning[] = { + {USB2_PHY_USB_PHY_CFG0 ,UTMI_PHY_CMN_CTRL_OVERRIDE_EN ,UTMI_PHY_CMN_CTRL_OVERRIDE_EN }, + {USB2_PHY_USB_PHY_UTMI_CTRL5 ,POR ,POR }, + {USB2_PHY_USB_PHY_FSEL_SEL ,FSEL_SEL ,FSEL_SEL }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0 ,FSEL_MASK ,FSEL_24MHZ }, + {USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1 ,PLLBTUNE ,PLLBTUNE }, + { USB2_PHY_USB_PHY_REFCLK_CTRL, REFCLK_SEL_MASK, REFCLK_SEL_DEFAULT },
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c static const struct phy_reg_config hs_5nm_phy_post_tuning[] = { · line 461
Quoted 10 lines
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c +10
-0+ { USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1, VBUSVLDEXTSEL0, VBUSVLDEXTSEL0 }, + { USB2_PHY_USB_PHY_HS_PHY_CTRL1, VBUSVLDEXT0, VBUSVLDEXT0 }, +}; + +static const struct phy_reg_config hs_6nm_phy_post_tuning[] = { + {USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON2 ,VREGBYPASS ,VREGBYPASS }, + {USB2_PHY_USB_PHY_UTMI_CTRL5 ,ATERESET ,0 }, + {USB2_PHY_USB_PHY_HS_PHY_TEST1 ,TESTDATAOUTSEL ,0 }, + {USB2_PHY_USB_PHY_HS_PHY_TEST1 ,TESTCLK ,0 }, + { USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0, VATESTENB_MASK, 0 },
[Severity: Medium]
Does this sequence intentionally omit clearing the SIDDQ deep sleep bit?
If the analog PHY defaults to deep sleep (SIDDQ=1), omitting the clear operation could leave the PHY powered down and non-functional during boot or interface initialization.
Looking at hs_5nm_phy_post_tuning(), it explicitly clears the SIDDQ bit:
{ USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0, SIDDQ, 0 }Could the 6nm hardware behavior identically match the 5nm/7nm and other Synopsys PHYs where SIDDQ defaults to 1, requiring it to be cleared here?
Quoted 8 lines
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c +8
-0+ { USB2_PHY_USB_PHY_HS_PHY_TEST0, TESTDATAIN_MASK, 0 }, + { USB2_PHY_USB_PHY_HS_PHY_CTRL2, USB2_SUSPEND_N_SEL | USB2_SUSPEND_N, + USB2_SUSPEND_N_SEL | USB2_SUSPEND_N }, + { USB2_PHY_USB_PHY_UTMI_CTRL0, SLEEPM, SLEEPM }, + { USB2_PHY_USB_PHY_UTMI_CTRL5, POR, 0 }, + { USB2_PHY_USB_PHY_HS_PHY_CTRL2, USB2_SUSPEND_N_SEL, 0 }, + { USB2_PHY_USB_PHY_CFG0, UTMI_PHY_CMN_CTRL_OVERRIDE_EN, 0 }, +};
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
kernel test robot
build botRe: [PATCH v5 6/6] phy: qcom: snps-femto-v2: Add IPQ9650 support
In reply to Varadarajan Narayanankernel test robot noticed the following build errors:
Hi Varadarajan,
kernel test robot noticed the following build errors:
[auto build test ERROR on 15551282e82db772bfc862f96a8abf14a60f4ea5]
url: https://github.com/intel-lab-lkp/linux/commits/Varadarajan-Narayanan/dt-bindings-phy-qcom-qmp-usb-Add-IPQ9650-USB3-PHY/20261006-105915 base: 15551282e82db772bfc862f96a8abf14a60f4ea5 patch link: https://lore.kernel.org/r/20261006-phy-v5-6-cbe9330a6449%40oss.qualcomm.com patch subject: [PATCH v5 6/6] phy: qcom: snps-femto-v2: Add IPQ9650 support config: x86_64-buildonly-randconfig-1001-20261007 (https://download.01.org/0day-ci/archive/20261007/[email protected]/config) compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261007/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c:449:53: error: call to undeclared function 'FIELD_PREP_CONST'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
449 | { USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0, FSEL_MASK, FSEL_24MHZ },
| ^
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c:39:23: note: expanded from macro 'FSEL_24MHZ'
39 | #define FSEL_24MHZ FIELD_PREP_CONST(FSEL_MASK, 2)
| ^
>> drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c:449:53: error: initializer element is not a compile-time constant
449 | { USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0, FSEL_MASK, FSEL_24MHZ },
| ^~~~~~~~~~
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c:39:23: note: expanded from macro 'FSEL_24MHZ'
39 | #define FSEL_24MHZ FIELD_PREP_CONST(FSEL_MASK, 2)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~2 errors generated.
vim +/FIELD_PREP_CONST +449 drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
444
445 static const struct phy_reg_config hs_6nm_phy_pre_tuning[] = {
446 { USB2_PHY_USB_PHY_CFG0, UTMI_PHY_CMN_CTRL_OVERRIDE_EN, UTMI_PHY_CMN_CTRL_OVERRIDE_EN },
447 { USB2_PHY_USB_PHY_UTMI_CTRL5, POR, POR },
448 { USB2_PHY_USB_PHY_FSEL_SEL, FSEL_SEL, FSEL_SEL },
> 449 { USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0, FSEL_MASK, FSEL_24MHZ }, 450 { USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1, PLLBTUNE, PLLBTUNE },
451 { USB2_PHY_USB_PHY_REFCLK_CTRL, REFCLK_SEL_MASK, REFCLK_SEL_DEFAULT },
452 { USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1, VBUSVLDEXTSEL0, VBUSVLDEXTSEL0 },
453 { USB2_PHY_USB_PHY_HS_PHY_CTRL1, VBUSVLDEXT0, VBUSVLDEXT0 },
454 };
455
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [PATCH v5 6/6] phy: qcom: snps-femto-v2: Add IPQ9650 support
In reply to Varadarajan Narayanankernel test robot noticed the following build errors:
Hi Varadarajan,
kernel test robot noticed the following build errors:
[auto build test ERROR on 15551282e82db772bfc862f96a8abf14a60f4ea5]
url: https://github.com/intel-lab-lkp/linux/commits/Varadarajan-Narayanan/dt-bindings-phy-qcom-qmp-usb-Add-IPQ9650-USB3-PHY/20261006-105915 base: 15551282e82db772bfc862f96a8abf14a60f4ea5 patch link: https://lore.kernel.org/r/20261006-phy-v5-6-cbe9330a6449%40oss.qualcomm.com patch subject: [PATCH v5 6/6] phy: qcom: snps-femto-v2: Add IPQ9650 support config: i386-buildonly-randconfig-1003-20261007 (https://download.01.org/0day-ci/archive/20261007/[email protected]/config) compiler: gcc-13 (Debian 13.3.0-16) 13.3.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261007/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c:39:49: error: implicit declaration of function 'FIELD_PREP_CONST' [-Werror=implicit-function-declaration]
39 | #define FSEL_24MHZ FIELD_PREP_CONST(FSEL_MASK, 2)
| ^~~~~~~~~~~~~~~~
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c:449:60: note: in expansion of macro 'FSEL_24MHZ'
449 | { USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0, FSEL_MASK, FSEL_24MHZ },
| ^~~~~~~~~~
>> drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c:39:49: error: initializer element is not constant
39 | #define FSEL_24MHZ FIELD_PREP_CONST(FSEL_MASK, 2)
| ^~~~~~~~~~~~~~~~
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c:449:60: note: in expansion of macro 'FSEL_24MHZ'
449 | { USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0, FSEL_MASK, FSEL_24MHZ },
| ^~~~~~~~~~
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c:39:49: note: (near initialization for 'hs_6nm_phy_pre_tuning[3].val')
39 | #define FSEL_24MHZ FIELD_PREP_CONST(FSEL_MASK, 2)
| ^~~~~~~~~~~~~~~~
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c:449:60: note: in expansion of macro 'FSEL_24MHZ'
449 | { USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0, FSEL_MASK, FSEL_24MHZ },
| ^~~~~~~~~~cc1: some warnings being treated as errors
vim +/FIELD_PREP_CONST +39 drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
33
34 #define USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0 (0x54)
35 #define SIDDQ BIT(2)
36 #define RETENABLEN BIT(3)
37 #define FSEL_MASK GENMASK(6, 4)
38 #define FSEL_DEFAULT (0x3 << 4)
> 39 #define FSEL_24MHZ FIELD_PREP_CONST(FSEL_MASK, 2)
40 #define VATESTENB_MASK GENMASK(1, 0)
41 --
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki