linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Changes for the eUSB2 PHY on Milos
@ 2025-07-15  7:29 Luca Weiss
  2025-07-15  7:29 ` [PATCH v3 1/4] dt-bindings: usb: qcom,snps-dwc3: Add Milos compatible Luca Weiss
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Luca Weiss @ 2025-07-15  7:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Wesley Cheng, Vinod Koul, Kishon Vijay Abraham I,
	Abel Vesa
  Cc: ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-usb,
	devicetree, linux-kernel, linux-phy, Luca Weiss,
	Krzysztof Kozlowski, Konrad Dybcio, Neil Armstrong

Document the eUSB2 PHY on Milos and add some driver changes for it.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
Changes in v3:
- Make "extra register write" commit unconditional for all targets,
  write the register directly as per Konrad's suggestion
- Pick up tags
- Link to v2: https://lore.kernel.org/r/20250709-sm7635-eusb-phy-v2-0-4790eeee7ae0@fairphone.com

Changes in v2:
- Rebrand SM7635 to Milos as requested: https://lore.kernel.org/linux-arm-msm/aGMI1Zv6D+K+vWZL@hu-bjorande-lv.qualcomm.com/
- Clarify commit message for "Add missing write from init sequence"
- Pick up tags
- Link to v1: https://lore.kernel.org/r/20250625-sm7635-eusb-phy-v1-0-94d76e0667c1@fairphone.com

---
Luca Weiss (4):
      dt-bindings: usb: qcom,snps-dwc3: Add Milos compatible
      dt-bindings: phy: qcom,snps-eusb2: document the Milos Synopsys eUSB2 PHY
      phy: qcom: phy-qcom-snps-eusb2: Add missing write from init sequence
      phy: qcom: phy-qcom-snps-eusb2: Update init sequence per HPG 1.0.2

 Documentation/devicetree/bindings/phy/qcom,snps-eusb2-phy.yaml | 1 +
 Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml      | 3 +++
 drivers/phy/phy-snps-eusb2.c                                   | 5 ++++-
 3 files changed, 8 insertions(+), 1 deletion(-)
---
base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
change-id: 20250620-sm7635-eusb-phy-d3bab648cdf1

Best regards,
-- 
Luca Weiss <luca.weiss@fairphone.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 1/4] dt-bindings: usb: qcom,snps-dwc3: Add Milos compatible
  2025-07-15  7:29 [PATCH v3 0/4] Changes for the eUSB2 PHY on Milos Luca Weiss
@ 2025-07-15  7:29 ` Luca Weiss
  2025-07-15  7:29 ` [PATCH v3 2/4] dt-bindings: phy: qcom,snps-eusb2: document the Milos Synopsys eUSB2 PHY Luca Weiss
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Luca Weiss @ 2025-07-15  7:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Wesley Cheng, Vinod Koul, Kishon Vijay Abraham I,
	Abel Vesa
  Cc: ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-usb,
	devicetree, linux-kernel, linux-phy, Luca Weiss,
	Krzysztof Kozlowski

Document the Milos dwc3 compatible.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml
index 8dac5eba61b45bc2ea78b23ff38678f909e21317..dfd084ed90242f0e77cb2cde16023c3421c5dfab 100644
--- a/Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml
@@ -32,6 +32,7 @@ properties:
           - qcom,ipq8064-dwc3
           - qcom,ipq8074-dwc3
           - qcom,ipq9574-dwc3
+          - qcom,milos-dwc3
           - qcom,msm8953-dwc3
           - qcom,msm8994-dwc3
           - qcom,msm8996-dwc3
@@ -338,6 +339,7 @@ allOf:
         compatible:
           contains:
             enum:
+              - qcom,milos-dwc3
               - qcom,qcm2290-dwc3
               - qcom,qcs615-dwc3
               - qcom,sar2130p-dwc3
@@ -453,6 +455,7 @@ allOf:
         compatible:
           contains:
             enum:
+              - qcom,milos-dwc3
               - qcom,x1e80100-dwc3
     then:
       properties:

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 2/4] dt-bindings: phy: qcom,snps-eusb2: document the Milos Synopsys eUSB2 PHY
  2025-07-15  7:29 [PATCH v3 0/4] Changes for the eUSB2 PHY on Milos Luca Weiss
  2025-07-15  7:29 ` [PATCH v3 1/4] dt-bindings: usb: qcom,snps-dwc3: Add Milos compatible Luca Weiss
@ 2025-07-15  7:29 ` Luca Weiss
  2025-07-15  7:29 ` [PATCH v3 3/4] phy: qcom: phy-qcom-snps-eusb2: Add missing write from init sequence Luca Weiss
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Luca Weiss @ 2025-07-15  7:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Wesley Cheng, Vinod Koul, Kishon Vijay Abraham I,
	Abel Vesa
  Cc: ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-usb,
	devicetree, linux-kernel, linux-phy, Luca Weiss,
	Krzysztof Kozlowski

Document the Synopsys eUSB2 PHY on the Milos SoC by using the SM8550 as
fallback.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 Documentation/devicetree/bindings/phy/qcom,snps-eusb2-phy.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-phy.yaml
index 142b3c8839d62d91377061ade3a7c400eb970609..854f70af0a6c1ff93615fa8dc1031b4c1ecc2e71 100644
--- a/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-phy.yaml
@@ -17,6 +17,7 @@ properties:
     oneOf:
       - items:
           - enum:
+              - qcom,milos-snps-eusb2-phy
               - qcom,sar2130p-snps-eusb2-phy
               - qcom,sdx75-snps-eusb2-phy
               - qcom,sm8650-snps-eusb2-phy

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 3/4] phy: qcom: phy-qcom-snps-eusb2: Add missing write from init sequence
  2025-07-15  7:29 [PATCH v3 0/4] Changes for the eUSB2 PHY on Milos Luca Weiss
  2025-07-15  7:29 ` [PATCH v3 1/4] dt-bindings: usb: qcom,snps-dwc3: Add Milos compatible Luca Weiss
  2025-07-15  7:29 ` [PATCH v3 2/4] dt-bindings: phy: qcom,snps-eusb2: document the Milos Synopsys eUSB2 PHY Luca Weiss
@ 2025-07-15  7:29 ` Luca Weiss
  2025-07-15  7:29 ` [PATCH v3 4/4] phy: qcom: phy-qcom-snps-eusb2: Update init sequence per HPG 1.0.2 Luca Weiss
  2025-07-22 13:37 ` [PATCH v3 0/4] Changes for the eUSB2 PHY on Milos Vinod Koul
  4 siblings, 0 replies; 7+ messages in thread
From: Luca Weiss @ 2025-07-15  7:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Wesley Cheng, Vinod Koul, Kishon Vijay Abraham I,
	Abel Vesa
  Cc: ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-usb,
	devicetree, linux-kernel, linux-phy, Luca Weiss, Konrad Dybcio,
	Neil Armstrong

As per a commit from Qualcomm's downstream 6.1 kernel[0], the init
sequence is missing setting the CMN_CTRL_OVERRIDE_EN bit back to 0 at
the end, as per the 'latest' HPG revision (as of November 2023).

[0] https://git.codelinaro.org/clo/la/kernel/qcom/-/commit/b77774a89e3fda3246e09dd39e16e2ab43cd1329

Fixes: 80090810f5d3 ("phy: qcom: Add QCOM SNPS eUSB2 driver")
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 drivers/phy/phy-snps-eusb2.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c
index b73a1d7e57b32cfdfbe314ab938ec54746ed53be..e232b8b4d29100b8fee9e913e2124788af09f2aa 100644
--- a/drivers/phy/phy-snps-eusb2.c
+++ b/drivers/phy/phy-snps-eusb2.c
@@ -437,6 +437,9 @@ static int qcom_snps_eusb2_hsphy_init(struct phy *p)
 	snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_HS_PHY_CTRL2,
 				    USB2_SUSPEND_N_SEL, 0);
 
+	snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG0,
+				    CMN_CTRL_OVERRIDE_EN, 0);
+
 	return 0;
 }
 

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 4/4] phy: qcom: phy-qcom-snps-eusb2: Update init sequence per HPG 1.0.2
  2025-07-15  7:29 [PATCH v3 0/4] Changes for the eUSB2 PHY on Milos Luca Weiss
                   ` (2 preceding siblings ...)
  2025-07-15  7:29 ` [PATCH v3 3/4] phy: qcom: phy-qcom-snps-eusb2: Add missing write from init sequence Luca Weiss
@ 2025-07-15  7:29 ` Luca Weiss
  2025-07-15 17:34   ` Dmitry Baryshkov
  2025-07-22 13:37 ` [PATCH v3 0/4] Changes for the eUSB2 PHY on Milos Vinod Koul
  4 siblings, 1 reply; 7+ messages in thread
From: Luca Weiss @ 2025-07-15  7:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Wesley Cheng, Vinod Koul, Kishon Vijay Abraham I,
	Abel Vesa
  Cc: ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-usb,
	devicetree, linux-kernel, linux-phy, Luca Weiss

The eUSB2 HPG version 1.0.2 asks to clear bits [7:1] on all targets.
Implement that change in the driver to follow.

See also https://lore.kernel.org/linux-arm-msm/7d073433-f254-4d75-a68b-d184f900294a@oss.qualcomm.com/

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 drivers/phy/phy-snps-eusb2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c
index e232b8b4d29100b8fee9e913e2124788af09f2aa..90b3da79900467dccbbec226db1cc83297ce8834 100644
--- a/drivers/phy/phy-snps-eusb2.c
+++ b/drivers/phy/phy-snps-eusb2.c
@@ -392,7 +392,7 @@ static int qcom_snps_eusb2_hsphy_init(struct phy *p)
 
 	snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_1,
 				    PHY_CFG_PLL_CPBIAS_CNTRL_MASK,
-				    FIELD_PREP(PHY_CFG_PLL_CPBIAS_CNTRL_MASK, 0x1));
+				    FIELD_PREP(PHY_CFG_PLL_CPBIAS_CNTRL_MASK, 0x0));
 
 	snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_4,
 				    PHY_CFG_PLL_INT_CNTRL_MASK,

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 4/4] phy: qcom: phy-qcom-snps-eusb2: Update init sequence per HPG 1.0.2
  2025-07-15  7:29 ` [PATCH v3 4/4] phy: qcom: phy-qcom-snps-eusb2: Update init sequence per HPG 1.0.2 Luca Weiss
@ 2025-07-15 17:34   ` Dmitry Baryshkov
  0 siblings, 0 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2025-07-15 17:34 UTC (permalink / raw)
  To: Luca Weiss
  Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Wesley Cheng, Vinod Koul, Kishon Vijay Abraham I,
	Abel Vesa, ~postmarketos/upstreaming, phone-devel, linux-arm-msm,
	linux-usb, devicetree, linux-kernel, linux-phy

On Tue, Jul 15, 2025 at 09:29:37AM +0200, Luca Weiss wrote:
> The eUSB2 HPG version 1.0.2 asks to clear bits [7:1] on all targets.
> Implement that change in the driver to follow.
> 
> See also https://lore.kernel.org/linux-arm-msm/7d073433-f254-4d75-a68b-d184f900294a@oss.qualcomm.com/
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
>  drivers/phy/phy-snps-eusb2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 0/4] Changes for the eUSB2 PHY on Milos
  2025-07-15  7:29 [PATCH v3 0/4] Changes for the eUSB2 PHY on Milos Luca Weiss
                   ` (3 preceding siblings ...)
  2025-07-15  7:29 ` [PATCH v3 4/4] phy: qcom: phy-qcom-snps-eusb2: Update init sequence per HPG 1.0.2 Luca Weiss
@ 2025-07-22 13:37 ` Vinod Koul
  4 siblings, 0 replies; 7+ messages in thread
From: Vinod Koul @ 2025-07-22 13:37 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Wesley Cheng, Kishon Vijay Abraham I, Abel Vesa,
	Luca Weiss
  Cc: ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-usb,
	devicetree, linux-kernel, linux-phy, Krzysztof Kozlowski,
	Konrad Dybcio, Neil Armstrong


On Tue, 15 Jul 2025 09:29:33 +0200, Luca Weiss wrote:
> Document the eUSB2 PHY on Milos and add some driver changes for it.
> 
> 

Applied, thanks!

[1/4] dt-bindings: usb: qcom,snps-dwc3: Add Milos compatible
      commit: 9e891b0d21bc889898e726783f20bd81f5fd4056
[2/4] dt-bindings: phy: qcom,snps-eusb2: document the Milos Synopsys eUSB2 PHY
      commit: bb39f49a433312ba7558b7cc44cfd9131b46bce1
[3/4] phy: qcom: phy-qcom-snps-eusb2: Add missing write from init sequence
      commit: 7f5f703210109366c1e1b685086c9b0a4897ea54
[4/4] phy: qcom: phy-qcom-snps-eusb2: Update init sequence per HPG 1.0.2
      commit: 828c3e9dce25a9551e52fd076136f4d9936c0498

Best regards,
-- 
~Vinod



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-07-22 13:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15  7:29 [PATCH v3 0/4] Changes for the eUSB2 PHY on Milos Luca Weiss
2025-07-15  7:29 ` [PATCH v3 1/4] dt-bindings: usb: qcom,snps-dwc3: Add Milos compatible Luca Weiss
2025-07-15  7:29 ` [PATCH v3 2/4] dt-bindings: phy: qcom,snps-eusb2: document the Milos Synopsys eUSB2 PHY Luca Weiss
2025-07-15  7:29 ` [PATCH v3 3/4] phy: qcom: phy-qcom-snps-eusb2: Add missing write from init sequence Luca Weiss
2025-07-15  7:29 ` [PATCH v3 4/4] phy: qcom: phy-qcom-snps-eusb2: Update init sequence per HPG 1.0.2 Luca Weiss
2025-07-15 17:34   ` Dmitry Baryshkov
2025-07-22 13:37 ` [PATCH v3 0/4] Changes for the eUSB2 PHY on Milos Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).