linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/8]  enable usb support on rk356x
@ 2022-02-28 13:56 Peter Geis
  2022-02-28 13:56 ` [PATCH v4 3/8] dt-bindings: usb: add rk3568 compatible to rockchip, dwc3 Peter Geis
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Peter Geis @ 2022-02-28 13:56 UTC (permalink / raw)
  Cc: linux-rockchip, heiko, michael.riesch, jbx6244, Peter Geis,
	Rob Herring, Krzysztof Kozlowski, Felipe Balbi, devicetree,
	linux-arm-kernel, linux-kernel, linux-usb

Good Morning,

This is my patch series that I have maintained out of tree until the
combophy driver landed.

Patch 1 fixes the grf dt binding from the combophy merge.
Patch 2 adds the dt bindings for the grf changes necessary.
Patch 3 adds the SoC specific binding.
Patch 4 adds support to the grf driver to set the rk3566 otg clock
source.
Patch 5 is a downstream patch ported forward to shut down the usb3 clock
when the controller is operating in usb2 mode.
Patch 6 adds the dwc3 nodes to the rk356x device tree includes.
Patch 7 enables the dwc3 nodes on the Quartz64 Model A.
Patch 8 enables the dwc3 nodes on the rk3568-evb.

Note, there are functional changes from previous versions.

Please review and apply.

Very Respectfully,
Peter Geis

Changelog:
v4:
- Add SoC specific binding, fall back to core.
 
v3:
- Drop the dwc-of-simple method in favor of using dwc core.
- Drop all quirks except snps,dis_u2_susphy_quirk, which is necessary to
  prevent device detection failures in some states.
- Drop the reset-names.

v2:
- Add a dt-bindings fix for grf.yaml
- Unify the reset names.
- Constrain the force usb2 clock dwc3 patch to only supported variants of
the ip.
- Change dwc3-of-simple to support of-match-data.
- Drop the PCLK-PIPE clk.
- Rename the usb nodes to be more friendly.
- Add the rk3568-evb enable patch.

Bin Yang (1):
  usb: dwc3: core: do not use 3.0 clock when operating in 2.0 mode

Michael Riesch (2):
  dt-bindings: usb: add rk3568 compatible to rockchip, dwc3
  arm64: dts: rockchip: add usb3 support to rk3568-evb1-v10

Peter Geis (5):
  dt-bindings: soc: grf: fix rk3568 usb definitions
  dt-bindings: soc: grf: add rk3566-pipe-grf compatible
  soc: rockchip: set dwc3 clock for rk3566
  arm64: dts: rockchip: add rk356x dwc3 usb3 nodes
  arm64: dts: rockchip: enable dwc3 on quartz64-a

 .../devicetree/bindings/soc/rockchip/grf.yaml |  5 +-
 .../bindings/usb/rockchip,dwc3.yaml           |  2 +
 .../boot/dts/rockchip/rk3566-quartz64-a.dts   | 37 +++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3566.dtsi      | 11 +++++
 .../boot/dts/rockchip/rk3568-evb1-v10.dts     | 46 +++++++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3568.dtsi      |  9 ++++
 arch/arm64/boot/dts/rockchip/rk356x.dtsi      | 35 +++++++++++++-
 drivers/soc/rockchip/grf.c                    | 17 +++++++
 drivers/usb/dwc3/core.c                       |  5 ++
 drivers/usb/dwc3/core.h                       |  1 +
 10 files changed, 165 insertions(+), 3 deletions(-)

-- 
2.25.1


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

* [PATCH v4 3/8] dt-bindings: usb: add rk3568 compatible to rockchip, dwc3
  2022-02-28 13:56 [PATCH v4 0/8] enable usb support on rk356x Peter Geis
@ 2022-02-28 13:56 ` Peter Geis
  2022-03-07 23:10   ` Rob Herring
  2022-02-28 13:56 ` [PATCH v4 5/8] usb: dwc3: core: do not use 3.0 clock when operating in 2.0 mode Peter Geis
  2022-03-01 14:30 ` [PATCH v4 0/8] enable usb support on rk356x Michael Riesch
  2 siblings, 1 reply; 5+ messages in thread
From: Peter Geis @ 2022-02-28 13:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Heiko Stuebner
  Cc: linux-rockchip, michael.riesch, jbx6244, linux-usb, devicetree,
	linux-arm-kernel, linux-kernel

From: Michael Riesch <michael.riesch@wolfvision.net>

Add the compatible for the Rockchip RK3568 variant.

Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
---
 Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml
index 04077f2d7faf..b3798d94d2fd 100644
--- a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml
@@ -30,6 +30,7 @@ select:
         enum:
           - rockchip,rk3328-dwc3
           - rockchip,rk3399-dwc3
+          - rockchip,rk3568-dwc3
   required:
     - compatible
 
@@ -39,6 +40,7 @@ properties:
       - enum:
           - rockchip,rk3328-dwc3
           - rockchip,rk3399-dwc3
+          - rockchip,rk3568-dwc3
       - const: snps,dwc3
 
   reg:
-- 
2.25.1


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

* [PATCH v4 5/8] usb: dwc3: core: do not use 3.0 clock when operating in 2.0 mode
  2022-02-28 13:56 [PATCH v4 0/8] enable usb support on rk356x Peter Geis
  2022-02-28 13:56 ` [PATCH v4 3/8] dt-bindings: usb: add rk3568 compatible to rockchip, dwc3 Peter Geis
@ 2022-02-28 13:56 ` Peter Geis
  2022-03-01 14:30 ` [PATCH v4 0/8] enable usb support on rk356x Michael Riesch
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Geis @ 2022-02-28 13:56 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman
  Cc: linux-rockchip, heiko, michael.riesch, jbx6244, Bin Yang,
	Peter Geis, linux-usb, linux-kernel

From: Bin Yang <yangbin@rock-chips.com>

In the 3.0 device core, if the core is programmed to operate in
2.0 only, then setting the GUCTL1.DEV_FORCE_20_CLK_FOR_30_CLK makes
the internal 2.0(utmi/ulpi) clock to be routed as the 3.0 (pipe)
clock. Enabling this feature allows the pipe3 clock to be not-running
when forcibly operating in 2.0 device mode.

Signed-off-by: Bin Yang <yangbin@rock-chips.com>
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
---
 drivers/usb/dwc3/core.c | 5 +++++
 drivers/usb/dwc3/core.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 18adddfba3da..416d83a055fe 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1167,6 +1167,11 @@ static int dwc3_core_init(struct dwc3 *dwc)
 		if (dwc->parkmode_disable_ss_quirk)
 			reg |= DWC3_GUCTL1_PARKMODE_DISABLE_SS;
 
+		if (DWC3_VER_IS_WITHIN(DWC3, 290A, ANY) &&
+		    (dwc->maximum_speed == USB_SPEED_HIGH ||
+		     dwc->maximum_speed == USB_SPEED_FULL))
+			reg |= DWC3_GUCTL1_DEV_FORCE_20_CLK_FOR_30_CLK;
+
 		dwc3_writel(dwc->regs, DWC3_GUCTL1, reg);
 	}
 
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index eb9c1efced05..ea3ca04406bb 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -259,6 +259,7 @@
 /* Global User Control 1 Register */
 #define DWC3_GUCTL1_DEV_DECOUPLE_L1L2_EVT	BIT(31)
 #define DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS	BIT(28)
+#define DWC3_GUCTL1_DEV_FORCE_20_CLK_FOR_30_CLK	BIT(26)
 #define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW		BIT(24)
 #define DWC3_GUCTL1_PARKMODE_DISABLE_SS		BIT(17)
 
-- 
2.25.1


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

* Re: [PATCH v4 0/8] enable usb support on rk356x
  2022-02-28 13:56 [PATCH v4 0/8] enable usb support on rk356x Peter Geis
  2022-02-28 13:56 ` [PATCH v4 3/8] dt-bindings: usb: add rk3568 compatible to rockchip, dwc3 Peter Geis
  2022-02-28 13:56 ` [PATCH v4 5/8] usb: dwc3: core: do not use 3.0 clock when operating in 2.0 mode Peter Geis
@ 2022-03-01 14:30 ` Michael Riesch
  2 siblings, 0 replies; 5+ messages in thread
From: Michael Riesch @ 2022-03-01 14:30 UTC (permalink / raw)
  To: Peter Geis
  Cc: linux-rockchip, heiko, jbx6244, Rob Herring, Krzysztof Kozlowski,
	Felipe Balbi, devicetree, linux-arm-kernel, linux-kernel,
	linux-usb

Hi Peter,

On 2/28/22 14:56, Peter Geis wrote:
> Good Morning,
> 
> This is my patch series that I have maintained out of tree until the
> combophy driver landed.
> 
> Patch 1 fixes the grf dt binding from the combophy merge.
> Patch 2 adds the dt bindings for the grf changes necessary.
> Patch 3 adds the SoC specific binding.
> Patch 4 adds support to the grf driver to set the rk3566 otg clock
> source.
> Patch 5 is a downstream patch ported forward to shut down the usb3 clock
> when the controller is operating in usb2 mode.
> Patch 6 adds the dwc3 nodes to the rk356x device tree includes.
> Patch 7 enables the dwc3 nodes on the Quartz64 Model A.
> Patch 8 enables the dwc3 nodes on the rk3568-evb.

As far as the RK3568 EVB1 is concerned:

Tested-by: Michael Riesch <michael.riesch@wolfvision.net>

for the v4 of this series.

Thanks and best regards,
Michael

> 
> Note, there are functional changes from previous versions.
> 
> Please review and apply.
> 
> Very Respectfully,
> Peter Geis
> 
> Changelog:
> v4:
> - Add SoC specific binding, fall back to core.
>  
> v3:
> - Drop the dwc-of-simple method in favor of using dwc core.
> - Drop all quirks except snps,dis_u2_susphy_quirk, which is necessary to
>   prevent device detection failures in some states.
> - Drop the reset-names.
> 
> v2:
> - Add a dt-bindings fix for grf.yaml
> - Unify the reset names.
> - Constrain the force usb2 clock dwc3 patch to only supported variants of
> the ip.
> - Change dwc3-of-simple to support of-match-data.
> - Drop the PCLK-PIPE clk.
> - Rename the usb nodes to be more friendly.
> - Add the rk3568-evb enable patch.
> 
> Bin Yang (1):
>   usb: dwc3: core: do not use 3.0 clock when operating in 2.0 mode
> 
> Michael Riesch (2):
>   dt-bindings: usb: add rk3568 compatible to rockchip, dwc3
>   arm64: dts: rockchip: add usb3 support to rk3568-evb1-v10
> 
> Peter Geis (5):
>   dt-bindings: soc: grf: fix rk3568 usb definitions
>   dt-bindings: soc: grf: add rk3566-pipe-grf compatible
>   soc: rockchip: set dwc3 clock for rk3566
>   arm64: dts: rockchip: add rk356x dwc3 usb3 nodes
>   arm64: dts: rockchip: enable dwc3 on quartz64-a
> 
>  .../devicetree/bindings/soc/rockchip/grf.yaml |  5 +-
>  .../bindings/usb/rockchip,dwc3.yaml           |  2 +
>  .../boot/dts/rockchip/rk3566-quartz64-a.dts   | 37 +++++++++++++++
>  arch/arm64/boot/dts/rockchip/rk3566.dtsi      | 11 +++++
>  .../boot/dts/rockchip/rk3568-evb1-v10.dts     | 46 +++++++++++++++++++
>  arch/arm64/boot/dts/rockchip/rk3568.dtsi      |  9 ++++
>  arch/arm64/boot/dts/rockchip/rk356x.dtsi      | 35 +++++++++++++-
>  drivers/soc/rockchip/grf.c                    | 17 +++++++
>  drivers/usb/dwc3/core.c                       |  5 ++
>  drivers/usb/dwc3/core.h                       |  1 +
>  10 files changed, 165 insertions(+), 3 deletions(-)
> 

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

* Re: [PATCH v4 3/8] dt-bindings: usb: add rk3568 compatible to rockchip, dwc3
  2022-02-28 13:56 ` [PATCH v4 3/8] dt-bindings: usb: add rk3568 compatible to rockchip, dwc3 Peter Geis
@ 2022-03-07 23:10   ` Rob Herring
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2022-03-07 23:10 UTC (permalink / raw)
  To: Peter Geis
  Cc: Heiko Stuebner, Rob Herring, linux-arm-kernel, linux-usb,
	michael.riesch, Krzysztof Kozlowski, linux-kernel, linux-rockchip,
	devicetree, jbx6244, Greg Kroah-Hartman

On Mon, 28 Feb 2022 08:56:54 -0500, Peter Geis wrote:
> From: Michael Riesch <michael.riesch@wolfvision.net>
> 
> Add the compatible for the Rockchip RK3568 variant.
> 
> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
> ---
>  Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

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

end of thread, other threads:[~2022-03-07 23:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-28 13:56 [PATCH v4 0/8] enable usb support on rk356x Peter Geis
2022-02-28 13:56 ` [PATCH v4 3/8] dt-bindings: usb: add rk3568 compatible to rockchip, dwc3 Peter Geis
2022-03-07 23:10   ` Rob Herring
2022-02-28 13:56 ` [PATCH v4 5/8] usb: dwc3: core: do not use 3.0 clock when operating in 2.0 mode Peter Geis
2022-03-01 14:30 ` [PATCH v4 0/8] enable usb support on rk356x Michael Riesch

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).