From patchwork Wed Jul 19 17:40:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13319288 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 683DFC001B0 for ; Wed, 19 Jul 2023 17:40:48 +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:References:In-Reply-To: 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: List-Owner; bh=+MlpyBVo5cNP1H0l1DZSpXdVNkUr9GZa1YAx4pJPN4M=; b=ED3tGP6B4NSmjb RYOSei13VtCKWpvwuNdXJOQ72Hin+4qCvYZq/szyqhuDStP+JZCdImGQAp8mIHXTjrSGXpxp8PID5 TxOtioXejLp/VZk0m+vIPAY5pIM7yyBJgMKGSLiC4Q8YWaYPro1upc97bMMukGO0ZogKBxSrx2FFX sWeAeTdnQM0d/9FjygGl7brHo9uIGl+ey2yQVRwkcOz8aQFeFlrEP5358HWukPjBJNP7Wvd4N/6iO v9BC4Fpy0ob32r7eWm/7btvGea5WqLOVV9nRZVdroLXLs7UAAzg8XcXv0xa6c4XGLZTfh0SIu1nka 4Gngat3CM3D8boKW/HkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qMBAJ-008NdF-2A; Wed, 19 Jul 2023 17:40:43 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qMBA2-008NTT-2f; Wed, 19 Jul 2023 17:40:29 +0000 Received: from jupiter.universe (dyndsl-091-248-208-009.ewe-ip-backbone.de [91.248.208.9]) (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 madras.collabora.co.uk (Postfix) with ESMTPSA id 3F2EB6606FCE; Wed, 19 Jul 2023 18:40:19 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1689788419; bh=LlUh7Fn0cj04qJmOdkCXn8GhQI6+9wcTUh77kHYpm+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mId2p9mv1C0V9ofkmv80IFSeXy7Dod5LmGeSNOVTRWn+aumEFnzwSJt8PhFyRI5Ng n4UubNfF51wVwIkymVzRcwci+XM+ospEBgV+CfTkRv47yFYjDeoJgJpXaZRZji48xr UeMg9z2rH6u1IhneCdSsAKiMft2EJVrStEJv/EVgMnVNaQFNLGCV6bGjg/8ZL0PaZW hdMoXYOdJNi+12XtDlskQM5FlEkkrEskp1QiARs1t4ueXsHR+2cCp4LTAw/vQL/k9K k0agJfPQ2nTearEeZmqwTqy/fsqL2ldcANHxDcX2CSvwNbCPRpYFrUTI2K3Us6Fmwt DhZCKdG3yi1wg== Received: by jupiter.universe (Postfix, from userid 1000) id 20E6C480DA8; Wed, 19 Jul 2023 19:40:17 +0200 (CEST) From: Sebastian Reichel To: Heiko Stuebner , Greg Kroah-Hartman Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-rockchip@lists.infradead.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v1 1/2] dt-bindings: usb: rockchip,dwc3: Add RK3588 binding Date: Wed, 19 Jul 2023 19:40:14 +0200 Message-Id: <20230719174015.68153-2-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230719174015.68153-1-sebastian.reichel@collabora.com> References: <20230719174015.68153-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230719_104027_125187_E7BDB25B X-CRM114-Status: GOOD ( 12.69 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org RK3588 contains three DWC3 cores. Two of them are connected to dedicated USBDP PHY and can be used in dual-role. The third is connected to one of the shared combo PHYs used for PCIe/SATA/USB3 and can only be used in host mode. Since the binding is all about the PHY glueing and involved clocks, separate compatible values have been created for these two types. Signed-off-by: Sebastian Reichel --- .../bindings/usb/rockchip,rk3399-dwc3.yaml | 107 ++++++++++++++---- 1 file changed, 85 insertions(+), 22 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/rockchip,rk3399-dwc3.yaml b/Documentation/devicetree/bindings/usb/rockchip,rk3399-dwc3.yaml index 3159f9a6a0f7..0db4dc86e506 100644 --- a/Documentation/devicetree/bindings/usb/rockchip,rk3399-dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/rockchip,rk3399-dwc3.yaml @@ -11,7 +11,13 @@ maintainers: properties: compatible: - const: rockchip,rk3399-dwc3 + oneOf: + - items: + - enum: + - rockchip,rk3588-dwc3-otg + - rockchip,rk3588-dwc3-host + - const: rockchip,rk3399-dwc3 + - const: rockchip,rk3399-dwc3 '#address-cells': const: 2 @@ -22,35 +28,37 @@ properties: ranges: true clocks: - items: - - description: - Controller reference clock, must to be 24 MHz - - description: - Controller suspend clock, must to be 24 MHz or 32 KHz - - description: - Master/Core clock, must to be >= 62.5 MHz for SS - operation and >= 30MHz for HS operation - - description: - USB3 aclk peri - - description: - USB3 aclk - - description: - Controller grf clock + minItems: 3 + maxItems: 6 clock-names: items: - - const: ref_clk - - const: suspend_clk - - const: bus_clk - - const: aclk_usb3_rksoc_axi_perf - - const: aclk_usb3 - - const: grf_clk + oneOf: + - enum: + - ref + - ref_clk + - enum: + - suspend + - suspend_clk + - enum: + - bus + - bus_clk + - const: aclk_usb3_rksoc_axi_perf + - const: aclk_usb3 + - const: grf_clk + - const: utmi + - const: php + - const: pipe + minItems: 3 + maxItems: 6 resets: maxItems: 1 reset-names: - const: usb3-otg + enum: + - usb3-host + - usb3-otg patternProperties: '^usb@': @@ -68,6 +76,61 @@ required: - resets - reset-names +allOf: + - if: + properties: + compatible: + const: rockchip,rk3399-dwc3 + then: + properties: + clocks: + minItems: 6 + clock-names: + items: + - const: ref_clk + - const: suspend_clk + - const: bus_clk + - const: aclk_usb3_rksoc_axi_perf + - const: aclk_usb3 + - const: grf_clk + reset-names: + const: usb3-otg + - if: + properties: + compatible: + contains: + const: rockchip,rk3588-dwc3-otg + then: + properties: + clocks: + maxItems: 3 + clock-names: + items: + - const: ref + - const: suspend + - const: bus + reset-names: + const: usb3-otg + - if: + properties: + compatible: + contains: + const: rockchip,rk3588-dwc3-host + then: + properties: + clocks: + minItems: 6 + clock-names: + items: + - const: ref + - const: suspend + - const: bus + - const: utmi + - const: php + - const: pipe + reset-names: + const: usb3-host + examples: - | #include From patchwork Wed Jul 19 17:40:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 13319287 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 846F8C001B0 for ; Wed, 19 Jul 2023 17:40:44 +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:References:In-Reply-To: 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: List-Owner; bh=1wbtnfhX9uj/jOFGHJbRrxbG59ym+k4UE/wSqTJMJqU=; b=MKkzxjOJgfTDM8 yquEH6dDJFl/RWZie8LLa4+Tbr3TeLqdpydYFWfPQxBxLI6znw7Q/k2bCZUozvxP9UAYwARnBTXH4 FFc4DCuYxEahps1DlDyF4oDEio54RVKzUswrXPixHlbv6Dm8T4+kHLQnRhi+No+fFdpLj6GGLvWzM uEskW2GK9IwjmtZ3ZhJ90kd+PJekZ44fT0ERmxTMP89npbYscH0Aj0ozWlwgyRh7g5iCkZZhyU/Ds nXSfcJ1AHpQIejg9k4ehC97YiOB+H9cV9DjoJwY1MC88Nw3yNTj1U4JHvgw5MxVwi5JcWs3MzNC3k 3YLjsbGH7460+stLdDRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qMBA8-008NXp-06; Wed, 19 Jul 2023 17:40:32 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qMBA2-008NTU-2r; Wed, 19 Jul 2023 17:40:28 +0000 Received: from jupiter.universe (dyndsl-091-248-208-009.ewe-ip-backbone.de [91.248.208.9]) (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 madras.collabora.co.uk (Postfix) with ESMTPSA id 43F04660704A; Wed, 19 Jul 2023 18:40:19 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1689788419; bh=8jqadUrLP+GDojjmPoLDIihhsoBB6VsVeLoCMFXOZXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SgSUnYOSN8oYJy4ma5e1Y5O2G6mWv/uDrAjnCLeD0aUJ2wdovwZGOS1rPQm3xmeu1 +AORNA0+ywiUSTqtaoG5N1IizNlnMnbzMOH3H+qxikyYW6BIopmyu7JllkgPTiL4RY SCfs8Oj/Ud/YSfmDZFARbOT0keb+yQc0NcQ7c4lqB1H3MylBkvxoYKsWBnut1msXkF BpIqMzuoN1q7yv2WG9uSi7ea3c5iTJApmpbz143/34AMXCNkVe4MOGQbW1ECtGZRZl xmI6U0htlAIRRNBc65dtTmo3rVHIyE6dlgcNz7Srle8D8ifiQlmux/CS7V/kn+y5Xa MyxVsgijPTOQQ== Received: by jupiter.universe (Postfix, from userid 1000) id 22496480DA9; Wed, 19 Jul 2023 19:40:17 +0200 (CEST) From: Sebastian Reichel To: Heiko Stuebner , Greg Kroah-Hartman Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-rockchip@lists.infradead.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v1 2/2] arm64: dts: rockchip: rk3588s: Add USB3 host controller Date: Wed, 19 Jul 2023 19:40:15 +0200 Message-Id: <20230719174015.68153-3-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230719174015.68153-1-sebastian.reichel@collabora.com> References: <20230719174015.68153-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230719_104027_089772_83529D3F X-CRM114-Status: GOOD ( 11.65 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org RK3588 has three USB3 controllers. One of them is host-only and uses the naneng-combphy. The other two are dual-role and using a different PHY that is not yet supported upstream. Signed-off-by: Sebastian Reichel --- arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index b9b509257aaa..416581dd3bb5 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi @@ -443,6 +443,35 @@ usb_host1_ohci: usb@fc8c0000 { status = "disabled"; }; + usbhost3_0: usb@fcd00000 { + compatible = "rockchip,rk3588-dwc3-host", "rockchip,rk3399-dwc3"; + clocks = <&cru REF_CLK_USB3OTG2>, <&cru SUSPEND_CLK_USB3OTG2>, + <&cru ACLK_USB3OTG2>, <&cru CLK_UTMI_OTG2>, + <&cru PCLK_PHP_ROOT>, <&cru CLK_PIPEPHY2_PIPE_U3_G>; + clock-names = "ref", "suspend", "bus", "utmi", "php", "pipe"; + ranges; + resets = <&cru SRST_A_USB3OTG2>; + reset-names = "usb3-host"; + #address-cells = <2>; + #size-cells = <2>; + status = "disabled"; + + usbhost_dwc3_0: usb@fcd00000 { + compatible = "snps,dwc3"; + reg = <0x0 0xfcd00000 0x0 0x400000>; + interrupts = ; + dr_mode = "host"; + phys = <&combphy2_psu PHY_TYPE_USB3>; + phy-names = "usb3-phy"; + phy_type = "utmi_wide"; + snps,dis_enblslpm_quirk; + snps,dis-u2-freeclk-exists-quirk; + snps,dis-del-phy-power-chg-quirk; + snps,dis-tx-ipgap-linecheck-quirk; + snps,dis_rxdet_inp3_quirk; + }; + }; + sys_grf: syscon@fd58c000 { compatible = "rockchip,rk3588-sys-grf", "syscon"; reg = <0x0 0xfd58c000 0x0 0x1000>;