From patchwork Mon Jun 17 03:05:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacobe Zang X-Patchwork-Id: 13699917 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 905ABC27C77 for ; Mon, 17 Jun 2024 03:06:33 +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=bsTN9gfNIcCvAYj4pPUtKHMcxUA6QRt6UK4Ml4VLnjI=; b=18H/PY6xs6trat qquUTHoz+7PNuxw4Q85+/JQ43nVrdKUHt9M4Jw7CJ0Qsz/siZ+HqpEg4niy3OEYnxEufMcZZJd7ak THBGCfRxUc2kMJzt31Y/sGldMS4WsXltTFcZQl77Xym1yMaLLveVoMhwis5au4LaX5qyQi7f+CQ7J /Kw0fRsViO6JKl3ko3U4OAhD6ig9YkZasBFd1bls5kjTsiTBkU/xcw3vX/5NmfxqUEOjpw5oLE76H WGCiZ9NKnquB0wrLFzKzYVkRA3f2m6aDLR/yCY6dAD2BMv3oj4QwHT8ByaCDfVY+BnlboGAtp0d81 pSU62N4GjlNhxOopA8dA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJ2hS-00000008xMk-0XL9; Mon, 17 Jun 2024 03:06:30 +0000 Received: from mail-sgaapc01on20703.outbound.protection.outlook.com ([2a01:111:f400:feab::703] helo=APC01-SG2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJ2hO-00000008xKg-3KvO; Mon, 17 Jun 2024 03:06:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AhDrpHhjAu/fW8GCBAqAd06EhID3P99bxlaxYkXK1DlEx+qKv2WDMpsa5Cw0jHNE2D6CHM/emySuajgc18nrNKDA2Hg+CgDKUrkUnhXdRWe0SUyIBPJJQ+l0ICduwkEU/JkYP6QFD82nxPcAu/6/RqJDpjGz8FTGNGotfyTCR09xR8RbhusUjyAwx4OdYnRPX55d4L9CJ6JU07X8v9wuKNF5sifTM0ZzwWUv/xAeL5ulR3Pw5bLtO2pkSvq2T/vash86/Zsf1B/+6eCtnTN9ZUw2H4LhZBQFjFCnLRBtx4sAWJgfTyt2RDfEmcDA0sRMYdKqameVxOTmy10nImVKbw== 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=4yiCrwYIMLTop9ycb1PwgryiANIVb67Q//bAgDliMYU=; b=Wj1gT5KYsBTfsNg/ThkTv90TxtGxNMZCO753QLfw1aPf2dd0v7tzWF3B7QtGib67asnFggE0Hkp2aQMMz57IkWFyObh08gDmwz3cnAPvX+gWb7Ki+FY758p5QoahbtdEEXA8Cz59DWwiNOOA3Q0uuXl7VZOMDDzD4G5Ln69BKlb8QC/LrtPH6DoWxdUM5nijogF0WpXo7WNZXYCPPKKVeelTauxp1Uv/BLrEjFMijtiqzMrqc7M8TELGXRZ1oc4MFIy+jdzh2EatNaGMG0U6Or9QB6sFiy387xbm6fRnS7X32OUeNi7HntIFg931BKUUAPLPUqOa5+I/aYdBx8+gig== 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 KL1PR03MB8001.apcprd03.prod.outlook.com (2603:1096:820:fc::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Mon, 17 Jun 2024 03:06:20 +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; Mon, 17 Jun 2024 03:06:19 +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 v1 1/5] arm64: dts: rockchip: Add USB-C to Khadas Edge 2 Date: Mon, 17 Jun 2024 11:05:33 +0800 Message-Id: <20240617030537.3112356-2-jacobe.zang@wesion.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240617030537.3112356-1-jacobe.zang@wesion.com> References: <20240617030537.3112356-1-jacobe.zang@wesion.com> X-ClientProxiedBy: SG2PR02CA0038.apcprd02.prod.outlook.com (2603:1096:3:18::26) To TYZPR03MB7001.apcprd03.prod.outlook.com (2603:1096:400:26a::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR03MB7001:EE_|KL1PR03MB8001:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c2c6bf2-0793-4461-b5b5-08dc8e7a760d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|7416011|376011|52116011|1800799021|38350700011; X-Microsoft-Antispam-Message-Info: PfH1s6Lbd+EEufZYsXj7J3GaEVIRcpV5PeRYuYaOaRscJj52W0T+QiuDWdvUTTonQcMof1dIGfy4iyKGAbPnSBycZoxdm96BKeD0Rhvk2L8qqZq9touDGl/zS48L1U+fstkzy+UEsm+PNl/flIZ2+jWNfllo0aIbUl2p8x5gq5ULgeEChtHgmrQqGOpEQRKwud+4acLn4POui461XXtPxxBbs74APMPewedz8Go3Kbzo+7ZKrAh+utfqsU5VacI400myj4XqSb3c1OfyFkNKJiWcpkc9K/7z88LkPPmqITl3WkHdVl9nokdI4rJ6Xzj5+np91wMqwpPVN4BiSB/0TszaRk3EGjhAqaAjPqpOQefO17gjtdlhJbzcxxPRi3RWqEsVS6NEeaBwBWLyjVRWb4YTKREPVO8LBcK+T7S0FLWztoWS8W2DP2Nh67dVCtzFggHuUt6dSlP6uS8COXaPM+wLiXWCOdwiEA7jsjayfkqNzKCgu+cbmRrSr8whtWrkFxO7a1r1F9sBHRmYQGO2KKQUgVGSITeV+bUqjpX+UxtTO5S9VMN/3QbQ8TLXKrcfsWr0vesFYH3rzW9DFj/HZE159ZZhe+pIyXRPKZP5GJPjPrgaONmc7UA+c1l8+6QBpMIJkfSzZ8GRQBX4eUt9xgPWBw80ObafcvKpkjVEHwP2lPxYG5Xmik7+H7FXOnB4G8barqtQORoLS1MjVJXr1wnRrk+cgQDEh9TfSBfvuku8PAMoNafDK8HBJbGHulB8Ty2PG5uNdCkU95UolGhWELZx6lhoZIdeEuSCrcOt7uApyUN+FnRcpzgEQFf5+TIs0/dmKjvddnQ+NuRJwD7y+JBNUenph4SvQUq86M7uVFbHUwxZ7Se8pfCZME2kMH1w/m0RV07vr66xuNClHwCORaFYwl6F0OkfVovs36+85AAFS/Pc1KuXs/3uFAczgLwuXG2M3vU83jRcW1Si9HaCmNvwIQv+eRGQ/YfX3KoHCDDbMAoPsz4tRXIJ8/W2LAHhsVZe69NCXKnnRHjVj0jQJK3JyUMrGIddTWGEbOwhClIJUnAG4Em+Z+C2u1KLWpWLHoQEqMcADUOrc7Bc2EPicZb+rK7hUWkR/6AT+HX58T5Vw4NKGdVtHBW9S3eoFcgRvBs/fFIwbF2nfottmzlVoG99MfyEps+1/asEJ0AlfziNAfetYdel/dOYHpSgzTRf60757VBXmZGKxQt4PjZN0ApeEuh2Lctl/dMG6lkPIf3kV5DhOjPkQSZKXKSSIjTS2Yc64MD6WsORzeww1vZuuZDDjI/7Y3rMgdcOrtBc/BJZOM77YXnd/FUSP5eEfftub298XaDv1WNhT1fhf4qDef7qELnX8S/vox7Ib0gV5e0= 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)(366013)(7416011)(376011)(52116011)(1800799021)(38350700011);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /XlONDDOYrwFRtZSw+SVVc4ruvo4c+nTnbvJkfDU2yLbYp155OFzlr4XuoLSdS6jLnwVEr6zjj/E/Ia7vm6cJ/g++bE/1u/UOi0nzD8h+5tXu2E7Tdut/M24yh/0kM9cEvbRQde+BTyX3UVeiVRyKRb7Um8mBnge6TD/wMFJw/qPGW2okq+pD5hWUlq2SOPe8eZl7Ykc6K1rersG7HFq1YKivXxZ/xIiK/BguBAtSMDb9ymmY/128oLRuelz16xLeYHGS9jxAsze+JPGaSfwE87LVZ8Lxl6yBw74Ttku92+0l4d+AVMZlg22T/eRlMSG1q+VX3ls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hqm14pUXfTLS8S9ssIvtDff9iK3v1+O7kFmt2h0jUCRRzLrijiHnW2NtrZj4FMXJB43RvF1PrmhsgLOsItKzjnp3dE5YnhUaXfoDqW7pDHOhRO310v1wbuD5/r2sU8An2VpDIjbP2G11SrMh2mZHZl/f9oZiHLgu2LG3E/dyKXai9kIF42muEWArG/Y/5cQuueCQDfNB4mP5685JUA== X-OriginatorOrg: wesion.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c2c6bf2-0793-4461-b5b5-08dc8e7a760d X-MS-Exchange-CrossTenant-AuthSource: TYZPR03MB7001.apcprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 03:06:19.8615 (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: SGo6Fvijti6KTj4Y7um1s3vhHD0IOwrhlYBIYzEZD9a0JZjRaNji1M/2ZXLdOVJX5CCs8aNGCfrKLKO00a1U0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR03MB8001 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240616_200626_867839_B02229C1 X-CRM114-Status: UNSURE ( 9.98 ) 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 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..9c2678905d236 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"; };