From patchwork Mon Apr 8 22:50:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13621638 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 866FBC67861 for ; Mon, 8 Apr 2024 22:51:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=D3DoxvddCqFmkbcIiJsvC5D+V2v9gWW9p2syFUN5s+o=; b=xfNb7gvHDP6Sda xzmE6Rt3vN8Jx9tIOCy5Kp7hS5Fd435RTrYZlmMylNQHEWDtOqf0SX4fKR94NtZckI1Sw67bJZLoI iWJVQFXlfs4qXuhwg2EojFYApJvB2NFuwJ7Vvz6ijS0KhkofnVDe+3ApvQDCXvTsAasLRWJgKGejL 3S8AMMQQSlyO8EHdMYqd5onqFBO4gGsOA9YpdhsRPDjhXhgF3Ydpm+jzwTFAbk8vbtJ1/yyxvTGFl 352CgllRVqJ4NmzMIPBmkPq5H59zqJ4mpaS842/4VaFVPklF6XulW74mn5tmLBRqY221M84dWRlnc F+h9sr2iEDD9i278wQaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rtxpd-0000000H44T-38Oc; Mon, 08 Apr 2024 22:51:17 +0000 Received: from madrid.collaboradmins.com ([2a00:1098:ed:100::25]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rtxpZ-0000000H415-32I8; Mon, 08 Apr 2024 22:51:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712616670; bh=dhsop9SQlPpsgm4YRI8kzGbaMb8E3L8hiOp2tMvdQfA=; h=From:To:Cc:Subject:Date:From; b=Toxv8jP5cpKntaUO0B6jcxi4bdmqYLovvAe7TVECbyUD6OVgPGmJ/o470IgiZ5E/S VbwjEC8zO5B87pyr4RnDFt/60e6D6cgiK2AHwmk5ADuDAfimUKZyMfVPgrxWJpUEIH cwBuRQMC32kCegpGd511/lve4qJ2RhM25iie0DBZlGBQ9BIjv1ZjZsociwuJDExc0A PCIhpVTFnimJCXk+yIkNUUTkOifAK/pVjXo9wc3oAU49WUZ14qiQxlJICmWZsYPV4I gWJvF6ycib4ypQoIPfdA1QxulVX3CcfgWKu4fo9DbBJHO5K3EsSnmKCUNvIS6lx13u R2VpbtqCN9eUw== Received: from jupiter.universe (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 9739037809CE; Mon, 8 Apr 2024 22:51:10 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 3A1DE4800CD; Tue, 9 Apr 2024 00:51:10 +0200 (CEST) From: Sebastian Reichel To: Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Wang , Kever Yang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v5 00/10] RK3588 USBDP support Date: Tue, 9 Apr 2024 00:50:27 +0200 Message-ID: <20240408225109.128953-1-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240408_155113_920210_835780EC X-CRM114-Status: GOOD ( 17.96 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org 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