mbox series

[v5,00/10] RK3588 USBDP support

Message ID 20240408225109.128953-1-sebastian.reichel@collabora.com
Headers show
Series RK3588 USBDP support | expand

Message

Sebastian Reichel April 8, 2024, 10:50 p.m. UTC
Hi,

This adds Rockchip RK3588 USBDP PHY support, which is used for two of the three
USB3 controllers in the RK3588 (the third one uses a different PHY, which is
already supported). The USBDP PHY offers USB3 dual-role and DisplayPort. The
driver and bindings being upstreamed contains the DP parts, but only USB3 has
been tested by me (upstream does not yet have a DRM DP bridge driver for this
platform).

What has been tested:
 - USB3 Type A ports on Rock 5A, Rock 5B, EVB1
 - USB Type C port on EVB1 in Host mode

I did not yet include a patch to enable the Type-C from the Rock 5B, since that
requires enabling proper support for the fusb302. Since the system is usually
supplied via USB-C and without any battery backup, this easily results in
system reset when the power-delivery negotiation happens. As this issue is
independent from the USBDP PHY, I skipped enabling that port on Rock 5B for
now.

You can find a branch with these patches here:

https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux/-/commits/rk3588-usbdp

Changes since PATCHv4:
 * https://lore.kernel.org/all/20240325141653.84910-1-sebastian.reichel@collabora.com/
 * update copyright
 * drop linux/clk-provider.h include
 * replace of.h with mod_devicetable.h
 * re-check necessity of other included headers
 * rk_udphy_setup, rk_udphy_usb3_phy_init: remove redundant init of ret variable
 * rk_udphy_parse_dt: directly return rk_udphy_reset_init()

Changes since PATCHv3:
 * https://lore.kernel.org/all/20240216170514.75200-1-sebastian.reichel@collabora.com/
 * Rebase to v6.9-rc1
 * Collect Reviewed-by and Tested-by from Heiko for patch 1 + 2

Changes since PATCHv2:
 * https://lore.kernel.org/all/20240213163609.44930-1-sebastian.reichel@collabora.com/
 * Drop patch 1+2 (GRF DT bindings got merged by Heiko Stübner)
 * USBDP PHY DT binding: more spelling fixes
 * USBDP PHY DT binding: add Reviewed-by from Conor Dooley
 * USBDP PHY DT binding: specify 3 as maximum value for rockchip,dp-lane-mux items
 * all patches: remove child nodes for usb3-port and dp-port and use PHY cell instead
 * USBDP PHY driver: drop some header includes
 * USBDP PHY driver: rework rk_udphy_grfreg_write to use FIELD_PREP_CONST
 * USBDP PHY driver: add newline after break; in switch cases
 * USBDP PHY driver: make some functions void

Changes since PATCHv1:
 * https://lore.kernel.org/all/20240209181831.104687-1-sebastian.reichel@collabora.com/
 * VO GRF DT binding: Collect Acked-by from Conor Dooley
 * USB3 syscon DT binding: Collect Acked-by from Conor Dooley
 * USBDP PHY DT binding: fix spelling
 * USBDP PHY DT binding: add maxItems: 1 to gpios
 * USBDP PHY driver: use rk_udphy_ prefix everywhere
 * USBDP PHY DT addition: fix nodenames and property order
 * USBDP PHY DT addition: fix position of the GRF nodes
 * add new patches fixing existing USB2 PHY nodenames/property order
Not changed:
 * rockchip,dp-lane-mux: Why "mux" and not "map"?
  - This is about muxing DP lanes vs USB3 lanes. I kept mux instead
    of map, since that's used downstream and there does not seem to
    be a good reason to diverge?

-- Sebastian

Sebastian Reichel (10):
  dt-bindings: phy: add rockchip usbdp combo phy document
  phy: rockchip: add usbdp combo phy driver
  arm64: defconfig: enable Rockchip Samsung USBDP PHY
  arm64: dts: rockchip: fix usb2phy nodename for rk3588
  arm64: dts: rockchip: reorder usb2phy properties for rk3588
  arm64: dts: rockchip: add USBDP phys on rk3588
  arm64: dts: rockchip: add USB3 DRD controllers on rk3588
  arm64: dts: rockchip: add USB3 to rk3588-evb1
  arm64: dts: rockchip: add upper USB3 port to rock-5a
  arm64: dts: rockchip: add lower USB3 port to rock-5b

 .../bindings/phy/phy-rockchip-usbdp.yaml      |  148 ++
 .../boot/dts/rockchip/rk3588-evb1-v10.dts     |  143 ++
 .../boot/dts/rockchip/rk3588-rock-5b.dts      |   17 +
 arch/arm64/boot/dts/rockchip/rk3588.dtsi      |   72 +
 .../boot/dts/rockchip/rk3588s-rock-5a.dts     |   18 +
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi     |  105 +-
 arch/arm64/configs/defconfig                  |    1 +
 drivers/phy/rockchip/Kconfig                  |   12 +
 drivers/phy/rockchip/Makefile                 |    1 +
 drivers/phy/rockchip/phy-rockchip-usbdp.c     | 1608 +++++++++++++++++
 10 files changed, 2115 insertions(+), 10 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/phy/phy-rockchip-usbdp.yaml
 create mode 100644 drivers/phy/rockchip/phy-rockchip-usbdp.c

Comments

Vinod Koul April 12, 2024, 11:36 a.m. UTC | #1
On Tue, 09 Apr 2024 00:50:27 +0200, Sebastian Reichel wrote:
> This adds Rockchip RK3588 USBDP PHY support, which is used for two of the three
> USB3 controllers in the RK3588 (the third one uses a different PHY, which is
> already supported). The USBDP PHY offers USB3 dual-role and DisplayPort. The
> driver and bindings being upstreamed contains the DP parts, but only USB3 has
> been tested by me (upstream does not yet have a DRM DP bridge driver for this
> platform).
> 
> [...]

Applied, thanks!

[01/10] dt-bindings: phy: add rockchip usbdp combo phy document
        commit: a75d8056e9fefa82ca2bd75a32febc44411cc5c0
[02/10] phy: rockchip: add usbdp combo phy driver
        commit: 2f70bbddeb457580cef3ceb574506083b9272188

Best regards,
Heiko Stübner April 12, 2024, 2:46 p.m. UTC | #2
On Tue, 9 Apr 2024 00:50:27 +0200, Sebastian Reichel wrote:
> This adds Rockchip RK3588 USBDP PHY support, which is used for two of the three
> USB3 controllers in the RK3588 (the third one uses a different PHY, which is
> already supported). The USBDP PHY offers USB3 dual-role and DisplayPort. The
> driver and bindings being upstreamed contains the DP parts, but only USB3 has
> been tested by me (upstream does not yet have a DRM DP bridge driver for this
> platform).
> 
> [...]

Applied, thanks!

[03/10] arm64: defconfig: enable Rockchip Samsung USBDP PHY
        commit: 7cdf7efefc02189cf9a228d4c5c4253d273e9b1a
[04/10] arm64: dts: rockchip: fix usb2phy nodename for rk3588
        commit: 4e07a95f7402de092cd71b2cb96c69f85c98f251
[05/10] arm64: dts: rockchip: reorder usb2phy properties for rk3588
        commit: abe68e0ca71dddce0e5419e35507cb464d61870d
[06/10] arm64: dts: rockchip: add USBDP phys on rk3588
        commit: e18e5e8188f2671abf63abe7db5f21555705130f
[07/10] arm64: dts: rockchip: add USB3 DRD controllers on rk3588
        commit: 33f393a2a990e16f56931ca708295f31d2b44415
[08/10] arm64: dts: rockchip: add USB3 to rk3588-evb1
        commit: b37146b5a555dd871cb0805446826ab2fc8d285a
[09/10] arm64: dts: rockchip: add upper USB3 port to rock-5a
        commit: af7ec140ddc1815bc462109792d95bcad05cfbc4
[10/10] arm64: dts: rockchip: add lower USB3 port to rock-5b
        commit: 494532921aacb496529d544fedfdb3a7b43dfef0

I've rearranged some things in the evb1 patch:
- vbus* before vcc*
- some newlines between properties and subnodes around
  the endpoints

Best regards,
Sebastian Reichel April 12, 2024, 3:28 p.m. UTC | #3
Hello Heiko,

On Fri, Apr 12, 2024 at 04:46:43PM +0200, Heiko Stuebner wrote:
> On Tue, 9 Apr 2024 00:50:27 +0200, Sebastian Reichel wrote:
> > This adds Rockchip RK3588 USBDP PHY support, which is used for two of the three
> > USB3 controllers in the RK3588 (the third one uses a different PHY, which is
> > already supported). The USBDP PHY offers USB3 dual-role and DisplayPort. The
> > driver and bindings being upstreamed contains the DP parts, but only USB3 has
> > been tested by me (upstream does not yet have a DRM DP bridge driver for this
> > platform).
> > 
> > [...]
> 
> Applied, thanks!
> 
> [...]
>
> I've rearranged some things in the evb1 patch:
> - vbus* before vcc*
> - some newlines between properties and subnodes around
>   the endpoints

Thanks, sorry for the extra work.

-- Sebastian