From patchwork Thu Jun 20 01:45:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacobe Zang X-Patchwork-Id: 13704793 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 67601C27C53 for ; Thu, 20 Jun 2024 01:57:56 +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=ykdtNN2eSvV+gaTOhcd4ymFWl78qglOCJ5oqhAO9qoE=; b=rAdGdTk3DBVZdo 4muP+kAt6E7Ve64EkszRNrByTlJ2xpLHOnr82kwj1kbT7RzipPBrXiy5avXwAME9q23nwPCkbNye7 GJNs+FFEie5KnmHBf/mmhC3TrCt87LTotjA/348hev5DfXcs3XK22HEyflt44g/y++nJUp7oiFay0 6cHWegDlmVEFSknJTttRFTcTg4j5D7UStfoxYhOy7N2wCK9Am7fE3EXVhCU2LOgQaRQHKXFrLiT5u ae1qx1ajXssiKgU4Vf3Qdc3g8X3Q/QxhIZRgKUCLLSt+fUwBgZI+zSGtPt44hsdrRFE40igg3GBWh ip2S3GWAKM/T8+RamWhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sK73d-00000003ImL-1cap; Thu, 20 Jun 2024 01:57:49 +0000 Received: from mail-tyzapc01on20700.outbound.protection.outlook.com ([2a01:111:f403:2011::700] helo=APC01-TYZ-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sK73X-00000003Ik0-13EN; Thu, 20 Jun 2024 01:57:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mtyUvSH+KGXuGHxhUxbrgXTRVa+irRwQXuDxjccQvefeXEstIb2f/Jd87P6tEouqSOExuXUttJQumK1/IwPyjPYRuAhxncxxqDR7MlqZxoO3dUa23j/D+9F48K/d7u+Z0agQmLj9qCwtarkv2Ya94vqvuI4Dea51wE5LAc1DhFAY/NkV8TaAA1zAqjYKs+UJSfUusuVVSah7wZCJdbUB3ZzkhokUDzCHzchSKDova+vpCJlk8WMYrsCbDuarMUzaUojrSJG//yklvfE7TQcjirwfUD+CCYHtAqy0e7mcvHXGm/2GAykYPZea9DwQrbj5DK6Rrr/ilW8s7Fd4HAb49w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oZ0PjwTt+XVTAG30Lrlbaz2psNI9OBOx0/bFuNlSJpY=; b=hgdrRxxWHFkB1BnDF2bzt7DiGS45m1KC8bzXHkq3xXOxhaW+RxJDDJ0F2Cwv/fQYjZd7h2xrtY3GwKFrxBzu2wVtvW8VJefrJWj42MD5s1o8hJDNcwzrYwgV3/DsZrZeTPhRvw4KEnEhpKDljDW25p6uL0FxQJGlqtloNDWQoFdBHTYJSR/oe7u6f/qfGAvNe2qUWHj3f1tlmgx1Lh9xyB2udv0SLXzpM0wzQfJIQoLvvfX05cO/ZXmM9NXuenQ+44eoH9Cdlw6rARtQ+JlroNHnXtmHcpq2bj7pKSjjXH/gM/7XGkSHOmyDhfKbOKpOBOui98zEHoVB4fNH40Wq5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wesion.com; dmarc=pass action=none header.from=wesion.com; dkim=pass header.d=wesion.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wesion.com; Received: from TYZPR03MB7001.apcprd03.prod.outlook.com (2603:1096:400:26a::14) by SEYPR03MB8078.apcprd03.prod.outlook.com (2603:1096:101:16b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31; Thu, 20 Jun 2024 01:57:28 +0000 Received: from TYZPR03MB7001.apcprd03.prod.outlook.com ([fe80::78dd:5e68:1a9c:36c0]) by TYZPR03MB7001.apcprd03.prod.outlook.com ([fe80::78dd:5e68:1a9c:36c0%6]) with mapi id 15.20.7677.029; Thu, 20 Jun 2024 01:57:28 +0000 From: Jacobe Zang To: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de Cc: nick@khadas.com, efectn@protonmail.com, jagan@edgeble.ai, dsimic@manjaro.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jacobe Zang Subject: [PATCH v3 1/2] arm64: dts: rockchip: Add USB-C to Khadas Edge 2 Date: Thu, 20 Jun 2024 09:45:35 +0800 Message-Id: <20240620014536.4019524-2-jacobe.zang@wesion.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240620014536.4019524-1-jacobe.zang@wesion.com> References: <20240620014536.4019524-1-jacobe.zang@wesion.com> X-ClientProxiedBy: SI1PR02CA0052.apcprd02.prod.outlook.com (2603:1096:4:1f5::20) To TYZPR03MB7001.apcprd03.prod.outlook.com (2603:1096:400:26a::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR03MB7001:EE_|SEYPR03MB8078:EE_ X-MS-Office365-Filtering-Correlation-Id: 665cc770-1ec7-40df-7cff-08dc90cc56ba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|1800799021|366013|52116011|376011|7416011|38350700011; X-Microsoft-Antispam-Message-Info: OcgOSc/f05R5CYEtwCF9nqmRTL/LT+SmZBUCUnuXzrDTQFDY0f9ZvhgNtkkdckI4kad4LzI+bY066MXAiC/RqOezisgThGNbTdzzbDYZYkmhultwF0hA1eitBWLSQw0e4dWJJZa3OhaBn3s/02Ag3w9+CQGSRygrRbbiAF6WYPukEpYpCHE37RZMEZyNMZ1YGMMFLQdq2N+UWRcI4hphvXG9lkuikEEUtk6Q9PTrUvT39OdUbsWfZ/lJlk6zPLJPnY0L/8hfJ6fctaNuuaPdE/rSWTIikk9aGirem+0aIrPoKbycu7Wb++ntzJ29qrywse3KoNr+0OkAidGRr1H16J1htv80JEFiKIskalxXB22elGMCut6FQohcGzv1yoDw29+7oqfHq56J85/sGiPYqgra3esrjeR+uTgqQcdO/eUPY3v8ZPt/kwslstLffwnjLCvJ1UxFzuwnfdTQs0/JIj531gdBzteIDTKOg0BlOpeac227VjpgzK8gxbeZ9ZnkS+quUS4rnn11prY/q/jYPZcAbM/21bNln/4Lv4KghvZ1x7nn6ARLGv9PkAjgxslLzLAGZMJ9Lh/4YmPJJhHyy3wSpwZRB2aJw5uSVCcgyKgylnOvvz/bUxhMbOsTGcR6lez9nWW9cGMHsZCWuyA56WdnhedOoq8Dk0RcEP7uJ7EHyyA8t9pTBZK/qK7rjDyg9v/CL59mF0lOFbOSjw/6NUDHLn5OKROXjIpyBDqUpqduIHPp1h+Z1yY3U2fr/biVOw20hSOJ11By1VnmVg7YNL2LLjusanokH+2gMqcuhSn9DYwNbtP1mtnp44yUtym01nsLSz9yz6TnSidDoryicGhCIusrV02ZUl15CuSgmjBkO97Z/LKi3SF7ZRJCvt5yFXdP/qxuUPULYIYpzM9szBSmx/XWlz62jw0kEItJX7a6/NK+VDuhUR/nGfUVWUHPOpZXMOky3nQkr3ayBhtGyA/FFDPZRJmoEeSss2fRRaQmSAoT0sZq6TTOkr8flnWLWsXFVLiAVZFLyxoqUotr8GliCyrNtbvw7idJTBa7RHL7UzQSvq27ph2tJmIWns0YcpyClfbuE5aJ/eF3xTFBpVQnZvYfLIcoZ5MlpZ8QV4BW6d72feXKKO96JrMDhrctoA8uvNfdhoBsQHKwPKyJ6lIa7MqoDvBGGSlgqJTCcimKBysTytnzbdABAo4zsAkPQg2frNH+6C07A9JUn8/H6fKMnvJP8N9ycpH+NsnsBvismt4emxWawPSZDVH6/URcMWNPX0TRdUrs3VxhToBqYAwJ8n/kAGikpIMUBGkfOgmrm2rB0anFavdLwHy4kEq2l6a/sLZ1EkA49Wka5UIKMGA2NyVX9f6Jt1NZFKQpf+o= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR03MB7001.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230037)(1800799021)(366013)(52116011)(376011)(7416011)(38350700011);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LX5TRXiQ/R5VwDSAxyn/OtDfHGg71eL4dbMcGRSTrF7cZjUrm5+m87P4PY0/qUSxLGBCtYMdAfjw4ZGLGBf3EZ8aSCtc8g6SkPTML3k9E8JPZhMbPBmgZskD0AbKw8lIUPBd+xQwEK+RzaOKEkxtkrS3+8xlIlV1wxSvQKTD06XPuLhKMa1U4GiV6fSG56BOJoPJZAryhFAWK5y9QSzDxSuYg3+lL6++vRoW7yrk52XblkqxIinvjVarghupbahGxGyO9M2+VQlwpYah8WFS0ZU3zTxtlFU/LakDgrmzuctadxsEHL9Za4rkQgKH6d1bWQQRYKA9VQTkWCMhtHnU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lp2oZ9+z6GZWBnWs7RPMZC9QUoCvdLv5KPlhA1j6nE4YJIbqaCuClGbrbnZWViPcX8ompt11frvzUzjfnS86c+oynmg4T83KMKVeHsGBk6LPW1rXR5nNqvF88Wx0O53+8NJDtr8ny6kyRy1Xv4ux/9jKtpV8LxkIMsJBSuiOCJpIDgEOCne9WfmA/g3ga X-OriginatorOrg: wesion.com X-MS-Exchange-CrossTenant-Network-Message-Id: 665cc770-1ec7-40df-7cff-08dc90cc56ba X-MS-Exchange-CrossTenant-AuthSource: TYZPR03MB7001.apcprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2024 01:57:28.4058 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 2dc3bd76-7ac2-4780-a5b7-6c6cc6b5af9b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CJoCHa2kpA+rwMNhW0t7bBy8MZYJSDk2a+4zxYcaFdQFpOzVSYX66Ptt44tJgCj7CcqSlZ05qF1APuZp83ZknQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR03MB8078 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240619_185743_303329_5B50E827 X-CRM114-Status: GOOD ( 10.12 ) 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 Khadas Edge 2 has 2x Type-C port. One just supports PD and controlled by MCU. The other one supports PD, DP Alt mode and DRD. This commit adds support for DRD. Signed-off-by: Jacobe Zang --- .../dts/rockchip/rk3588s-khadas-edge2.dts | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts b/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts index dbddfc3bb4641..8c0bc675690dd 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts @@ -6,6 +6,7 @@ #include #include #include +#include #include "rk3588s.dtsi" / { @@ -112,6 +113,18 @@ vcc5v0_sys: vcc5v0-sys-regulator { regulator-max-microvolt = <5000000>; }; + vbus5v0_typec: vbus5v0-typec-regulator { + compatible = "regulator-fixed"; + regulator-name = "vbus5v0_typec"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>; + vin-supply = <&vcc5v0_sys>; + pinctrl-names = "default"; + pinctrl-0 = <&typec5v_pwren>; + }; + vcc_1v1_nldo_s3: vcc-1v1-nldo-s3-regulator { compatible = "regulator-fixed"; regulator-name = "vcc_1v1_nldo_s3"; @@ -224,6 +237,56 @@ regulator-state-mem { &i2c2 { status = "okay"; + usbc0: usb-typec@22 { + compatible = "fcs,fusb302"; + reg = <0x22>; + interrupt-parent = <&gpio1>; + interrupts = ; + pinctrl-names = "default"; + pinctrl-0 = <&usbc0_int>; + vbus-supply = <&vbus5v0_typec>; + status = "okay"; + + usb_con: connector { + compatible = "usb-c-connector"; + label = "USB-C"; + data-role = "dual"; + power-role = "dual"; + try-power-role = "source"; + op-sink-microwatt = <1000000>; + sink-pdos = ; + source-pdos = ; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + usbc0_orien_sw: endpoint { + remote-endpoint = <&usbdp_phy0_orientation_switch>; + }; + }; + + port@1 { + reg = <1>; + usbc0_role_sw: endpoint { + remote-endpoint = <&dwc3_0_role_switch>; + }; + }; + + port@2 { + reg = <2>; + dp_altmode_mux: endpoint { + remote-endpoint = <&usbdp_phy0_dp_altmode_mux>; + }; + }; + }; + }; + }; + hym8563: rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>; @@ -256,6 +319,16 @@ vcc5v0_host_en: vcc5v0-host-en { }; }; + usb-typec { + usbc0_int: usbc0-int { + rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>; + }; + + typec5v_pwren: typec5v-pwren { + rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + ir-receiver { ir_receiver_pin: ir-receiver-pin { rockchip,pins = <1 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>; @@ -681,6 +754,14 @@ &uart9 { status = "okay"; }; +&u2phy0 { + status = "okay"; +}; + +&u2phy0_otg { + status = "okay"; +}; + &u2phy2 { status = "okay"; }; @@ -707,6 +788,43 @@ &usb_host0_ohci { status = "okay"; }; +&usbdp_phy0 { + orientation-switch; + mode-switch; + sbu1-dc-gpios = <&gpio4 RK_PA0 GPIO_ACTIVE_HIGH>; + sbu2-dc-gpios = <&gpio4 RK_PA1 GPIO_ACTIVE_HIGH>; + status = "okay"; + + port { + #address-cells = <1>; + #size-cells = <0>; + + usbdp_phy0_orientation_switch: endpoint@0 { + reg = <0>; + remote-endpoint = <&usbc0_orien_sw>; + }; + + usbdp_phy0_dp_altmode_mux: endpoint@1 { + reg = <1>; + remote-endpoint = <&dp_altmode_mux>; + }; + }; +}; + +&usb_host0_xhci { + usb-role-switch; + status = "okay"; + + port { + #address-cells = <1>; + #size-cells = <0>; + dwc3_0_role_switch: endpoint@0 { + reg = <0>; + remote-endpoint = <&usbc0_role_sw>; + }; + }; +}; + &usb_host1_ehci { status = "okay"; };