From patchwork Wed Aug 21 10:26:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Juszkiewicz X-Patchwork-Id: 13771208 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 09B60C5321D for ; Wed, 21 Aug 2024 10:26:47 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9gsMIFtl4fHSHIeOmh34sn06XwtajpziR1kpzkDFoR4=; b=Mq1dS+OF4WrNWC pMhx+SNEWfq5VYI3oE+KxwVbfZI61cA6g1q8OETH9lI03Mqoln/oeTqHUe8mL806a40qcFEjQOYwM xbRyzqziQCgeqYFAt6eX2vvUpWtn/xVI0td0xxpm3yaEvBc9JhYAHz2cOeiG80LpGEZDV+GfI7M7g vCuPf4LvGaMI9lFOuuZ9O8A9TboJy8u9BrBm1Qy5w0Kt/6JEmGBmS02g2aoRtcP0BKhf8A3CTWrTZ 9n1ziPJhTaBO5H9LTPGLBjDJUGjlg9aJ8InnYY5UFV3xLjyo92w+iTLWDWPgLthEue/OsWH15hpQp G4ztsuKHkXrj3KfHJaRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgiY8-00000008PNk-0Oa3; Wed, 21 Aug 2024 10:26:44 +0000 Received: from muminek.juszkiewicz.com.pl ([213.251.184.221]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgiY2-00000008PJG-3RSH for linux-rockchip@lists.infradead.org; Wed, 21 Aug 2024 10:26:40 +0000 Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id 827962619CA; Wed, 21 Aug 2024 12:26:36 +0200 (CEST) X-Virus-Scanned: Debian amavis at juszkiewicz.com.pl Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavis, port 10024) with ESMTP id 8Y4TGHyEUdzB; Wed, 21 Aug 2024 12:26:34 +0200 (CEST) Received: from puchatek.local (79.186.29.241.ipv4.supernova.orange.pl [79.186.29.241]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id 9FCC1261A09; Wed, 21 Aug 2024 12:26:31 +0200 (CEST) From: Marcin Juszkiewicz Date: Wed, 21 Aug 2024 12:26:17 +0200 Subject: [PATCH v3 7/7] arm64: dts: rockchip: enable USB-C on NanoPC-T6 MIME-Version: 1.0 Message-Id: <20240821-friendlyelec-nanopc-t6-lts-v3-7-3ecfa996bbe0@linaro.org> References: <20240821-friendlyelec-nanopc-t6-lts-v3-0-3ecfa996bbe0@linaro.org> In-Reply-To: <20240821-friendlyelec-nanopc-t6-lts-v3-0-3ecfa996bbe0@linaro.org> To: Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, Marcin Juszkiewicz X-Mailer: b4 0.14.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_032639_053683_9D65733B X-CRM114-Status: UNSURE ( 8.95 ) X-CRM114-Notice: Please train this message. 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 Enable the USB-C port on FriendlyELEC NanoPC-T6. Works one way so far but still better than before. Signed-off-by: Marcin Juszkiewicz --- arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts | 71 +++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts index 8f1cf81f8f90..825387a256d9 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts @@ -135,6 +135,8 @@ vbus5v0_typec: vbus5v0-typec-regulator { gpio = <&gpio1 RK_PD2 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&typec5v_pwren>; + regulator-always-on; + regulator-boot-on; regulator-name = "vbus5v0_typec"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; @@ -396,6 +398,32 @@ connector { source-pdos = ; sink-pdos = ; op-sink-microwatt = <1000000>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + usbc0_hs: endpoint { + remote-endpoint = <&usb_host0_xhci_drd_sw>; + }; + }; + + port@1 { + reg = <1>; + usbc0_ss: endpoint { + remote-endpoint = <&usbdp_phy0_typec_ss>; + }; + }; + + port@2 { + reg = <2>; + usbc0_sbu: endpoint { + remote-endpoint = <&usbdp_phy0_typec_sbu>; + }; + }; + }; }; }; @@ -943,6 +971,14 @@ &uart2 { status = "okay"; }; +&u2phy0 { + status = "okay"; +}; + +&u2phy0_otg { + status = "okay"; +}; + &u2phy2_host { phy-supply = <&vdd_4g_3v3>; status = "okay"; @@ -960,6 +996,29 @@ &u2phy3 { status = "okay"; }; +&usbdp_phy0 { + mode-switch; + orientation-switch; + sbu1-dc-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>; + sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>; + status = "okay"; + + port { + #address-cells = <1>; + #size-cells = <0>; + + usbdp_phy0_typec_ss: endpoint@0 { + reg = <0>; + remote-endpoint = <&usbc0_ss>; + }; + + usbdp_phy0_typec_sbu: endpoint@1 { + reg = <1>; + remote-endpoint = <&usbc0_sbu>; + }; + }; +}; + &usb_host0_ehci { status = "okay"; }; @@ -968,6 +1027,18 @@ &usb_host0_ohci { status = "okay"; }; +&usb_host0_xhci { + dr_mode = "host"; + status = "okay"; + usb-role-switch; + + port { + usb_host0_xhci_drd_sw: endpoint { + remote-endpoint = <&usbc0_hs>; + }; + }; +}; + &usb_host1_ehci { status = "okay"; };