From: Peter Geis <hidden> Date: 2021-08-12 20:42:00
Good Afternoon,
This is my series to support the usb2 phy devices on the rk356x.
The rk356x phy has a single muxed interrupt and has moved the usb2phy
nodes out of the grf and into their own nodes.
The phy needs to tie back into the grf for register control, similar to
the rv1108.
By moving the phys into their own nodes, they now have full
#address_cells = 2 register addresses, but they still reside below the 32bit
mmio range.
This driver series only supports the host configuration for the rk356x.
I have have tested it on the following:
rk3566 - Pine64 Quartz64 Model A
rk3399 - Pine64 Rockpro64
Please provide feedback and comments as you see fit.
Changelog:
v2:
- correct the order of the usb2phy-grf dt-bindings patch, thanks Johan
- correct the conditional requirements of phy-rockchip-inno-usb2, thanks
Johan
- drop increase generic-ohci clocks patch, thanks Heiko
- correct rk356x.dtsi ordering
- fix a dtbs-check callout
Peter Geis (8):
dt-bindings: soc: rockchip: add rk3568-usb2phy-grf
dt-bindings: phy: phy-rockchip-inno-usb2: add rk3568 documentation
phy: phy-rockchip-inno-usb2: support #address_cells = 2
phy: phy-rockchip-inno-usb2: support standalone phy nodes
phy: phy-rockchip-inno-usb2: support muxed interrupts
phy: phy-rockchip-inno-usb2: add rk3568 support
arm64: dts: rockchip: add usb2 nodes to rk3568 device tree
arm64: dts: rockchip: add Quartz64-A usb2 support
.../bindings/phy/phy-rockchip-inno-usb2.yaml | 31 ++-
.../devicetree/bindings/soc/rockchip/grf.yaml | 1 +
.../boot/dts/rockchip/rk3566-quartz64-a.dts | 52 ++++
arch/arm64/boot/dts/rockchip/rk356x.dtsi | 98 +++++++
drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 259 ++++++++++++++----
5 files changed, 383 insertions(+), 58 deletions(-)
--
2.25.1
From: Peter Geis <hidden> Date: 2021-08-12 20:42:03
Add the documentation for the rk3568-usb2phy-grf node, which is separate
from the usb2phy node on this chip.
Signed-off-by: Peter Geis <redacted>
---
Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 1 +
1 file changed, 1 insertion(+)
From: Peter Geis <hidden> Date: 2021-08-12 20:42:08
The rk3568 usb2phy node is a standalone node with a single muxed
interrupt.
Add documentation for it to phy-rockchip-inno-usb2.
Signed-off-by: Peter Geis <redacted>
---
.../bindings/phy/phy-rockchip-inno-usb2.yaml | 31 ++++++++++++++++---
1 file changed, 27 insertions(+), 4 deletions(-)
@@ -50,6 +51,9 @@ properties:description:Phandle to the extcon device providing the cable state for the otg phy.+interrupts:+description:Muxed interrupt for both ports+rockchip,usbgrf:$ref:/schemas/types.yaml#/definitions/phandledescription:
From: Peter Geis <hidden> Date: 2021-08-12 20:42:28
Add the requisite nodes to the rk3568 device tree to enable the usb2
device controllers.
Includes the usb2phy nodes, usb2phy grf nodes, and usb2 controller
nodes.
Signed-off-by: Peter Geis <redacted>
---
arch/arm64/boot/dts/rockchip/rk356x.dtsi | 98 ++++++++++++++++++++++++
1 file changed, 98 insertions(+)
From: Peter Geis <hidden> Date: 2021-08-12 20:42:30
Add the nodes and regulators to enable usb2 support on the Quartz64
Model A.
Signed-off-by: Peter Geis <redacted>
---
.../boot/dts/rockchip/rk3566-quartz64-a.dts | 52 +++++++++++++++++++
1 file changed, 52 insertions(+)
@@ -75,6 +75,22 @@ vcc5v0_usb: vcc5v0_usb {vin-supply=<&vcc12v_dcin>;};+/* all four ports are controlled by one gpio+*thehostportsaresourcedfromvcc5v0_usb+*theotgportissourcedfromvcc5v0_midu+*/+vcc5v0_usb20_host:vcc5v0_usb20_host{+compatible="regulator-fixed";+regulator-name="vcc5v0_usb20_host";+enable-active-high;+gpio=<&gpio4RK_PB5GPIO_ACTIVE_HIGH>;+pinctrl-names="default";+pinctrl-0=<&vcc5v0_usb20_host_en>;+regulator-min-microvolt=<5000000>;+regulator-max-microvolt=<5000000>;+vin-supply=<&vcc5v0_usb>;+};+vcc3v3_sd:vcc3v3_sd{compatible="regulator-fixed";enable-active-low;
From: Johan Jonker <hidden> Date: 2021-08-17 16:52:22
Hi Peter,
Some comments. Have a look if it's useful.
On 8/12/21 10:41 PM, Peter Geis wrote:
quoted hunk
The rk3568 usb2phy node is a standalone node with a single muxed
interrupt.
Add documentation for it to phy-rockchip-inno-usb2.
Signed-off-by: Peter Geis <redacted>
---
.../bindings/phy/phy-rockchip-inno-usb2.yaml | 31 ++++++++++++++++---
1 file changed, 27 insertions(+), 4 deletions(-)
From: Rob Herring <robh@kernel.org> Date: 2021-08-17 21:31:57
On Thu, 12 Aug 2021 16:41:09 -0400, Peter Geis wrote:
Add the documentation for the rk3568-usb2phy-grf node, which is separate
from the usb2phy node on this chip.
Signed-off-by: Peter Geis <redacted>
---
Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 1 +
1 file changed, 1 insertion(+)
From: Rob Herring <robh@kernel.org> Date: 2021-08-17 21:44:05
On Tue, Aug 17, 2021 at 06:52:15PM +0200, Johan Jonker wrote:
Hi Peter,
Some comments. Have a look if it's useful.
On 8/12/21 10:41 PM, Peter Geis wrote:
quoted
The rk3568 usb2phy node is a standalone node with a single muxed
interrupt.
Add documentation for it to phy-rockchip-inno-usb2.
Signed-off-by: Peter Geis <redacted>
---
.../bindings/phy/phy-rockchip-inno-usb2.yaml | 31 ++++++++++++++++---
1 file changed, 27 insertions(+), 4 deletions(-)
@@ -50,6 +51,9 @@ properties:description:Phandle to the extcon device providing the cable state for the otg phy.
quoted
+ interrupts:+ description: Muxed interrupt for both ports+
This allows every Rockchip SoC dtsi to add an interrupt here.
You have only restricted the requirements.
The goal is to restrict things and filter bogus properties.
If it was done because it doesn't compile, maybe could you try/test/use
something like the rockchip-io-domain.yaml $defs format.
Don't use $defs unless there's more than 1 copy needed of something. If
it happens to bypass some checks, it's only a matter of time til I fix
that.
This may be better solved with another schema file rather than a long
if/then schema. It's a judgement call.
Would it make sense to name those usb2phy0_{host,otg}? This would clean
up the sorting in the dts files a bit. Otherwise, u2phy... and
usb2phy... would have to be separated by e.g. uart nodes.
From: Michael Riesch <hidden> Date: 2021-10-14 10:11:44
Hi Peter,
Good Afternoon,
This is my series to support the usb2 phy devices on the rk356x.
The rk356x phy has a single muxed interrupt and has moved the usb2phy
nodes out of the grf and into their own nodes.
The phy needs to tie back into the grf for register control, similar to
the rv1108.
By moving the phys into their own nodes, they now have full
#address_cells = 2 register addresses, but they still reside below the 32bit
mmio range.
This driver series only supports the host configuration for the rk356x.
I have have tested it on the following:
rk3566 - Pine64 Quartz64 Model A
rk3399 - Pine64 Rockpro64
On a RK3568 EVB1 with suitable additions to the board dts:
Tested-by: Michael Riesch <redacted>
Thanks for your efforts and best regards,
Michael
Please provide feedback and comments as you see fit.
Changelog:
v2:
- correct the order of the usb2phy-grf dt-bindings patch, thanks Johan
- correct the conditional requirements of phy-rockchip-inno-usb2, thanks
Johan
- drop increase generic-ohci clocks patch, thanks Heiko
- correct rk356x.dtsi ordering
- fix a dtbs-check callout
Peter Geis (8):
dt-bindings: soc: rockchip: add rk3568-usb2phy-grf
dt-bindings: phy: phy-rockchip-inno-usb2: add rk3568 documentation
phy: phy-rockchip-inno-usb2: support #address_cells = 2
phy: phy-rockchip-inno-usb2: support standalone phy nodes
phy: phy-rockchip-inno-usb2: support muxed interrupts
phy: phy-rockchip-inno-usb2: add rk3568 support
arm64: dts: rockchip: add usb2 nodes to rk3568 device tree
arm64: dts: rockchip: add Quartz64-A usb2 support
.../bindings/phy/phy-rockchip-inno-usb2.yaml | 31 ++-
.../devicetree/bindings/soc/rockchip/grf.yaml | 1 +
.../boot/dts/rockchip/rk3566-quartz64-a.dts | 52 ++++
arch/arm64/boot/dts/rockchip/rk356x.dtsi | 98 +++++++
drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 259 ++++++++++++++----
5 files changed, 383 insertions(+), 58 deletions(-)
--
2.25.1