* [PATCH 01/10] dt-bindings: usb: qcom,snps-dwc3: document the MSM8974 controller
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 02/10] dt-bindings: phy: qcom,ipq806x-usb-phy-hs: document the MSM8974 HS PHY Dmitry Baryshkov
` (8 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Dmitry Baryshkov @ 2026-08-10 11:42 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Wesley Cheng, Vinod Koul, Neil Armstrong,
Christian Marangi, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
Add the qcom,msm8974-dwc3 compatible. The controller uses the same four
clocks as IPQ8074. Unlike other controllers, it has only 3 IRQs routed:
core, power event and HS PHY.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
.../devicetree/bindings/usb/qcom,snps-dwc3.yaml | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml
index ea60f7220afe..9f91c8711e02 100644
--- a/Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml
@@ -40,6 +40,7 @@ properties:
- qcom,maili-dwc3
- qcom,milos-dwc3
- qcom,msm8953-dwc3
+ - qcom,msm8974-dwc3
- qcom,msm8994-dwc3
- qcom,msm8996-dwc3
- qcom,msm8998-dwc3
@@ -268,6 +269,7 @@ allOf:
contains:
enum:
- qcom,ipq8074-dwc3
+ - qcom,msm8974-dwc3
- qcom,qdu1000-dwc3
then:
properties:
@@ -453,6 +455,23 @@ allOf:
- const: qusb2_phy
- const: ss_phy_irq
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - qcom,msm8974-dwc3
+ then:
+ properties:
+ interrupts:
+ minItems: 3
+ maxItems: 3
+ interrupt-names:
+ items:
+ - const: dwc_usb3
+ - const: pwr_event
+ - const: hs_phy_irq
+
- if:
properties:
compatible:
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 02/10] dt-bindings: phy: qcom,ipq806x-usb-phy-hs: document the MSM8974 HS PHY
2026-08-10 11:42 [PATCH 00/10] ARM: qcom: enable USB3 (DWC3) controller on MSM8974 platform 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-10 11:42 ` [PATCH 03/10] dt-bindings: phy: qcom,ipq806x-usb-phy-ss: add MSM8974 SS PHY Dmitry Baryshkov
` (7 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Dmitry Baryshkov @ 2026-08-10 11:42 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Wesley Cheng, Vinod Koul, Neil Armstrong,
Christian Marangi, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
The MSM8974 DWC3 wrapper contains the same generation of Synopsys 28nm
HS PHY as IPQ806x, controlled through the QSCRATCH registers, but the
binding only covers IPQ806x, leaving the MSM8974 controller to run on
bootloader-configured PHY state.
Add the qcom,msm8974-usb-phy-hs compatible.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-hs.yaml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-hs.yaml b/Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-hs.yaml
index 35296c588e78..de6f94997d5e 100644
--- a/Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-hs.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-hs.yaml
@@ -4,7 +4,7 @@
$id: http://devicetree.org/schemas/phy/qcom,ipq806x-usb-phy-hs.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
-title: Qualcomm ipq806x usb DWC3 HS PHY CONTROLLER
+title: Qualcomm ipq806x/msm8974 usb DWC3 HS PHY CONTROLLER
maintainers:
- Ansuel Smith <ansuelsmth@gmail.com>
@@ -16,7 +16,9 @@ description:
properties:
compatible:
- const: qcom,ipq806x-usb-phy-hs
+ enum:
+ - qcom,ipq806x-usb-phy-hs
+ - qcom,msm8974-usb-phy-hs
"#phy-cells":
const: 0
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 03/10] dt-bindings: phy: qcom,ipq806x-usb-phy-ss: add MSM8974 SS PHY
2026-08-10 11:42 [PATCH 00/10] ARM: qcom: enable USB3 (DWC3) controller on MSM8974 platform 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 ` [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-10 13:05 ` Rob Herring (Arm)
2026-08-10 11:42 ` [PATCH 04/10] phy: qcom-ipq806x-usb: add MSM8974 HS PHY support Dmitry Baryshkov
` (6 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Dmitry Baryshkov @ 2026-08-10 11:42 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Wesley Cheng, Vinod Koul, Neil Armstrong,
Christian Marangi, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
The MSM8974 DWC3 wrapper contains the same QSCRATCH-controlled
SuperSpeed PHY as IPQ806x (SS_PHY_CTRL at qscratch + 0x30 with an
identical bit layout, CR protocol port for the lane registers). The
SoC-specific params differ from those specified for IPQ806x, so add new
compatible for the PHY on MSM8974.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-ss.yaml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-ss.yaml b/Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-ss.yaml
index 6cf5c6c06072..29cb43cf7348 100644
--- a/Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-ss.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-ss.yaml
@@ -16,7 +16,9 @@ description:
properties:
compatible:
- const: qcom,ipq806x-usb-phy-ss
+ oneOf:
+ - const: qcom,ipq806x-usb-phy-ss
+ - const: qcom,msm8974-usb-phy-ss
"#phy-cells":
const: 0
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 03/10] dt-bindings: phy: qcom,ipq806x-usb-phy-ss: add MSM8974 SS PHY
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 13:05 ` Rob Herring (Arm)
0 siblings, 0 replies; 19+ messages in thread
From: Rob Herring (Arm) @ 2026-08-10 13:05 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Wesley Cheng, Conor Dooley, Neil Armstrong, Andy Gross,
Krzysztof Kozlowski, linux-phy, Greg Kroah-Hartman, devicetree,
linux-arm-msm, Bjorn Andersson, Christian Marangi, Konrad Dybcio,
Vinod Koul, linux-usb, linux-kernel
On Mon, 10 Aug 2026 14:42:33 +0300, Dmitry Baryshkov wrote:
> The MSM8974 DWC3 wrapper contains the same QSCRATCH-controlled
> SuperSpeed PHY as IPQ806x (SS_PHY_CTRL at qscratch + 0x30 with an
> identical bit layout, CR protocol port for the lane registers). The
> SoC-specific params differ from those specified for IPQ806x, so add new
> compatible for the PHY on MSM8974.
>
> Assisted-by: Claude:claude-fable-5
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-ss.yaml | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-ss.yaml: properties:compatible:oneOf: [{'const': 'qcom,ipq806x-usb-phy-ss'}, {'const': 'qcom,msm8974-usb-phy-ss'}] should not be valid under {'items': {'propertyNames': {'const': 'const'}, 'required': ['const']}}
hint: Use 'enum' rather than 'oneOf' + 'const' entries
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.kernel.org/project/devicetree/patch/20260810-msm8974-usb3-v1-3-1a47e1185524@oss.qualcomm.com
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 04/10] phy: qcom-ipq806x-usb: add MSM8974 HS PHY support
2026-08-10 11:42 [PATCH 00/10] ARM: qcom: enable USB3 (DWC3) controller on MSM8974 platform Dmitry Baryshkov
` (2 preceding siblings ...)
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-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
` (5 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Dmitry Baryshkov @ 2026-08-10 11:42 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Wesley Cheng, Vinod Koul, Neil Armstrong,
Christian Marangi, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
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)
#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;
+
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 |
+ 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,
+ phy_dwc3->drvdata->hs_tune_val);
+
return 0;
}
@@ -458,6 +474,18 @@ static const struct phy_drvdata qcom_ipq806x_usb_hs_drvdata = {
.owner = THIS_MODULE,
},
.clk_rate = 60000000,
+ .fsel = 0x70,
+};
+
+static const struct phy_drvdata qcom_msm8974_usb_hs_drvdata = {
+ .ops = {
+ .init = qcom_ipq806x_usb_hs_phy_init,
+ .exit = qcom_ipq806x_usb_hs_phy_exit,
+ .owner = THIS_MODULE,
+ },
+ .clk_rate = 60000000,
+ .hs_tune_val = 0x00d191a4,
+ .fsel = 0x30,
};
static const struct phy_drvdata qcom_ipq806x_usb_ss_drvdata = {
@@ -474,6 +502,8 @@ static const struct of_device_id qcom_ipq806x_usb_phy_table[] = {
.data = &qcom_ipq806x_usb_hs_drvdata },
{ .compatible = "qcom,ipq806x-usb-phy-ss",
.data = &qcom_ipq806x_usb_ss_drvdata },
+ { .compatible = "qcom,msm8974-usb-phy-hs",
+ .data = &qcom_msm8974_usb_hs_drvdata },
{ /* Sentinel */ }
};
MODULE_DEVICE_TABLE(of, qcom_ipq806x_usb_phy_table);
@@ -492,6 +522,7 @@ static int qcom_ipq806x_usb_phy_probe(struct platform_device *pdev)
return -ENOMEM;
data = of_device_get_match_data(&pdev->dev);
+ phy_dwc3->drvdata = data;
phy_dwc3->dev = &pdev->dev;
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 04/10] phy: qcom-ipq806x-usb: add MSM8974 HS PHY support
2026-08-10 11:42 ` [PATCH 04/10] phy: qcom-ipq806x-usb: add MSM8974 HS PHY support Dmitry Baryshkov
@ 2026-08-18 8:55 ` Konrad Dybcio
0 siblings, 0 replies; 19+ messages in thread
From: Konrad Dybcio @ 2026-08-18 8:55 UTC (permalink / raw)
To: Dmitry Baryshkov, Greg Kroah-Hartman, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Wesley Cheng, Vinod Koul,
Neil Armstrong, Christian Marangi, Andy Gross, Bjorn Andersson,
Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
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
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 05/10] phy: qcom-ipq806x-usb: fix the SS PHY TEST_POWERDOWN bit
2026-08-10 11:42 [PATCH 00/10] ARM: qcom: enable USB3 (DWC3) controller on MSM8974 platform Dmitry Baryshkov
` (3 preceding siblings ...)
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-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
` (4 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Dmitry Baryshkov @ 2026-08-10 11:42 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Wesley Cheng, Vinod Koul, Neil Armstrong,
Christian Marangi, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
The SS PHY exit sequence tries to put the PHY into retention via the
TEST_POWERDOWN bit of SS_PHY_CTRL, but defines that bit as BIT(27). In
the DWC3 QSCRATCH SS_PHY_CTRL register TEST_POWERDOWN is bit 26 (see
the downstream phy-msm-ssusb driver for the same IP generation), so the
sequence pokes an unrelated bit and the PHY is never powered down.
Fixes: ef19b117b834 ("phy: qualcomm: add qcom ipq806x dwc usb phy driver")
Assisted-by: Claude:claude-fable-5
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
index 21b59d4ca8d2..cf77e0a66e20 100644
--- a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
+++ b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
@@ -51,7 +51,7 @@
/* PHY_CTRL_REG */
#define SSUSB_CTRL_REF_USE_PAD BIT(28)
-#define SSUSB_CTRL_TEST_POWERDOWN BIT(27)
+#define SSUSB_CTRL_TEST_POWERDOWN BIT(26)
#define SSUSB_CTRL_LANE0_PWR_PRESENT BIT(24)
#define SSUSB_CTRL_SS_PHY_EN BIT(8)
#define SSUSB_CTRL_SS_PHY_RESET BIT(7)
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 05/10] phy: qcom-ipq806x-usb: fix the SS PHY TEST_POWERDOWN bit
2026-08-10 11:42 ` [PATCH 05/10] phy: qcom-ipq806x-usb: fix the SS PHY TEST_POWERDOWN bit Dmitry Baryshkov
@ 2026-08-18 8:57 ` Konrad Dybcio
0 siblings, 0 replies; 19+ messages in thread
From: Konrad Dybcio @ 2026-08-18 8:57 UTC (permalink / raw)
To: Dmitry Baryshkov, Greg Kroah-Hartman, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Wesley Cheng, Vinod Koul,
Neil Armstrong, Christian Marangi, Andy Gross, Bjorn Andersson,
Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
On 8/10/26 1:42 PM, Dmitry Baryshkov wrote:
> The SS PHY exit sequence tries to put the PHY into retention via the
> TEST_POWERDOWN bit of SS_PHY_CTRL, but defines that bit as BIT(27). In
> the DWC3 QSCRATCH SS_PHY_CTRL register TEST_POWERDOWN is bit 26 (see
> the downstream phy-msm-ssusb driver for the same IP generation), so the
> sequence pokes an unrelated bit and the PHY is never powered down.
>
> Fixes: ef19b117b834 ("phy: qualcomm: add qcom ipq806x dwc usb phy driver")
> Assisted-by: Claude:claude-fable-5
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 06/10] phy: qcom-ipq806x-usb: fix the PHY_PARAM_CTRL1 field masks
2026-08-10 11:42 [PATCH 00/10] ARM: qcom: enable USB3 (DWC3) controller on MSM8974 platform Dmitry Baryshkov
` (4 preceding siblings ...)
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-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
` (3 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Dmitry Baryshkov @ 2026-08-10 11:42 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Wesley Cheng, Vinod Koul, Neil Armstrong,
Christian Marangi, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
Each of the PHY_PARAM_CTRL1 field masks extends one bit below its
documented field: TX_FULL_SWING [26:20] is coded as GENMASK(26, 19),
TX_DEEMPH_6DB [19:14] as GENMASK(19, 13), TX_DEEMPH_3_5DB [13:8] as
GENMASK(13, 7) and LOS_BIAS [7:3] as GENMASK(7, 2). Also, the field
described as LOS_BIAS in reality is called LOS_LEVEL. FIELD_PREP against
these masks places every value one bit short of its field, so the
programmed swing/de-emphasis/LOS parameters land shifted and the
neighbouring fields are corrupted; the masked write-readback in the SS
PHY init reports 'write: ... to QSCRATCH: 4 FAILED'.
Align the masks with the documented field positions.
Fixes: ef19b117b834 ("phy: qualcomm: add qcom ipq806x dwc usb phy driver")
Assisted-by: Claude:claude-fable-5
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
index cf77e0a66e20..3d3e9d6da298 100644
--- a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
+++ b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
@@ -68,15 +68,17 @@
#define SSPHY_MPLL_VALUE 0
/* QSCRATCH PHY_PARAM_CTRL1 fields */
-#define PHY_PARAM_CTRL1_TX_FULL_SWING_MASK GENMASK(26, 19)
-#define PHY_PARAM_CTRL1_TX_DEEMPH_6DB_MASK GENMASK(19, 13)
-#define PHY_PARAM_CTRL1_TX_DEEMPH_3_5DB_MASK GENMASK(13, 7)
-#define PHY_PARAM_CTRL1_LOS_BIAS_MASK GENMASK(7, 2)
+#define PHY_PARAM_CTRL1_TX_FULL_SWING_MASK GENMASK(26, 20)
+#define PHY_PARAM_CTRL1_TX_DEEMPH_6DB_MASK GENMASK(19, 14)
+#define PHY_PARAM_CTRL1_TX_DEEMPH_3_5DB_MASK GENMASK(13, 8)
+#define PHY_PARAM_CTRL1_LOS_LEVEL_MASK GENMASK(7, 3)
+#define PHY_PARAM_CTRL1_LOS_BIAS_MASK GENMASK(2, 0)
#define PHY_PARAM_CTRL1_MASK \
(PHY_PARAM_CTRL1_TX_FULL_SWING_MASK | \
PHY_PARAM_CTRL1_TX_DEEMPH_6DB_MASK | \
PHY_PARAM_CTRL1_TX_DEEMPH_3_5DB_MASK | \
+ PHY_PARAM_CTRL1_LOS_LEVEL_MASK | \
PHY_PARAM_CTRL1_LOS_BIAS_MASK)
#define PHY_PARAM_CTRL1_TX_FULL_SWING(x) \
@@ -85,6 +87,8 @@
FIELD_PREP(PHY_PARAM_CTRL1_TX_DEEMPH_6DB_MASK, (x))
#define PHY_PARAM_CTRL1_TX_DEEMPH_3_5DB(x) \
FIELD_PREP(PHY_PARAM_CTRL1_TX_DEEMPH_3_5DB_MASK, x)
+#define PHY_PARAM_CTRL1_LOS_LEVEL(x) \
+ FIELD_PREP(PHY_PARAM_CTRL1_LOS_LEVEL_MASK, (x))
#define PHY_PARAM_CTRL1_LOS_BIAS(x) \
FIELD_PREP(PHY_PARAM_CTRL1_LOS_BIAS_MASK, (x))
@@ -436,7 +440,8 @@ static int qcom_ipq806x_usb_ss_phy_init(struct phy *phy)
data |= PHY_PARAM_CTRL1_TX_FULL_SWING(0x6e) |
PHY_PARAM_CTRL1_TX_DEEMPH_6DB(0x20) |
PHY_PARAM_CTRL1_TX_DEEMPH_3_5DB(phy_dwc3->tx_deamp_3_5db) |
- PHY_PARAM_CTRL1_LOS_BIAS(0x9);
+ PHY_PARAM_CTRL1_LOS_LEVEL(0x9) |
+ PHY_PARAM_CTRL1_LOS_BIAS(0x0);
usb_phy_write_readback(phy_dwc3, SSUSB_PHY_PARAM_CTRL_1,
PHY_PARAM_CTRL1_MASK, data);
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 06/10] phy: qcom-ipq806x-usb: fix the PHY_PARAM_CTRL1 field masks
2026-08-10 11:42 ` [PATCH 06/10] phy: qcom-ipq806x-usb: fix the PHY_PARAM_CTRL1 field masks Dmitry Baryshkov
@ 2026-08-18 8:59 ` Konrad Dybcio
0 siblings, 0 replies; 19+ messages in thread
From: Konrad Dybcio @ 2026-08-18 8:59 UTC (permalink / raw)
To: Dmitry Baryshkov, Greg Kroah-Hartman, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Wesley Cheng, Vinod Koul,
Neil Armstrong, Christian Marangi, Andy Gross, Bjorn Andersson,
Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
On 8/10/26 1:42 PM, Dmitry Baryshkov wrote:
> Each of the PHY_PARAM_CTRL1 field masks extends one bit below its
> documented field: TX_FULL_SWING [26:20] is coded as GENMASK(26, 19),
> TX_DEEMPH_6DB [19:14] as GENMASK(19, 13), TX_DEEMPH_3_5DB [13:8] as
> GENMASK(13, 7) and LOS_BIAS [7:3] as GENMASK(7, 2). Also, the field
> described as LOS_BIAS in reality is called LOS_LEVEL. FIELD_PREP against
> these masks places every value one bit short of its field, so the
> programmed swing/de-emphasis/LOS parameters land shifted and the
> neighbouring fields are corrupted; the masked write-readback in the SS
> PHY init reports 'write: ... to QSCRATCH: 4 FAILED'.
>
> Align the masks with the documented field positions.
>
> Fixes: ef19b117b834 ("phy: qualcomm: add qcom ipq806x dwc usb phy driver")
> Assisted-by: Claude:claude-fable-5
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
[...]
> @@ -436,7 +440,8 @@ static int qcom_ipq806x_usb_ss_phy_init(struct phy *phy)
> data |= PHY_PARAM_CTRL1_TX_FULL_SWING(0x6e) |
> PHY_PARAM_CTRL1_TX_DEEMPH_6DB(0x20) |
> PHY_PARAM_CTRL1_TX_DEEMPH_3_5DB(phy_dwc3->tx_deamp_3_5db) |
> - PHY_PARAM_CTRL1_LOS_BIAS(0x9);
> + PHY_PARAM_CTRL1_LOS_LEVEL(0x9) |
> + PHY_PARAM_CTRL1_LOS_BIAS(0x0);
lgtm except the POR value of BIAS is 2 on 8974 and 0 on ipq806x
Konrad
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 07/10] phy: qcom-ipq806x-usb: parse the tx-deamp-3_5db property as documented
2026-08-10 11:42 [PATCH 00/10] ARM: qcom: enable USB3 (DWC3) controller on MSM8974 platform Dmitry Baryshkov
` (5 preceding siblings ...)
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-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
` (2 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Dmitry Baryshkov @ 2026-08-10 11:42 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Wesley Cheng, Vinod Koul, Neil Armstrong,
Christian Marangi, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
The driver reads the transmit de-emphasis override from
qcom,tx-deamp_3_5db while the binding documents qcom,tx-deamp-3_5db,
so a device tree following the binding is silently ignored and the
default is used instead. No in-tree device tree uses either spelling.
Parse the property under its documented name.
Fixes: ef19b117b834 ("phy: qualcomm: add qcom ipq806x dwc usb phy driver")
Assisted-by: Claude:claude-fable-5
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
index 3d3e9d6da298..86e8e869a743 100644
--- a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
+++ b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
@@ -561,7 +561,7 @@ static int qcom_ipq806x_usb_phy_probe(struct platform_device *pdev)
&phy_dwc3->rx_eq))
phy_dwc3->rx_eq = SSPHY_RX_EQ_VALUE;
- if (device_property_read_u32(&pdev->dev, "qcom,tx-deamp_3_5db",
+ if (device_property_read_u32(&pdev->dev, "qcom,tx-deamp-3_5db",
&phy_dwc3->tx_deamp_3_5db))
phy_dwc3->tx_deamp_3_5db = SSPHY_TX_DEEMPH_3_5DB;
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 07/10] phy: qcom-ipq806x-usb: parse the tx-deamp-3_5db property as documented
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-18 9:00 ` Konrad Dybcio
0 siblings, 0 replies; 19+ messages in thread
From: Konrad Dybcio @ 2026-08-18 9:00 UTC (permalink / raw)
To: Dmitry Baryshkov, Greg Kroah-Hartman, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Wesley Cheng, Vinod Koul,
Neil Armstrong, Christian Marangi, Andy Gross, Bjorn Andersson,
Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
On 8/10/26 1:42 PM, Dmitry Baryshkov wrote:
> The driver reads the transmit de-emphasis override from
> qcom,tx-deamp_3_5db while the binding documents qcom,tx-deamp-3_5db,
> so a device tree following the binding is silently ignored and the
> default is used instead. No in-tree device tree uses either spelling.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 08/10] phy: qcom-ipq806x-usb: support the MSM8974 SS PHY parameters
2026-08-10 11:42 [PATCH 00/10] ARM: qcom: enable USB3 (DWC3) controller on MSM8974 platform Dmitry Baryshkov
` (6 preceding siblings ...)
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-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 ` [PATCH 10/10] ARM: dts: qcom: apq8074-dragonboard: enable the USB3 host Dmitry Baryshkov
9 siblings, 1 reply; 19+ messages in thread
From: Dmitry Baryshkov @ 2026-08-10 11:42 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Wesley Cheng, Vinod Koul, Neil Armstrong,
Christian Marangi, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
For the MSM8974 SS PHY instance the vendor kernels program analog
parameters different from those used for IPQ806x. With the IPQ806x
values the masked write-readback of PHY_PARAM_CTRL1 fails and the lane
runs with wrong launch amplitudes.
Add platform data for the MSM8974 compatible.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c | 57 ++++++++++++++++++++++-------
1 file changed, 44 insertions(+), 13 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
index 86e8e869a743..35abe9ae0542 100644
--- a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
+++ b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
@@ -142,6 +142,11 @@ struct phy_drvdata {
u32 clk_rate;
u32 hs_tune_val;
u32 fsel;
+ u32 tx_amplitude;
+ u32 tx_full_swing;
+ u32 los_level;
+ u32 los_bias;
+ bool set_deemph_6db;
};
/**
@@ -322,7 +327,7 @@ static int qcom_ipq806x_usb_ss_phy_init(struct phy *phy)
{
struct usb_phy *phy_dwc3 = phy_get_drvdata(phy);
int ret;
- u32 data;
+ u32 data, mask;
ret = clk_prepare_enable(phy_dwc3->xo_clk);
if (ret)
@@ -414,7 +419,7 @@ static int qcom_ipq806x_usb_ss_phy_init(struct phy *phy)
data &= ~TX_OVRD_DRV_LO_PREEMPH_MASK;
data |= TX_OVRD_DRV_LO_PREEMPH(phy_dwc3->tx_deamp_3_5db);
data &= ~TX_OVRD_DRV_LO_AMPLITUDE_MASK;
- data |= 0x6E;
+ data |= phy_dwc3->drvdata->tx_amplitude;
data |= TX_OVRD_DRV_LO_EN;
ret = usb_ss_write_phycreg(phy_dwc3,
SSPHY_CTRL_TX_OVRD_DRV_LO(0), data);
@@ -433,18 +438,22 @@ static int qcom_ipq806x_usb_ss_phy_init(struct phy *phy)
* TX_DEEMPH_3_5DB [13:8] set based on SoC version
* LOS_BIAS [7:3] to 9
*/
- data = readl(phy_dwc3->base + SSUSB_PHY_PARAM_CTRL_1);
-
- data &= ~PHY_PARAM_CTRL1_MASK;
-
- data |= PHY_PARAM_CTRL1_TX_FULL_SWING(0x6e) |
- PHY_PARAM_CTRL1_TX_DEEMPH_6DB(0x20) |
- PHY_PARAM_CTRL1_TX_DEEMPH_3_5DB(phy_dwc3->tx_deamp_3_5db) |
- PHY_PARAM_CTRL1_LOS_LEVEL(0x9) |
- PHY_PARAM_CTRL1_LOS_BIAS(0x0);
+ mask = PHY_PARAM_CTRL1_TX_FULL_SWING_MASK |
+ PHY_PARAM_CTRL1_TX_DEEMPH_3_5DB_MASK |
+ PHY_PARAM_CTRL1_LOS_LEVEL_MASK |
+ PHY_PARAM_CTRL1_LOS_BIAS_MASK;
+
+ data = PHY_PARAM_CTRL1_TX_FULL_SWING(phy_dwc3->drvdata->tx_full_swing) |
+ PHY_PARAM_CTRL1_TX_DEEMPH_3_5DB(phy_dwc3->tx_deamp_3_5db) |
+ PHY_PARAM_CTRL1_LOS_LEVEL(phy_dwc3->drvdata->los_level) |
+ PHY_PARAM_CTRL1_LOS_BIAS(phy_dwc3->drvdata->los_bias);
+
+ if (phy_dwc3->drvdata->set_deemph_6db) {
+ mask |= PHY_PARAM_CTRL1_TX_DEEMPH_6DB_MASK;
+ data |= PHY_PARAM_CTRL1_TX_DEEMPH_6DB(0x20);
+ }
- usb_phy_write_readback(phy_dwc3, SSUSB_PHY_PARAM_CTRL_1,
- PHY_PARAM_CTRL1_MASK, data);
+ usb_phy_write_readback(phy_dwc3, SSUSB_PHY_PARAM_CTRL_1, mask, data);
err_phy_trans:
return ret;
@@ -500,6 +509,26 @@ static const struct phy_drvdata qcom_ipq806x_usb_ss_drvdata = {
.owner = THIS_MODULE,
},
.clk_rate = 125000000,
+ .tx_amplitude = 0x6e,
+ .tx_full_swing = 0x6e,
+ .los_level = 0x9,
+ .los_bias = 0x0,
+ .set_deemph_6db = true,
+};
+
+/* MSM8974: values from the vendor phy-msm-ssusb driver */
+static const struct phy_drvdata qcom_msm8974_usb_ss_drvdata = {
+ .ops = {
+ .init = qcom_ipq806x_usb_ss_phy_init,
+ .exit = qcom_ipq806x_usb_ss_phy_exit,
+ .owner = THIS_MODULE,
+ },
+ .clk_rate = 125000000,
+ .tx_amplitude = 0x7f,
+ .tx_full_swing = 0x7f,
+ .los_level = 0x9,
+ .los_bias = 0x5,
+ .set_deemph_6db = false,
};
static const struct of_device_id qcom_ipq806x_usb_phy_table[] = {
@@ -509,6 +538,8 @@ static const struct of_device_id qcom_ipq806x_usb_phy_table[] = {
.data = &qcom_ipq806x_usb_ss_drvdata },
{ .compatible = "qcom,msm8974-usb-phy-hs",
.data = &qcom_msm8974_usb_hs_drvdata },
+ { .compatible = "qcom,msm8974-usb-phy-ss",
+ .data = &qcom_msm8974_usb_ss_drvdata },
{ /* Sentinel */ }
};
MODULE_DEVICE_TABLE(of, qcom_ipq806x_usb_phy_table);
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 08/10] phy: qcom-ipq806x-usb: support the MSM8974 SS PHY parameters
2026-08-10 11:42 ` [PATCH 08/10] phy: qcom-ipq806x-usb: support the MSM8974 SS PHY parameters Dmitry Baryshkov
@ 2026-08-18 9:01 ` Konrad Dybcio
0 siblings, 0 replies; 19+ messages in thread
From: Konrad Dybcio @ 2026-08-18 9:01 UTC (permalink / raw)
To: Dmitry Baryshkov, Greg Kroah-Hartman, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Wesley Cheng, Vinod Koul,
Neil Armstrong, Christian Marangi, Andy Gross, Bjorn Andersson,
Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
On 8/10/26 1:42 PM, Dmitry Baryshkov wrote:
> For the MSM8974 SS PHY instance the vendor kernels program analog
> parameters different from those used for IPQ806x. With the IPQ806x
> values the masked write-readback of PHY_PARAM_CTRL1 fails and the lane
> runs with wrong launch amplitudes.
>
> Add platform data for the MSM8974 compatible.
>
> Assisted-by: Claude:claude-fable-5
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 09/10] ARM: dts: qcom: msm8974: add the USB3 controller and its PHYs
2026-08-10 11:42 [PATCH 00/10] ARM: qcom: enable USB3 (DWC3) controller on MSM8974 platform Dmitry Baryshkov
` (7 preceding siblings ...)
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-18 9:05 ` Konrad Dybcio
2026-08-10 11:42 ` [PATCH 10/10] ARM: dts: qcom: apq8074-dragonboard: enable the USB3 host Dmitry Baryshkov
9 siblings, 1 reply; 19+ messages in thread
From: Dmitry Baryshkov @ 2026-08-10 11:42 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Wesley Cheng, Vinod Koul, Neil Armstrong,
Christian Marangi, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
The primary USB port of MSM8974 - a Synopsys DWC3 behind the standard
Qualcomm wrapper - is not described, so boards can only use the two
ChipIdea controllers.
Describe the wrapper and the DWC3 core together with both of its
QSCRATCH-controlled PHYs: the HS PHY at qscratch + 0x00 and the
SuperSpeed PHY at qscratch + 0x30 (compatible with the ipq806x SS PHY).
The HS PHY reference is the 60 MHz mock UTMI clock plus an RPM vote
keeping the XO alive; the SS PHY takes its reference from the pads,
driven by the PMIC differential XO buffer (diff_clk), matching the
ref_clk the vendor kernel hands to the DWC3 wrapper.
Both PHYs must be described and initialized even for high-speed-only
use: leaving the SS PHY dead does not just cap the speed, it confuses
the upstream-facing state machine of at least the TUSB8040A hub on the
APQ8074 dragonboard, which then connects but never answers enumeration
in any speed configuration.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 47 ++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
index 06c0af0aa317..bac3c8772e0a 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
@@ -713,6 +713,53 @@ blsp2_i2c6: i2c@f9968000 {
#size-cells = <0>;
};
+ usb3: usb@f9200000 {
+ compatible = "qcom,msm8974-dwc3", "qcom,snps-dwc3";
+ reg = <0xf9200000 0xfc000>;
+ interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "dwc_usb3", "pwr_event",
+ "hs_phy_irq";
+ clocks = <&gcc GCC_SYS_NOC_USB3_AXI_CLK>,
+ <&gcc GCC_USB30_MASTER_CLK>,
+ <&gcc GCC_USB30_SLEEP_CLK>,
+ <&gcc GCC_USB30_MOCK_UTMI_CLK>;
+ clock-names = "cfg_noc", "core", "sleep", "mock_utmi";
+ assigned-clocks = <&gcc GCC_USB30_MOCK_UTMI_CLK>,
+ <&gcc GCC_USB30_MASTER_CLK>;
+ assigned-clock-rates = <60000000>, <125000000>;
+ resets = <&gcc GCC_USB_30_BCR>;
+ phys = <&usb3_hs_phy>, <&usb3_ss_phy>;
+ phy-names = "usb2-phy", "usb3-phy";
+ snps,dis_u2_susphy_quirk;
+ snps,dis_enblslpm_quirk;
+ status = "disabled";
+ };
+
+ usb3_hs_phy: phy@f92f8800 {
+ compatible = "qcom,msm8974-usb-phy-hs";
+ reg = <0xf92f8800 0x30>;
+ clocks = <&gcc GCC_USB30_MOCK_UTMI_CLK>,
+ <&rpmcc RPM_SMD_XO_CLK_SRC>;
+ clock-names = "ref", "xo";
+ #phy-cells = <0>;
+ status = "disabled";
+ };
+
+ usb3_ss_phy: phy@f92f8830 {
+ compatible = "qcom,msm8974-usb-phy-ss",
+ "qcom,ipq806x-usb-phy-ss";
+ reg = <0xf92f8830 0x30>;
+ clocks = <&gcc GCC_USB30_MASTER_CLK>,
+ <&rpmcc RPM_SMD_DIFF_CLK>;
+ clock-names = "ref", "xo";
+ #phy-cells = <0>;
+ qcom,rx-eq = <3>;
+ qcom,tx-deamp-3_5db = <22>;
+ status = "disabled";
+ };
+
usb: usb@f9a55000 {
compatible = "qcom,ci-hdrc";
reg = <0xf9a55000 0x200>,
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 09/10] ARM: dts: qcom: msm8974: add the USB3 controller and its PHYs
2026-08-10 11:42 ` [PATCH 09/10] ARM: dts: qcom: msm8974: add the USB3 controller and its PHYs Dmitry Baryshkov
@ 2026-08-18 9:05 ` Konrad Dybcio
0 siblings, 0 replies; 19+ messages in thread
From: Konrad Dybcio @ 2026-08-18 9:05 UTC (permalink / raw)
To: Dmitry Baryshkov, Greg Kroah-Hartman, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Wesley Cheng, Vinod Koul,
Neil Armstrong, Christian Marangi, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Wesley Cheng
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
On 8/10/26 1:42 PM, Dmitry Baryshkov wrote:
> The primary USB port of MSM8974 - a Synopsys DWC3 behind the standard
> Qualcomm wrapper - is not described, so boards can only use the two
> ChipIdea controllers.
[...]
> arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 47 ++++++++++++++++++++++++++++++++
> 1 file changed, 47 insertions(+)
>
> diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
> index 06c0af0aa317..bac3c8772e0a 100644
> --- a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
> +++ b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
> @@ -713,6 +713,53 @@ blsp2_i2c6: i2c@f9968000 {
> #size-cells = <0>;
> };
>
> + usb3: usb@f9200000 {
> + compatible = "qcom,msm8974-dwc3", "qcom,snps-dwc3";
> + reg = <0xf9200000 0xfc000>;
> + interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
> + interrupt-names = "dwc_usb3", "pwr_event",
> + "hs_phy_irq";
1 a line (also in a couple cases below)
> + clocks = <&gcc GCC_SYS_NOC_USB3_AXI_CLK>,
> + <&gcc GCC_USB30_MASTER_CLK>,
> + <&gcc GCC_USB30_SLEEP_CLK>,
> + <&gcc GCC_USB30_MOCK_UTMI_CLK>;
> + clock-names = "cfg_noc", "core", "sleep", "mock_utmi";
> + assigned-clocks = <&gcc GCC_USB30_MOCK_UTMI_CLK>,
> + <&gcc GCC_USB30_MASTER_CLK>;
> + assigned-clock-rates = <60000000>, <125000000>;
> + resets = <&gcc GCC_USB_30_BCR>;
> + phys = <&usb3_hs_phy>, <&usb3_ss_phy>;
> + phy-names = "usb2-phy", "usb3-phy";
> + snps,dis_u2_susphy_quirk;
> + snps,dis_enblslpm_quirk;
We usually have 10x as many quirks here, I guess +Wesley may not remember
the suitable values at this point, but I think he mentioned there is a set
of "common defaults"
> + status = "disabled";
\n before status, please
Needs power-domains + required-opps
> + };
> +
> + usb3_hs_phy: phy@f92f8800 {
I don't like re-claiming the memory space.. Should we make these PHYs the
subnodes of the qc glue?
Konrad
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 10/10] ARM: dts: qcom: apq8074-dragonboard: enable the USB3 host
2026-08-10 11:42 [PATCH 00/10] ARM: qcom: enable USB3 (DWC3) controller on MSM8974 platform Dmitry Baryshkov
` (8 preceding siblings ...)
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-18 9:06 ` Konrad Dybcio
9 siblings, 1 reply; 19+ messages in thread
From: Dmitry Baryshkov @ 2026-08-10 11:42 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Wesley Cheng, Vinod Koul, Neil Armstrong,
Christian Marangi, Andy Gross, Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
The USB3 port of the dragonboard drives the onboard TUSB8040A hub with
the AX88179 GbE controller and the PL2775 USB-SATA bridge behind it,
but the controller is disabled and nothing describes the devices, so
their reset lines float and their supplies are unmanaged.
Enable the DWC3 controller in host mode together with both of its
PHYs, and describe the onboard chain as device nodes under the
controller: the TUSB8040A hub pair (with the EEPROM-programmed
0451:8041/0451:8043 IDs this board reports), the AX88179 on the DN2
port and the PL2775 on the DN0 port, each with its PM8941 reset GPIO,
all powered from the always-on 3.3V carrier board rail, modeled as a
fixed regulator.
The SuperSpeed PHY is required even for the hub's USB 2.0 half to
respond: with the SS PHY left uninitialized the hub connects but never
answers enumeration at any speed.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
.../arm/boot/dts/qcom/qcom-apq8074-dragonboard.dts | 61 ++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/arch/arm/boot/dts/qcom/qcom-apq8074-dragonboard.dts b/arch/arm/boot/dts/qcom/qcom-apq8074-dragonboard.dts
index d3ae6c6a6f83..083fd8fa0aea 100644
--- a/arch/arm/boot/dts/qcom/qcom-apq8074-dragonboard.dts
+++ b/arch/arm/boot/dts/qcom/qcom-apq8074-dragonboard.dts
@@ -50,6 +50,15 @@ mpss_region: mpss@ac00000 {
};
};
+ pwr_c_3p3: regulator-pwr-c-3p3 {
+ compatible = "regulator-fixed";
+ regulator-name = "pwr_c_3p3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
vreg_boost: vreg-boost {
compatible = "regulator-fixed";
@@ -477,3 +486,55 @@ &usb_hs2_phy {
extcon = <&smbb>;
qcom,init-seq = /bits/ 8 <0x1 0x63>;
};
+
+&usb3 {
+ dr_mode = "host";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ status = "okay";
+
+ /* TI TUSB8040A four port hub */
+ hub_2_0: hub@1 {
+ compatible = "usb451,8043";
+ reg = <1>;
+ peer-hub = <&hub_3_0>;
+ reset-gpios = <&pm8941_gpios 6 GPIO_ACTIVE_LOW>;
+ vdd-supply = <&pwr_c_3p3>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ /* Prolific PL2775 USB-SATA bridge on the DN0 port */
+ device@1 {
+ compatible = "usb67b,2775";
+ reg = <1>;
+ reset-gpios = <&pm8941_gpios 10 GPIO_ACTIVE_LOW>;
+ vdd-supply = <&pwr_c_3p3>;
+ };
+
+ /* ASIX AX88179 USB-GbE controller on the DN2 port */
+ ethernet@3 {
+ compatible = "usbb95,1790";
+ reg = <3>;
+ reset-gpios = <&pm8941_gpios 9 GPIO_ACTIVE_LOW>;
+ vdd-supply = <&pwr_c_3p3>;
+ };
+ };
+
+ hub_3_0: hub@2 {
+ compatible = "usb451,8041";
+ reg = <2>;
+ peer-hub = <&hub_2_0>;
+ reset-gpios = <&pm8941_gpios 6 GPIO_ACTIVE_LOW>;
+ vdd-supply = <&pwr_c_3p3>;
+ };
+};
+
+&usb3_hs_phy {
+ status = "okay";
+};
+
+&usb3_ss_phy {
+ status = "okay";
+};
--
2.47.3
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 10/10] ARM: dts: qcom: apq8074-dragonboard: enable the USB3 host
2026-08-10 11:42 ` [PATCH 10/10] ARM: dts: qcom: apq8074-dragonboard: enable the USB3 host Dmitry Baryshkov
@ 2026-08-18 9:06 ` Konrad Dybcio
0 siblings, 0 replies; 19+ messages in thread
From: Konrad Dybcio @ 2026-08-18 9:06 UTC (permalink / raw)
To: Dmitry Baryshkov, Greg Kroah-Hartman, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Wesley Cheng, Vinod Koul,
Neil Armstrong, Christian Marangi, Andy Gross, Bjorn Andersson,
Konrad Dybcio
Cc: linux-arm-msm, linux-usb, devicetree, linux-kernel, linux-phy
On 8/10/26 1:42 PM, Dmitry Baryshkov wrote:
> The USB3 port of the dragonboard drives the onboard TUSB8040A hub with
> the AX88179 GbE controller and the PL2775 USB-SATA bridge behind it,
> but the controller is disabled and nothing describes the devices, so
> their reset lines float and their supplies are unmanaged.
>
> Enable the DWC3 controller in host mode together with both of its
> PHYs, and describe the onboard chain as device nodes under the
> controller: the TUSB8040A hub pair (with the EEPROM-programmed
> 0451:8041/0451:8043 IDs this board reports), the AX88179 on the DN2
> port and the PL2775 on the DN0 port, each with its PM8941 reset GPIO,
> all powered from the always-on 3.3V carrier board rail, modeled as a
> fixed regulator.
>
> The SuperSpeed PHY is required even for the hub's USB 2.0 half to
> respond: with the SS PHY left uninitialized the hub connects but never
> answers enumeration at any speed.
>
> Assisted-by: Claude:claude-fable-5
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 19+ messages in thread