* [PATCH v1 0/8] enable usb support on rk356x
@ 2022-02-25 14:54 Peter Geis
2022-02-25 14:54 ` [PATCH v1 1/8] dt-bindings: soc: grf: add rk3566-pipe-grf compatible Peter Geis
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Peter Geis @ 2022-02-25 14:54 UTC (permalink / raw)
Cc: Peter Geis, Rob Herring, Krzysztof Kozlowski, Heiko Stuebner,
Felipe Balbi, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel, linux-usb
Good Morning,
This is my patch series that I have maintained out of tree until the
combophy driver landed. Note, it is dependent on this series to function
(aside from the rk3566 dwc3-otg port, which will work currently).
This series is still dependent on Patch 4 of the combophy series, which
has yet to be accepted.
Patches 1 and 2 add the dt bindings for the grf changes necessary for
this series.
Patch 3 adds support to the grf driver to set the rk3566 otg clock
source.
Patch 4 is a downstream patch ported forward to shut down the usb3 clock
when the controller is operating in usb2 mode.
Patches 5 and 6 clean up the dwc3-of-simple driver and add the
compatible for the rk3568.
Patch 7 adds the dwc3 nodes to the rk356x device tree includes.
Patch 8 enables the dwc3 nodes on the Quartz64 Model A.
Please review and apply.
Very Respectfully,
Peter Geis
Bin Yang (1):
usb: dwc3: core: do not use 3.0 clock when operating in 2.0 mode
Peter Geis (7):
dt-bindings: soc: grf: add rk3566-pipe-grf compatible
dt-bindings: usb: dwc3: add description for rk3568
soc: rockchip: set dwc3 clock for rk3566
usb: dwc3: reorder dwc-of-simple compatibles
usb: dwc3: add rk3568 dwc3 support
arm64: dts: rockchip: add the dwc3 usb3 nodes to rk356x
arm64: dts: rockchip: enable the dwc3 nodes on quartz64-a
.../devicetree/bindings/soc/rockchip/grf.yaml | 1 +
.../bindings/usb/rockchip,dwc3.yaml | 7 ++-
.../boot/dts/rockchip/rk3566-quartz64-a.dts | 37 +++++++++++++++
arch/arm64/boot/dts/rockchip/rk3566.dtsi | 12 +++++
arch/arm64/boot/dts/rockchip/rk3568.dtsi | 9 ++++
arch/arm64/boot/dts/rockchip/rk356x.dtsi | 45 ++++++++++++++++++-
drivers/soc/rockchip/grf.c | 17 +++++++
drivers/usb/dwc3/core.c | 4 ++
drivers/usb/dwc3/core.h | 1 +
drivers/usb/dwc3/dwc3-of-simple.c | 10 +++--
10 files changed, 137 insertions(+), 6 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH v1 1/8] dt-bindings: soc: grf: add rk3566-pipe-grf compatible 2022-02-25 14:54 [PATCH v1 0/8] enable usb support on rk356x Peter Geis @ 2022-02-25 14:54 ` Peter Geis 2022-02-25 14:54 ` [PATCH v1 2/8] dt-bindings: usb: dwc3: add description for rk3568 Peter Geis ` (2 subsequent siblings) 3 siblings, 0 replies; 10+ messages in thread From: Peter Geis @ 2022-02-25 14:54 UTC (permalink / raw) To: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner Cc: Peter Geis, devicetree, linux-arm-kernel, linux-rockchip, linux-kernel The rk3566 requires special handling for the dwc3-otg clock in order for the port to function correctly. Add a binding for the rk3566-pipe-grf so we can handle setup with the grf driver. Signed-off-by: Peter Geis <pgwipeout@gmail.com> --- Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml index 5079e9d24af6..75a2b8bb25fb 100644 --- a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml +++ b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml @@ -15,6 +15,7 @@ properties: - items: - enum: - rockchip,rk3288-sgrf + - rockchip,rk3566-pipe-grf - rockchip,rk3568-pipe-grf - rockchip,rk3568-pipe-phy-grf - rockchip,rk3568-usb2phy-grf -- 2.25.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v1 2/8] dt-bindings: usb: dwc3: add description for rk3568 2022-02-25 14:54 [PATCH v1 0/8] enable usb support on rk356x Peter Geis 2022-02-25 14:54 ` [PATCH v1 1/8] dt-bindings: soc: grf: add rk3566-pipe-grf compatible Peter Geis @ 2022-02-25 14:54 ` Peter Geis 2022-02-25 16:07 ` Johan Jonker 2022-02-25 14:54 ` [PATCH v1 7/8] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes Peter Geis 2022-02-25 14:54 ` [PATCH v1 8/8] arm64: dts: rockchip: enable dwc3 on quartz64-a Peter Geis 3 siblings, 1 reply; 10+ messages in thread From: Peter Geis @ 2022-02-25 14:54 UTC (permalink / raw) To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Heiko Stuebner Cc: Peter Geis, linux-usb, devicetree, linux-arm-kernel, linux-rockchip, linux-kernel The rk3568 dwc3 controllers are backwards compatible with the rk3399. Add the device tree description for it. Signed-off-by: Peter Geis <pgwipeout@gmail.com> --- Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml index 04077f2d7faf..e3044e81cc72 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: @@ -75,7 +77,10 @@ properties: maxItems: 1 reset-names: - const: usb3-otg + items: + - enum: + - usb3-otg + - usb3-host unevaluatedProperties: false -- 2.25.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v1 2/8] dt-bindings: usb: dwc3: add description for rk3568 2022-02-25 14:54 ` [PATCH v1 2/8] dt-bindings: usb: dwc3: add description for rk3568 Peter Geis @ 2022-02-25 16:07 ` Johan Jonker 2022-02-25 18:04 ` Peter Geis 0 siblings, 1 reply; 10+ messages in thread From: Johan Jonker @ 2022-02-25 16:07 UTC (permalink / raw) To: Peter Geis, Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Heiko Stuebner Cc: linux-usb, devicetree, linux-arm-kernel, linux-rockchip, linux-kernel, Michael Riesch Hi Peter, Lots of USB series all of a sudden. Combine possible? On 2/25/22 15:54, Peter Geis wrote: > The rk3568 dwc3 controllers are backwards compatible with the rk3399. > Add the device tree description for it. > > Signed-off-by: Peter Geis <pgwipeout@gmail.com> > --- > Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml > index 04077f2d7faf..e3044e81cc72 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: > @@ -75,7 +77,10 @@ properties: > maxItems: 1 > he > reset-names: > - const: usb3-otg > + items: > + - enum: > + - usb3-otg > + - usb3-host The use of reset-names is "sort of" only related to the rk3399 legacy node. Still using this sub node DT to not to break older existing boot loaders. https://github.com/torvalds/linux/search?q=usb3-otg It's only mentioned as comment in dwc3-of-simple.c but not used: simple->resets = of_reset_control_array_get(np, false, true, true); core.c uses something similar. dwc->reset = devm_reset_control_array_get_optional_shared(dev); if (IS_ERR(dwc->reset)) return PTR_ERR(dwc->reset); Up to the maintainers, but I wouldn't add another variant/name for the same thing as it also optional(= not required) and no longer needed. Johan === Maybe drop PCLK_PIPE as well to reduce notifications. See example: https://lore.kernel.org/linux-rockchip/20220225131602.2283499-4-michael.riesch@wolfvision.net/T/#u > > unevaluatedProperties: false > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 2/8] dt-bindings: usb: dwc3: add description for rk3568 2022-02-25 16:07 ` Johan Jonker @ 2022-02-25 18:04 ` Peter Geis 0 siblings, 0 replies; 10+ messages in thread From: Peter Geis @ 2022-02-25 18:04 UTC (permalink / raw) To: Johan Jonker Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski, Heiko Stuebner, linux-usb, devicetree, arm-mail-list, open list:ARM/Rockchip SoC..., Linux Kernel Mailing List, Michael Riesch On Fri, Feb 25, 2022 at 11:07 AM Johan Jonker <jbx6244@gmail.com> wrote: > > Hi Peter, > > Lots of USB series all of a sudden. > Combine possible? > > On 2/25/22 15:54, Peter Geis wrote: > > The rk3568 dwc3 controllers are backwards compatible with the rk3399. > > Add the device tree description for it. > > > > Signed-off-by: Peter Geis <pgwipeout@gmail.com> > > --- > > Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml > > index 04077f2d7faf..e3044e81cc72 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: > > @@ -75,7 +77,10 @@ properties: > > maxItems: 1 > > > he > > reset-names: > > - const: usb3-otg > > + items: > > + - enum: > > + - usb3-otg > > + - usb3-host > > The use of reset-names is "sort of" only related to the rk3399 legacy > node. Still using this sub node DT to not to break older existing boot > loaders. > > https://github.com/torvalds/linux/search?q=usb3-otg > > It's only mentioned as comment in dwc3-of-simple.c but not used: > > simple->resets = of_reset_control_array_get(np, false, true, > true); > core.c uses something similar. > > dwc->reset = devm_reset_control_array_get_optional_shared(dev); > if (IS_ERR(dwc->reset)) > return PTR_ERR(dwc->reset); > > > Up to the maintainers, but I wouldn't add another variant/name for the > same thing as it also optional(= not required) and no longer needed. I left these named separately since they are different reset signals, but if it isn't an issue I don't mind having them both be usb3-otg. > > Johan > > === > > Maybe drop PCLK_PIPE as well to reduce notifications. I'll be conducting testing to determine if we need PCLK_PIPE here, and as long as it isn't working simply because it's enabled by someone else I'll drop it. Ideally, it would be nice to have a proper clock map for these chips, but currently that's not in the TRM. > > See example: > https://lore.kernel.org/linux-rockchip/20220225131602.2283499-4-michael.riesch@wolfvision.net/T/#u > > > > > unevaluatedProperties: false > > Thanks for the review! ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v1 7/8] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes 2022-02-25 14:54 [PATCH v1 0/8] enable usb support on rk356x Peter Geis 2022-02-25 14:54 ` [PATCH v1 1/8] dt-bindings: soc: grf: add rk3566-pipe-grf compatible Peter Geis 2022-02-25 14:54 ` [PATCH v1 2/8] dt-bindings: usb: dwc3: add description for rk3568 Peter Geis @ 2022-02-25 14:54 ` Peter Geis 2022-02-25 17:01 ` Michael Riesch 2022-02-25 14:54 ` [PATCH v1 8/8] arm64: dts: rockchip: enable dwc3 on quartz64-a Peter Geis 3 siblings, 1 reply; 10+ messages in thread From: Peter Geis @ 2022-02-25 14:54 UTC (permalink / raw) To: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner Cc: Peter Geis, devicetree, linux-arm-kernel, linux-rockchip, linux-kernel Add the dwc3 device nodes to the rk356x device trees. The rk3566 has one usb2 capable dwc3 otg controller and one usb3 capable dwc3 host controller. The rk3568 has one usb3 capable dwc3 otg controller and one usb3 capable dwc3 host controller. Signed-off-by: Peter Geis <pgwipeout@gmail.com> --- arch/arm64/boot/dts/rockchip/rk3566.dtsi | 12 +++++++ arch/arm64/boot/dts/rockchip/rk3568.dtsi | 9 +++++ arch/arm64/boot/dts/rockchip/rk356x.dtsi | 45 +++++++++++++++++++++++- 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3566.dtsi b/arch/arm64/boot/dts/rockchip/rk3566.dtsi index 3839eef5e4f7..8e8b52f58f44 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3566.dtsi @@ -6,6 +6,10 @@ / { compatible = "rockchip,rk3566"; }; +&pipegrf { + compatible = "rockchip,rk3566-pipe-grf", "syscon"; +}; + &power { power-domain@RK3568_PD_PIPE { reg = <RK3568_PD_PIPE>; @@ -18,3 +22,11 @@ power-domain@RK3568_PD_PIPE { #power-domain-cells = <0>; }; }; + +&usbdrd30 { + phys = <&usb2phy0_otg>; + phy-names = "usb2-phy"; + extcon = <&usb2phy0>; + maximum-speed = "high-speed"; + snps,dis_u2_susphy_quirk; +}; diff --git a/arch/arm64/boot/dts/rockchip/rk3568.dtsi b/arch/arm64/boot/dts/rockchip/rk3568.dtsi index 5b0f528d6818..77c044cbaaad 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi @@ -99,6 +99,10 @@ opp-1992000000 { }; }; +&pipegrf { + compatible = "rockchip,rk3568-pipe-grf", "syscon"; +}; + &power { power-domain@RK3568_PD_PIPE { reg = <RK3568_PD_PIPE>; @@ -114,3 +118,8 @@ power-domain@RK3568_PD_PIPE { #power-domain-cells = <0>; }; }; + +&usbdrd30 { + phys = <&usb2phy0_otg>, <&combphy0 PHY_TYPE_USB3>; + phy-names = "usb2-phy", "usb3-phy"; +}; diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi index 84d5d607e693..4fae5b3b326e 100644 --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi @@ -230,6 +230,50 @@ scmi_shmem: sram@0 { }; }; + usbdrd30: usbdrd@fcc00000 { + compatible = "rockchip,rk3568-dwc3", "snps,dwc3"; + reg = <0x0 0xfcc00000 0x0 0x400000>; + interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru CLK_USB3OTG0_REF>, <&cru CLK_USB3OTG0_SUSPEND>, + <&cru ACLK_USB3OTG0>, <&cru PCLK_PIPE>; + clock-names = "ref_clk", "suspend_clk", + "bus_clk", "grf_clk"; + dr_mode = "host"; + phy_type = "utmi_wide"; + power-domains = <&power RK3568_PD_PIPE>; + resets = <&cru SRST_USB3OTG0>; + reset-names = "usb3-otg"; + snps,dis_enblslpm_quirk; + snps,dis-u2-freeclk-exists-quirk; + snps,dis-del-phy-power-chg-quirk; + snps,dis-tx-ipgap-linecheck-quirk; + snps,xhci-trb-ent-quirk; + status = "disabled"; + }; + + usbhost30: usbhost@fd000000 { + compatible = "rockchip,rk3568-dwc3", "snps,dwc3"; + reg = <0x0 0xfd000000 0x0 0x400000>; + interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru CLK_USB3OTG1_REF>, <&cru CLK_USB3OTG1_SUSPEND>, + <&cru ACLK_USB3OTG1>, <&cru PCLK_PIPE>; + clock-names = "ref_clk", "suspend_clk", + "bus_clk", "grf_clk"; + dr_mode = "host"; + phys = <&usb2phy0_host>, <&combphy1 PHY_TYPE_USB3>; + phy-names = "usb2-phy", "usb3-phy"; + phy_type = "utmi_wide"; + power-domains = <&power RK3568_PD_PIPE>; + resets = <&cru SRST_USB3OTG1>; + reset-names = "usb3-host"; + snps,dis_enblslpm_quirk; + snps,dis-u2-freeclk-exists-quirk; + snps,dis_u2_susphy_quirk; + snps,dis-del-phy-power-chg-quirk; + snps,dis-tx-ipgap-linecheck-quirk; + status = "disabled"; + }; + gic: interrupt-controller@fd400000 { compatible = "arm,gic-v3"; reg = <0x0 0xfd400000 0 0x10000>, /* GICD */ @@ -297,7 +341,6 @@ pmu_io_domains: io-domains { }; pipegrf: syscon@fdc50000 { - compatible = "rockchip,rk3568-pipe-grf", "syscon"; reg = <0x0 0xfdc50000 0x0 0x1000>; }; -- 2.25.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v1 7/8] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes 2022-02-25 14:54 ` [PATCH v1 7/8] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes Peter Geis @ 2022-02-25 17:01 ` Michael Riesch 2022-02-25 17:59 ` Peter Geis 0 siblings, 1 reply; 10+ messages in thread From: Michael Riesch @ 2022-02-25 17:01 UTC (permalink / raw) To: Peter Geis, Rob Herring, Krzysztof Kozlowski, Heiko Stuebner Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel Hi Peter, (It should be noted that there was a slight mishap in communications between the two of us resulting in two series with the same goal. Now let's clean up the mess :-) Thanks for your series. Seeing that it contains more patches than mine it probably makes sense to use your series as basis. Please Cc: me in future iterations of this patch series and consider my comments below. On 2/25/22 15:54, Peter Geis wrote: > Add the dwc3 device nodes to the rk356x device trees. > The rk3566 has one usb2 capable dwc3 otg controller and one usb3 capable > dwc3 host controller. > The rk3568 has one usb3 capable dwc3 otg controller and one usb3 capable > dwc3 host controller. > > Signed-off-by: Peter Geis <pgwipeout@gmail.com> > --- > arch/arm64/boot/dts/rockchip/rk3566.dtsi | 12 +++++++ > arch/arm64/boot/dts/rockchip/rk3568.dtsi | 9 +++++ > arch/arm64/boot/dts/rockchip/rk356x.dtsi | 45 +++++++++++++++++++++++- > 3 files changed, 65 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/boot/dts/rockchip/rk3566.dtsi b/arch/arm64/boot/dts/rockchip/rk3566.dtsi > index 3839eef5e4f7..8e8b52f58f44 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3566.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk3566.dtsi > @@ -6,6 +6,10 @@ / { > compatible = "rockchip,rk3566"; > }; > > +&pipegrf { > + compatible = "rockchip,rk3566-pipe-grf", "syscon"; > +}; > + > &power { > power-domain@RK3568_PD_PIPE { > reg = <RK3568_PD_PIPE>; > @@ -18,3 +22,11 @@ power-domain@RK3568_PD_PIPE { > #power-domain-cells = <0>; > }; > }; > + > +&usbdrd30 { I would really love to have some alignment with the other USB controllers usb_host{0,1}_{e,o}hci here. I am aware that older SoCs and the SDK are using these names and it might be painful to have different versions to maintain at the moment, but can we please agree on usb_host0_xhci usb_host1_xhci or something like that? > + phys = <&usb2phy0_otg>; > + phy-names = "usb2-phy"; > + extcon = <&usb2phy0>; > + maximum-speed = "high-speed"; > + snps,dis_u2_susphy_quirk; > +}; > diff --git a/arch/arm64/boot/dts/rockchip/rk3568.dtsi b/arch/arm64/boot/dts/rockchip/rk3568.dtsi > index 5b0f528d6818..77c044cbaaad 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi > @@ -99,6 +99,10 @@ opp-1992000000 { > }; > }; > > +&pipegrf { > + compatible = "rockchip,rk3568-pipe-grf", "syscon"; > +}; > + > &power { > power-domain@RK3568_PD_PIPE { > reg = <RK3568_PD_PIPE>; > @@ -114,3 +118,8 @@ power-domain@RK3568_PD_PIPE { > #power-domain-cells = <0>; > }; > }; > + > +&usbdrd30 { > + phys = <&usb2phy0_otg>, <&combphy0 PHY_TYPE_USB3>; > + phy-names = "usb2-phy", "usb3-phy"; > +}; > diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi > index 84d5d607e693..4fae5b3b326e 100644 > --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi > @@ -230,6 +230,50 @@ scmi_shmem: sram@0 { > }; > }; > > + usbdrd30: usbdrd@fcc00000 { > + compatible = "rockchip,rk3568-dwc3", "snps,dwc3"; > + reg = <0x0 0xfcc00000 0x0 0x400000>; > + interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&cru CLK_USB3OTG0_REF>, <&cru CLK_USB3OTG0_SUSPEND>, > + <&cru ACLK_USB3OTG0>, <&cru PCLK_PIPE>; > + clock-names = "ref_clk", "suspend_clk", > + "bus_clk", "grf_clk"; Please consider Johan's comments on my first series. In my tests removing the PCLK_PIPE clock did not make any difference. > + dr_mode = "host"; Based on the description in the commit message above it should be "otg", right? Boards are free to overrule this, of course. > + phy_type = "utmi_wide"; > + power-domains = <&power RK3568_PD_PIPE>; > + resets = <&cru SRST_USB3OTG0>; > + reset-names = "usb3-otg"; > + snps,dis_enblslpm_quirk; > + snps,dis-u2-freeclk-exists-quirk; > + snps,dis-del-phy-power-chg-quirk; > + snps,dis-tx-ipgap-linecheck-quirk; > + snps,xhci-trb-ent-quirk; In my first version I had all those quirks as well, but are they actually necessary? I decided to remove them all to have a fresh start (also activating them did not seem to affect my test setup). > + status = "disabled"; > + }; > + > + usbhost30: usbhost@fd000000 { Please reconsider the this name as well. > + compatible = "rockchip,rk3568-dwc3", "snps,dwc3"; > + reg = <0x0 0xfd000000 0x0 0x400000>; > + interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&cru CLK_USB3OTG1_REF>, <&cru CLK_USB3OTG1_SUSPEND>, > + <&cru ACLK_USB3OTG1>, <&cru PCLK_PIPE>; > + clock-names = "ref_clk", "suspend_clk", > + "bus_clk", "grf_clk"; > + dr_mode = "host"; Here "host" clearly makes sense, as this controller is not capable of otg. > + phys = <&usb2phy0_host>, <&combphy1 PHY_TYPE_USB3>; > + phy-names = "usb2-phy", "usb3-phy"; > + phy_type = "utmi_wide"; > + power-domains = <&power RK3568_PD_PIPE>; > + resets = <&cru SRST_USB3OTG1>; > + reset-names = "usb3-host"; > + snps,dis_enblslpm_quirk; > + snps,dis-u2-freeclk-exists-quirk; > + snps,dis_u2_susphy_quirk; > + snps,dis-del-phy-power-chg-quirk; > + snps,dis-tx-ipgap-linecheck-quirk; What was said about quirks above holds here as well (although one quirk not documented in the bindings is missing here). Best regards, Michael > + status = "disabled"; > + }; > + > gic: interrupt-controller@fd400000 { > compatible = "arm,gic-v3"; > reg = <0x0 0xfd400000 0 0x10000>, /* GICD */ > @@ -297,7 +341,6 @@ pmu_io_domains: io-domains { > }; > > pipegrf: syscon@fdc50000 { > - compatible = "rockchip,rk3568-pipe-grf", "syscon"; > reg = <0x0 0xfdc50000 0x0 0x1000>; > }; > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 7/8] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes 2022-02-25 17:01 ` Michael Riesch @ 2022-02-25 17:59 ` Peter Geis 2022-02-25 18:25 ` Michael Riesch 0 siblings, 1 reply; 10+ messages in thread From: Peter Geis @ 2022-02-25 17:59 UTC (permalink / raw) To: Michael Riesch Cc: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner, devicetree, arm-mail-list, open list:ARM/Rockchip SoC..., Linux Kernel Mailing List On Fri, Feb 25, 2022 at 12:01 PM Michael Riesch <michael.riesch@wolfvision.net> wrote: > > Hi Peter, > > (It should be noted that there was a slight mishap in communications > between the two of us resulting in two series with the same goal. Now > let's clean up the mess :-) > > Thanks for your series. Seeing that it contains more patches than mine > it probably makes sense to use your series as basis. Please Cc: me in > future iterations of this patch series and consider my comments below. Will do. If you'd like I can also pull your enablement patch. > > On 2/25/22 15:54, Peter Geis wrote: > > Add the dwc3 device nodes to the rk356x device trees. > > The rk3566 has one usb2 capable dwc3 otg controller and one usb3 capable > > dwc3 host controller. > > The rk3568 has one usb3 capable dwc3 otg controller and one usb3 capable > > dwc3 host controller. > > > > Signed-off-by: Peter Geis <pgwipeout@gmail.com> > > --- > > arch/arm64/boot/dts/rockchip/rk3566.dtsi | 12 +++++++ > > arch/arm64/boot/dts/rockchip/rk3568.dtsi | 9 +++++ > > arch/arm64/boot/dts/rockchip/rk356x.dtsi | 45 +++++++++++++++++++++++- > > 3 files changed, 65 insertions(+), 1 deletion(-) > > > > diff --git a/arch/arm64/boot/dts/rockchip/rk3566.dtsi b/arch/arm64/boot/dts/rockchip/rk3566.dtsi > > index 3839eef5e4f7..8e8b52f58f44 100644 > > --- a/arch/arm64/boot/dts/rockchip/rk3566.dtsi > > +++ b/arch/arm64/boot/dts/rockchip/rk3566.dtsi > > @@ -6,6 +6,10 @@ / { > > compatible = "rockchip,rk3566"; > > }; > > > > +&pipegrf { > > + compatible = "rockchip,rk3566-pipe-grf", "syscon"; > > +}; > > + > > &power { > > power-domain@RK3568_PD_PIPE { > > reg = <RK3568_PD_PIPE>; > > @@ -18,3 +22,11 @@ power-domain@RK3568_PD_PIPE { > > #power-domain-cells = <0>; > > }; > > }; > > + > > +&usbdrd30 { > > I would really love to have some alignment with the other USB controllers > > usb_host{0,1}_{e,o}hci > > here. I am aware that older SoCs and the SDK are using these names and > it might be painful to have different versions to maintain at the > moment, but can we please agree on > > usb_host0_xhci > usb_host1_xhci > > or something like that? I agree, I like your naming better. > > > + phys = <&usb2phy0_otg>; > > + phy-names = "usb2-phy"; > > + extcon = <&usb2phy0>; > > + maximum-speed = "high-speed"; > > + snps,dis_u2_susphy_quirk; > > +}; > > diff --git a/arch/arm64/boot/dts/rockchip/rk3568.dtsi b/arch/arm64/boot/dts/rockchip/rk3568.dtsi > > index 5b0f528d6818..77c044cbaaad 100644 > > --- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi > > +++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi > > @@ -99,6 +99,10 @@ opp-1992000000 { > > }; > > }; > > > > +&pipegrf { > > + compatible = "rockchip,rk3568-pipe-grf", "syscon"; > > +}; > > + > > &power { > > power-domain@RK3568_PD_PIPE { > > reg = <RK3568_PD_PIPE>; > > @@ -114,3 +118,8 @@ power-domain@RK3568_PD_PIPE { > > #power-domain-cells = <0>; > > }; > > }; > > + > > +&usbdrd30 { > > + phys = <&usb2phy0_otg>, <&combphy0 PHY_TYPE_USB3>; > > + phy-names = "usb2-phy", "usb3-phy"; > > +}; > > diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi > > index 84d5d607e693..4fae5b3b326e 100644 > > --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi > > +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi > > @@ -230,6 +230,50 @@ scmi_shmem: sram@0 { > > }; > > }; > > > > + usbdrd30: usbdrd@fcc00000 { > > + compatible = "rockchip,rk3568-dwc3", "snps,dwc3"; > > + reg = <0x0 0xfcc00000 0x0 0x400000>; > > + interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>; > > + clocks = <&cru CLK_USB3OTG0_REF>, <&cru CLK_USB3OTG0_SUSPEND>, > > + <&cru ACLK_USB3OTG0>, <&cru PCLK_PIPE>; > > + clock-names = "ref_clk", "suspend_clk", > > + "bus_clk", "grf_clk"; > > Please consider Johan's comments on my first series. In my tests > removing the PCLK_PIPE clock did not make any difference. I'd like to test that this isn't being used, or isn't just working because it's enabled elsewhere. If both of those are false, then I'll be happy to drop this. > > > + dr_mode = "host"; > > Based on the description in the commit message above it should be "otg", > right? Boards are free to overrule this, of course. Currently the usb2phy does not support OTG mode correctly. There are patches in the works for this, but at the moment it's safer to default to host. > > > + phy_type = "utmi_wide"; > > + power-domains = <&power RK3568_PD_PIPE>; > > + resets = <&cru SRST_USB3OTG0>; > > + reset-names = "usb3-otg"; > > + snps,dis_enblslpm_quirk; > > + snps,dis-u2-freeclk-exists-quirk; > > + snps,dis-del-phy-power-chg-quirk; > > + snps,dis-tx-ipgap-linecheck-quirk; > > + snps,xhci-trb-ent-quirk; > > In my first version I had all those quirks as well, but are they > actually necessary? I decided to remove them all to have a fresh start > (also activating them did not seem to affect my test setup). I'm now curious about this, can someone weigh in on valid ways of testing each one of these in a way that is definite? > > > + status = "disabled"; > > + }; > > + > > + usbhost30: usbhost@fd000000 { > > Please reconsider the this name as well. > > > + compatible = "rockchip,rk3568-dwc3", "snps,dwc3"; > > + reg = <0x0 0xfd000000 0x0 0x400000>; > > + interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>; > > + clocks = <&cru CLK_USB3OTG1_REF>, <&cru CLK_USB3OTG1_SUSPEND>, > > + <&cru ACLK_USB3OTG1>, <&cru PCLK_PIPE>; > > + clock-names = "ref_clk", "suspend_clk", > > + "bus_clk", "grf_clk"; > > + dr_mode = "host"; > > Here "host" clearly makes sense, as this controller is not capable of otg. > > > + phys = <&usb2phy0_host>, <&combphy1 PHY_TYPE_USB3>; > > + phy-names = "usb2-phy", "usb3-phy"; > > + phy_type = "utmi_wide"; > > + power-domains = <&power RK3568_PD_PIPE>; > > + resets = <&cru SRST_USB3OTG1>; > > + reset-names = "usb3-host"; > > + snps,dis_enblslpm_quirk; > > + snps,dis-u2-freeclk-exists-quirk; > > + snps,dis_u2_susphy_quirk; > > + snps,dis-del-phy-power-chg-quirk; > > + snps,dis-tx-ipgap-linecheck-quirk; > > What was said about quirks above holds here as well (although one quirk > not documented in the bindings is missing here). Same thing here, I'd like absolute testing to determine that these are not necessary, since downstream (the oem) felt they were. > > Best regards, > Michael > > > + status = "disabled"; > > + }; > > + > > gic: interrupt-controller@fd400000 { > > compatible = "arm,gic-v3"; > > reg = <0x0 0xfd400000 0 0x10000>, /* GICD */ > > @@ -297,7 +341,6 @@ pmu_io_domains: io-domains { > > }; > > > > pipegrf: syscon@fdc50000 { > > - compatible = "rockchip,rk3568-pipe-grf", "syscon"; > > reg = <0x0 0xfdc50000 0x0 0x1000>; > > }; > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 7/8] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes 2022-02-25 17:59 ` Peter Geis @ 2022-02-25 18:25 ` Michael Riesch 0 siblings, 0 replies; 10+ messages in thread From: Michael Riesch @ 2022-02-25 18:25 UTC (permalink / raw) To: Peter Geis Cc: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner, devicetree, arm-mail-list, open list:ARM/Rockchip SoC..., Linux Kernel Mailing List Hi Peter, On 2/25/22 18:59, Peter Geis wrote: > On Fri, Feb 25, 2022 at 12:01 PM Michael Riesch > <michael.riesch@wolfvision.net> wrote: >> >> Hi Peter, >> >> (It should be noted that there was a slight mishap in communications >> between the two of us resulting in two series with the same goal. Now >> let's clean up the mess :-) >> >> Thanks for your series. Seeing that it contains more patches than mine >> it probably makes sense to use your series as basis. Please Cc: me in >> future iterations of this patch series and consider my comments below. > > Will do. > If you'd like I can also pull your enablement patch. That'd be great, thanks! I'll help testing of course :-) >> On 2/25/22 15:54, Peter Geis wrote: > [...] >>> + dr_mode = "host"; >> >> Based on the description in the commit message above it should be "otg", >> right? Boards are free to overrule this, of course. > > Currently the usb2phy does not support OTG mode correctly. > There are patches in the works for this, but at the moment it's safer > to default to host. Ah OK, makes sense! Best regards, Michael > >> >>> + phy_type = "utmi_wide"; >>> + power-domains = <&power RK3568_PD_PIPE>; >>> + resets = <&cru SRST_USB3OTG0>; >>> + reset-names = "usb3-otg"; >>> + snps,dis_enblslpm_quirk; >>> + snps,dis-u2-freeclk-exists-quirk; >>> + snps,dis-del-phy-power-chg-quirk; >>> + snps,dis-tx-ipgap-linecheck-quirk; >>> + snps,xhci-trb-ent-quirk; >> >> In my first version I had all those quirks as well, but are they >> actually necessary? I decided to remove them all to have a fresh start >> (also activating them did not seem to affect my test setup). > > I'm now curious about this, can someone weigh in on valid ways of > testing each one of these in a way that is definite? > >> >>> + status = "disabled"; >>> + }; >>> + >>> + usbhost30: usbhost@fd000000 { >> >> Please reconsider the this name as well. >> >>> + compatible = "rockchip,rk3568-dwc3", "snps,dwc3"; >>> + reg = <0x0 0xfd000000 0x0 0x400000>; >>> + interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>; >>> + clocks = <&cru CLK_USB3OTG1_REF>, <&cru CLK_USB3OTG1_SUSPEND>, >>> + <&cru ACLK_USB3OTG1>, <&cru PCLK_PIPE>; >>> + clock-names = "ref_clk", "suspend_clk", >>> + "bus_clk", "grf_clk"; >>> + dr_mode = "host"; >> >> Here "host" clearly makes sense, as this controller is not capable of otg. >> >>> + phys = <&usb2phy0_host>, <&combphy1 PHY_TYPE_USB3>; >>> + phy-names = "usb2-phy", "usb3-phy"; >>> + phy_type = "utmi_wide"; >>> + power-domains = <&power RK3568_PD_PIPE>; >>> + resets = <&cru SRST_USB3OTG1>; >>> + reset-names = "usb3-host"; >>> + snps,dis_enblslpm_quirk; >>> + snps,dis-u2-freeclk-exists-quirk; >>> + snps,dis_u2_susphy_quirk; >>> + snps,dis-del-phy-power-chg-quirk; >>> + snps,dis-tx-ipgap-linecheck-quirk; >> >> What was said about quirks above holds here as well (although one quirk >> not documented in the bindings is missing here). > > Same thing here, I'd like absolute testing to determine that these are > not necessary, since downstream (the oem) felt they were. > >> >> Best regards, >> Michael >> >>> + status = "disabled"; >>> + }; >>> + >>> gic: interrupt-controller@fd400000 { >>> compatible = "arm,gic-v3"; >>> reg = <0x0 0xfd400000 0 0x10000>, /* GICD */ >>> @@ -297,7 +341,6 @@ pmu_io_domains: io-domains { >>> }; >>> >>> pipegrf: syscon@fdc50000 { >>> - compatible = "rockchip,rk3568-pipe-grf", "syscon"; >>> reg = <0x0 0xfdc50000 0x0 0x1000>; >>> }; >>> ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v1 8/8] arm64: dts: rockchip: enable dwc3 on quartz64-a 2022-02-25 14:54 [PATCH v1 0/8] enable usb support on rk356x Peter Geis ` (2 preceding siblings ...) 2022-02-25 14:54 ` [PATCH v1 7/8] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes Peter Geis @ 2022-02-25 14:54 ` Peter Geis 3 siblings, 0 replies; 10+ messages in thread From: Peter Geis @ 2022-02-25 14:54 UTC (permalink / raw) To: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner Cc: Peter Geis, devicetree, linux-arm-kernel, linux-rockchip, linux-kernel The quartz64 model a has support for both the dwc3 otg port and the dwc3 host port. Add the otg power supply and dwc3 nodes to the device tree to enable support for these. Signed-off-by: Peter Geis <pgwipeout@gmail.com> --- .../boot/dts/rockchip/rk3566-quartz64-a.dts | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts b/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts index dd7f4b9b686b..a911fa1ef955 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts +++ b/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts @@ -151,6 +151,16 @@ vcc5v0_usb20_host: vcc5v0_usb20_host { vin-supply = <&vcc5v0_usb>; }; + vcc5v0_usb20_otg: vcc5v0_usb20_otg { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio4 RK_PB5 GPIO_ACTIVE_HIGH>; + regulator-name = "vcc5v0_usb20_otg"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&dcdc_boost>; + }; + vcc3v3_sd: vcc3v3_sd { compatible = "regulator-fixed"; enable-active-low; @@ -187,6 +197,10 @@ vcc_wl: vcc_wl { }; }; +&combphy1 { + status = "okay"; +}; + &cpu0 { cpu-supply = <&vdd_cpu>; }; @@ -672,6 +686,20 @@ &usb_host1_ohci { status = "okay"; }; +&usb2phy0 { + status = "okay"; +}; + +&usb2phy0_host { + phy-supply = <&vcc5v0_usb20_host>; + status = "okay"; +}; + +&usb2phy0_otg { + phy-supply = <&vcc5v0_usb20_otg>; + status = "okay"; +}; + &usb2phy1 { status = "okay"; }; @@ -685,3 +713,12 @@ &usb2phy1_otg { phy-supply = <&vcc5v0_usb20_host>; status = "okay"; }; + +&usbdrd30 { + status = "okay"; +}; + +/* usb3 controller is muxed with sata1 */ +&usbhost30 { + status = "okay"; +}; -- 2.25.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-02-25 18:26 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-02-25 14:54 [PATCH v1 0/8] enable usb support on rk356x Peter Geis 2022-02-25 14:54 ` [PATCH v1 1/8] dt-bindings: soc: grf: add rk3566-pipe-grf compatible Peter Geis 2022-02-25 14:54 ` [PATCH v1 2/8] dt-bindings: usb: dwc3: add description for rk3568 Peter Geis 2022-02-25 16:07 ` Johan Jonker 2022-02-25 18:04 ` Peter Geis 2022-02-25 14:54 ` [PATCH v1 7/8] arm64: dts: rockchip: add rk356x dwc3 usb3 nodes Peter Geis 2022-02-25 17:01 ` Michael Riesch 2022-02-25 17:59 ` Peter Geis 2022-02-25 18:25 ` Michael Riesch 2022-02-25 14:54 ` [PATCH v1 8/8] arm64: dts: rockchip: enable dwc3 on quartz64-a Peter Geis
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).