From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Wesley Cheng <quic_wcheng@quicinc.com>,
Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Christian Marangi <ansuelsmth@gmail.com>,
Andy Gross <agross@codeaurora.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-phy@lists.infradead.org
Subject: Re: [PATCH 04/10] phy: qcom-ipq806x-usb: add MSM8974 HS PHY support
Date: Tue, 18 Aug 2026 10:55:50 +0200 [thread overview]
Message-ID: <eb7b528a-6d5d-46af-b0d7-410bd9acfc0b@oss.qualcomm.com> (raw)
In-Reply-To: <20260810-msm8974-usb3-v1-4-1a47e1185524@oss.qualcomm.com>
On 8/10/26 1:42 PM, Dmitry Baryshkov wrote:
> The MSM8974 DWC3 wrapper embeds the same generation of QSCRATCH
> controlled Synopsys 28nm HS PHY as IPQ806x, but the driver only knows
> the IPQ806x variants, so on MSM8974 the controller runs on whatever
> PHY state the bootloader left behind.
>
> Add the qcom,msm8974-usb-phy-hs compatible with its own init
> sequence: unlike the IPQ806x one, it must not overwrite the whole
> PHY_CTRL register, as the power-on values of the reference frequency
> selection straps have to be preserved. Only enable the UTMI clock and
> the DP/DM MPM clamps, signal VBUS valid towards the link, and disable
> retention.
>
> Assisted-by: Claude:claude-fable-5
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c | 35 +++++++++++++++++++++++++++--
> 1 file changed, 33 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
> index f22c0000479f..21b59d4ca8d2 100644
> --- a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
> +++ b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
> @@ -17,6 +17,7 @@
> #define HSUSB_PHY_CTRL_REG (0x10)
>
> /* PHY_CTRL_REG */
> +#define HSUSB_CLAMP_MPM_DPSE_DMSE_EN_N BIT(26)
> #define HSUSB_CTRL_DMSEHV_CLAMP BIT(24)
> #define HSUSB_CTRL_USB2_SUSPEND BIT(23)
> #define HSUSB_CTRL_UTMI_CLK_EN BIT(21)
> @@ -27,9 +28,13 @@
> #define HSUSB_CTRL_ID_HV_CLAMP BIT(9)
> #define HSUSB_CTRL_OTGSESSVLD_CLAMP BIT(8)
> #define HSUSB_CTRL_CLAMP_EN BIT(7)
> +#define HSUSB_CTRL_CLAMP_MPM_DPSE_DMSE BIT(26)
leftover?
> #define HSUSB_CTRL_RETENABLEN BIT(1)
> #define HSUSB_CTRL_POR BIT(0)
>
> +/* PHY parameter override register (eye diagram tuning) */
> +#define HSUSB_PARAMETER_OVERRIDE_X_REG (0x14)
> +
> /* QSCRATCH_GENERAL_CFG */
> #define HSUSB_GCFG_XHCI_REV BIT(2)
>
> @@ -115,6 +120,8 @@
> #define LATCH_SLEEP 40
> #define LATCH_TIMEOUT 100
>
> +struct phy_drvdata;
Can you just move the declaration here?
> +
> struct usb_phy {
> void __iomem *base;
> struct device *dev;
> @@ -123,11 +130,14 @@ struct usb_phy {
> u32 rx_eq;
> u32 tx_deamp_3_5db;
> u32 mpll;
> + const struct phy_drvdata *drvdata;
> };
>
> struct phy_drvdata {
> struct phy_ops ops;
> u32 clk_rate;
> + u32 hs_tune_val;
> + u32 fsel;
> };
>
> /**
> @@ -273,7 +283,8 @@ static int qcom_ipq806x_usb_hs_phy_init(struct phy *phy)
> HSUSB_CTRL_RETENABLEN | HSUSB_CTRL_COMMONONN |
> HSUSB_CTRL_OTGSESSVLD_CLAMP | HSUSB_CTRL_ID_HV_CLAMP |
> HSUSB_CTRL_UTMI_OTG_VBUS_VALID | HSUSB_CTRL_UTMI_CLK_EN |
> - HSUSB_CTRL_CLAMP_EN | 0x70;
> + HSUSB_CTRL_CLAMP_EN | HSUSB_CLAMP_MPM_DPSE_DMSE_EN_N |
This will *disable* (_N suffix) the clamp on ipq806x too - is that intended?
> + phy_dwc3->drvdata->fsel;
>
> /* use core clock if external reference is not present */
> if (!phy_dwc3->xo_clk)
> @@ -282,9 +293,14 @@ static int qcom_ipq806x_usb_hs_phy_init(struct phy *phy)
> writel(val, phy_dwc3->base + HSUSB_PHY_CTRL_REG);
> usleep_range(2000, 2200);
>
> - /* Disable (bypass) VBUS and ID filters */
> + /* Set XHCI_REV bit (2) to 1 - XHCI version 1.0 */
> writel(HSUSB_GCFG_XHCI_REV, phy_dwc3->base + QSCRATCH_GENERAL_CFG);
>
> + if (phy_dwc3->drvdata->hs_tune_val)
> + usb_phy_write_readback(phy_dwc3, HSUSB_PARAMETER_OVERRIDE_X_REG,
> + 0x03ffffff,
GENMASK(25, 0)
Konrad
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
WARNING: multiple messages have this Message-ID (diff)
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Wesley Cheng <quic_wcheng@quicinc.com>,
Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Christian Marangi <ansuelsmth@gmail.com>,
Andy Gross <agross@codeaurora.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-phy@lists.infradead.org
Subject: Re: [PATCH 04/10] phy: qcom-ipq806x-usb: add MSM8974 HS PHY support
Date: Tue, 18 Aug 2026 10:55:50 +0200 [thread overview]
Message-ID: <eb7b528a-6d5d-46af-b0d7-410bd9acfc0b@oss.qualcomm.com> (raw)
In-Reply-To: <20260810-msm8974-usb3-v1-4-1a47e1185524@oss.qualcomm.com>
On 8/10/26 1:42 PM, Dmitry Baryshkov wrote:
> The MSM8974 DWC3 wrapper embeds the same generation of QSCRATCH
> controlled Synopsys 28nm HS PHY as IPQ806x, but the driver only knows
> the IPQ806x variants, so on MSM8974 the controller runs on whatever
> PHY state the bootloader left behind.
>
> Add the qcom,msm8974-usb-phy-hs compatible with its own init
> sequence: unlike the IPQ806x one, it must not overwrite the whole
> PHY_CTRL register, as the power-on values of the reference frequency
> selection straps have to be preserved. Only enable the UTMI clock and
> the DP/DM MPM clamps, signal VBUS valid towards the link, and disable
> retention.
>
> Assisted-by: Claude:claude-fable-5
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c | 35 +++++++++++++++++++++++++++--
> 1 file changed, 33 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
> index f22c0000479f..21b59d4ca8d2 100644
> --- a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
> +++ b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
> @@ -17,6 +17,7 @@
> #define HSUSB_PHY_CTRL_REG (0x10)
>
> /* PHY_CTRL_REG */
> +#define HSUSB_CLAMP_MPM_DPSE_DMSE_EN_N BIT(26)
> #define HSUSB_CTRL_DMSEHV_CLAMP BIT(24)
> #define HSUSB_CTRL_USB2_SUSPEND BIT(23)
> #define HSUSB_CTRL_UTMI_CLK_EN BIT(21)
> @@ -27,9 +28,13 @@
> #define HSUSB_CTRL_ID_HV_CLAMP BIT(9)
> #define HSUSB_CTRL_OTGSESSVLD_CLAMP BIT(8)
> #define HSUSB_CTRL_CLAMP_EN BIT(7)
> +#define HSUSB_CTRL_CLAMP_MPM_DPSE_DMSE BIT(26)
leftover?
> #define HSUSB_CTRL_RETENABLEN BIT(1)
> #define HSUSB_CTRL_POR BIT(0)
>
> +/* PHY parameter override register (eye diagram tuning) */
> +#define HSUSB_PARAMETER_OVERRIDE_X_REG (0x14)
> +
> /* QSCRATCH_GENERAL_CFG */
> #define HSUSB_GCFG_XHCI_REV BIT(2)
>
> @@ -115,6 +120,8 @@
> #define LATCH_SLEEP 40
> #define LATCH_TIMEOUT 100
>
> +struct phy_drvdata;
Can you just move the declaration here?
> +
> struct usb_phy {
> void __iomem *base;
> struct device *dev;
> @@ -123,11 +130,14 @@ struct usb_phy {
> u32 rx_eq;
> u32 tx_deamp_3_5db;
> u32 mpll;
> + const struct phy_drvdata *drvdata;
> };
>
> struct phy_drvdata {
> struct phy_ops ops;
> u32 clk_rate;
> + u32 hs_tune_val;
> + u32 fsel;
> };
>
> /**
> @@ -273,7 +283,8 @@ static int qcom_ipq806x_usb_hs_phy_init(struct phy *phy)
> HSUSB_CTRL_RETENABLEN | HSUSB_CTRL_COMMONONN |
> HSUSB_CTRL_OTGSESSVLD_CLAMP | HSUSB_CTRL_ID_HV_CLAMP |
> HSUSB_CTRL_UTMI_OTG_VBUS_VALID | HSUSB_CTRL_UTMI_CLK_EN |
> - HSUSB_CTRL_CLAMP_EN | 0x70;
> + HSUSB_CTRL_CLAMP_EN | HSUSB_CLAMP_MPM_DPSE_DMSE_EN_N |
This will *disable* (_N suffix) the clamp on ipq806x too - is that intended?
> + phy_dwc3->drvdata->fsel;
>
> /* use core clock if external reference is not present */
> if (!phy_dwc3->xo_clk)
> @@ -282,9 +293,14 @@ static int qcom_ipq806x_usb_hs_phy_init(struct phy *phy)
> writel(val, phy_dwc3->base + HSUSB_PHY_CTRL_REG);
> usleep_range(2000, 2200);
>
> - /* Disable (bypass) VBUS and ID filters */
> + /* Set XHCI_REV bit (2) to 1 - XHCI version 1.0 */
> writel(HSUSB_GCFG_XHCI_REV, phy_dwc3->base + QSCRATCH_GENERAL_CFG);
>
> + if (phy_dwc3->drvdata->hs_tune_val)
> + usb_phy_write_readback(phy_dwc3, HSUSB_PARAMETER_OVERRIDE_X_REG,
> + 0x03ffffff,
GENMASK(25, 0)
Konrad
next prev parent reply other threads:[~2026-08-18 8:55 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 11:42 [PATCH 00/10] ARM: qcom: enable USB3 (DWC3) controller on MSM8974 platform Dmitry Baryshkov
2026-08-10 11:42 ` Dmitry Baryshkov
2026-08-10 11:42 ` [PATCH 01/10] dt-bindings: usb: qcom,snps-dwc3: document the MSM8974 controller Dmitry Baryshkov
2026-08-10 11:42 ` Dmitry Baryshkov
2026-08-20 6:24 ` Krzysztof Kozlowski
2026-08-20 6:24 ` Krzysztof Kozlowski
2026-08-10 11:42 ` [PATCH 02/10] dt-bindings: phy: qcom,ipq806x-usb-phy-hs: document the MSM8974 HS PHY Dmitry Baryshkov
2026-08-10 11:42 ` Dmitry Baryshkov
2026-08-20 6:28 ` Krzysztof Kozlowski
2026-08-20 6:28 ` Krzysztof Kozlowski
2026-08-10 11:42 ` [PATCH 03/10] dt-bindings: phy: qcom,ipq806x-usb-phy-ss: add MSM8974 SS PHY Dmitry Baryshkov
2026-08-10 11:42 ` Dmitry Baryshkov
2026-08-10 11:54 ` sashiko-bot
2026-08-10 11:54 ` sashiko-bot
2026-08-10 13:05 ` Rob Herring (Arm)
2026-08-10 13:05 ` Rob Herring (Arm)
2026-08-20 6:31 ` Krzysztof Kozlowski
2026-08-20 6:31 ` Krzysztof Kozlowski
2026-08-10 11:42 ` [PATCH 04/10] phy: qcom-ipq806x-usb: add MSM8974 HS PHY support Dmitry Baryshkov
2026-08-10 11:42 ` Dmitry Baryshkov
2026-08-10 11:51 ` sashiko-bot
2026-08-10 11:51 ` sashiko-bot
2026-08-18 8:55 ` Konrad Dybcio [this message]
2026-08-18 8:55 ` Konrad Dybcio
2026-08-10 11:42 ` [PATCH 05/10] phy: qcom-ipq806x-usb: fix the SS PHY TEST_POWERDOWN bit Dmitry Baryshkov
2026-08-10 11:42 ` Dmitry Baryshkov
2026-08-10 11:53 ` sashiko-bot
2026-08-10 11:53 ` sashiko-bot
2026-08-18 8:57 ` Konrad Dybcio
2026-08-18 8:57 ` Konrad Dybcio
2026-08-10 11:42 ` [PATCH 06/10] phy: qcom-ipq806x-usb: fix the PHY_PARAM_CTRL1 field masks Dmitry Baryshkov
2026-08-10 11:42 ` Dmitry Baryshkov
2026-08-10 11:57 ` sashiko-bot
2026-08-10 11:57 ` sashiko-bot
2026-08-18 8:59 ` Konrad Dybcio
2026-08-18 8:59 ` Konrad Dybcio
2026-08-10 11:42 ` [PATCH 07/10] phy: qcom-ipq806x-usb: parse the tx-deamp-3_5db property as documented Dmitry Baryshkov
2026-08-10 11:42 ` Dmitry Baryshkov
2026-08-10 11:49 ` sashiko-bot
2026-08-10 11:49 ` sashiko-bot
2026-08-18 9:00 ` Konrad Dybcio
2026-08-18 9:00 ` Konrad Dybcio
2026-08-10 11:42 ` [PATCH 08/10] phy: qcom-ipq806x-usb: support the MSM8974 SS PHY parameters Dmitry Baryshkov
2026-08-10 11:42 ` Dmitry Baryshkov
2026-08-10 11:56 ` sashiko-bot
2026-08-10 11:56 ` sashiko-bot
2026-08-18 9:01 ` Konrad Dybcio
2026-08-18 9:01 ` Konrad Dybcio
2026-08-10 11:42 ` [PATCH 09/10] ARM: dts: qcom: msm8974: add the USB3 controller and its PHYs Dmitry Baryshkov
2026-08-10 11:42 ` Dmitry Baryshkov
2026-08-10 12:04 ` sashiko-bot
2026-08-10 12:04 ` sashiko-bot
2026-08-18 9:05 ` Konrad Dybcio
2026-08-18 9:05 ` Konrad Dybcio
2026-08-10 11:42 ` [PATCH 10/10] ARM: dts: qcom: apq8074-dragonboard: enable the USB3 host Dmitry Baryshkov
2026-08-10 11:42 ` Dmitry Baryshkov
2026-08-10 12:07 ` sashiko-bot
2026-08-10 12:07 ` sashiko-bot
2026-08-18 9:06 ` Konrad Dybcio
2026-08-18 9:06 ` Konrad Dybcio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eb7b528a-6d5d-46af-b0d7-410bd9acfc0b@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=agross@codeaurora.org \
--cc=andersson@kernel.org \
--cc=ansuelsmth@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=gregkh@linuxfoundation.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=quic_wcheng@quicinc.com \
--cc=robh@kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.