From patchwork Mon Jun 24 08:32: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: 13709170 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 29758C2BD09 for ; Mon, 24 Jun 2024 08:33:36 +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=U5kSB8WPOXeS7moac2XVCxaMOAJA2QWULGa3yPT6cJs=; b=l4mRUfBqIIeyYn giXze2l7534qVXKYMWiYGOWVqkVSpmWXwhLX7bxVM4Aqh6jBHlwThms3YdDQce/uUpctni6SKsZzv pbARjLnBNvpuPM7vLRBof1UG5SQj2lAkwCa6nmYekTLHjBh/VWqHhIQtv1M2FfkglKIPFD9udhDaK iFreJtGEQDUs6Rv4k8mPt179AVCvWBbrM2dLMIfPqWjRFh6pZr4G9xMZNVsFAXDXINHSDpwZRBk0K V+Klw2vU0h4FuY3Ji7f5XMZEFq7dXj+2GOmYr87Tn/qOrFh06Xaxl9p0Pni+MD1yn8IUkygftUWkE wHsMk7V3HwSY20Mf5OLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLf8l-0000000G4Jy-2ihp; Mon, 24 Jun 2024 08:33:31 +0000 Received: from mail-psaapc01on20702.outbound.protection.outlook.com ([2a01:111:f400:feae::702] helo=APC01-PSA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLf8f-0000000G4H8-208j; Mon, 24 Jun 2024 08:33:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e4KfHUHKo5Jy0oZpHuAYnx+E8BsbH+pvWTXjAeKBR5puFE1ratnlsXjkuQtBIxIbTKWHvIIoKuHNJq8ObD75VqA4Qejq4Ga8VwUvSdMulfT06Pveesi3S5D74LfLk4A+Z+IKq54GVS+sueQAQWkL6OSkH2XdBhXU/jAepCDpY8WhaXCDWDPY30Q6kuai0/O51L5NzBE6CD4XmNkLArO3VFSo16QohoAtzFVuU7/UoiH0ux6e8UOYKoRiAjy0EYciXTrkMQT22Hj+ljtnhkrX8iPsWHvYAwNYvQY6z6j52ceairP0idQ8VWu8CYHK1cc/ux0YHTJBFSbzjpbLD6RLCg== 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=8Cs+62NiCxt1/RmdZwmOWStd630SR26YZav6UdGrOgA=; b=ahO65py7XNryGmbf3JL5jCBqQ6DIJoDH/La1SAfqtGqmu0vOuQArKomGwnCyfb5i8Pg1mH5uwWpGEeKUujQgpxfMhC7YwJsqPIym3C/RjP372ssjSNXeIXHTLzF3JR1ALmd2YszvkHOT6b6VsDnzdSRh+YqcSQE4XJnSkBg2PeJzADGyaGrUTxUNM7Loj0tUd4Ha6Dif8Gylpjfk/UN8ES4TVkAqFvmd8uNNvsrEeBYpNM8GY8IR7bXwDlod34E6T+A2fEOF4CsWQrxQMC7dGYSnFTDm4+SOKaLpfoIfcfEW2TisddQiqwKh1vFaRWhOKRB/ElB/dNHj3WSKfHFKOw== 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 SG2PR03MB6456.apcprd03.prod.outlook.com (2603:1096:4:1c4::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.26; Mon, 24 Jun 2024 08:33:12 +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.7698.024; Mon, 24 Jun 2024 08:33:12 +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 v4 1/2] arm64: dts: rockchip: Add USB-C to Khadas Edge 2 Date: Mon, 24 Jun 2024 16:32:35 +0800 Message-Id: <20240624083236.1401673-2-jacobe.zang@wesion.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240624083236.1401673-1-jacobe.zang@wesion.com> References: <20240624083236.1401673-1-jacobe.zang@wesion.com> X-ClientProxiedBy: SG2PR02CA0107.apcprd02.prod.outlook.com (2603:1096:4:92::23) To TYZPR03MB7001.apcprd03.prod.outlook.com (2603:1096:400:26a::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR03MB7001:EE_|SG2PR03MB6456:EE_ X-MS-Office365-Filtering-Correlation-Id: 70e15964-e44c-48ea-2cc2-08dc9428486f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|1800799021|366013|376011|7416011|52116011|38350700011; X-Microsoft-Antispam-Message-Info: pZ//jchlZIbuZ5ZW9k/s+YgdXhoWqCNE5L3Ut4i79uHz2oL6pG1Ccv6vKHzUse6fGOR1p1i74adAkfiQARwqRyZvh4K8b63FkMX8A5gEGup+uJ9g7u1ECIik/piSi7OajPfOxEzsIbVPhx31VFRj7F0VntWnqYlxO5JSh/8EgnrRsgkuDTdoNNKf+9Szuuau2kwKRSXd+HMrFINksIoHfoKqWL6Y33OK9W+tV9+FvBcn6XaubN/+RGS4vEBknohRsgBlv4ELDQZxBU0SrcQuVOk7LeWZTWqyQX2AyOU9FoXruO0k1RKWGqMR5h0NX13U2BwdKGQ3Edeqs7oDb5gYgK3G1V8aO9EUqdDEIdZ63MEIlgHUFP2Re+3xiXTSdmL10Xj9PFKehu2zinLW63CgSepek8eX4cSkSiQe1V7l8L7fmkmScfh5M2EELRTH1FvNu18md01NR+rlpR4oD7f7HPX0EfJn/uzBxVsiIyvOlPPJe9Aiw7Uy2xdU6y4p3tjUExiG2hyDaxdhj0IUu/H2vopbWbsXXVyTelf8sSjnO6zDKu1ripAL13Y6Q+mmhg8Pkp8BRJDFOtfNhG4hpWjB46kirCdePE1Yf+tkJxGqkdrUPpKXF54s0feE7P+wRAe7BKc/4icpg+pFf6gkwp74U5ca4KIhXi41xIWw63kfNs/hpkZ1Yl1m6UjIHkmXBCOib8bDXV9rlhBfj08Yh+Aiw5z1VUPHUZiUo9WFd/LrJ+1lwGfGbQUsrSo8D7YINdTQYqOfrl1dIqMqfHek1r7mRGmI9+ytDCoUpNOO7Rq4Z9NAbPxcmZqAWlr6r6p/X6O5fH/YE5BDG2Yf8Fu71WNbcBpoLhN5YAVSWet0RJuQZ+7Pnp2pzNW1ba6s2BaN5RdOQoclrGOaFnLOSoS2WUVOSMeklOcoo2bZIiKo8hk2pFD451vw6QQkpnUTdE3oe2ZonEjjQgFAafAH1JLB1uz7XhVfFSLCWph8KXlHq7+wdJxGsj/iUzwPQM7qbpabNH+VpX4HXzbaX5ZbZeyvtJh368pBytsz8/NA63LPU0MZV9UEKgUUxQgSPJHoEL0/fEzhj5+P+fdCQGgbJI8dslwLCO5oI4YaLyMxl46KM40HetFhBa5OVqqXmUA6eVWZ1MUyauoUjOretpx/i4fKJpS/udMDrZoCZcBoKLTi9cBFidhU/9SkzBG6Z0lSjmvFcI9w2Xtj+OVnE1W+xn6kGTGVTclI14uhKj4MhCUHUzHZ/thuEiZgIN1TGyWZDMSo294CI6iBNZUdK3fdSmHqEy+Z1Leg8PGpXTg5OUBrnsVu3vmLyZiPyS7H0hu6WHihw0xLXGDp2pGHlS957U1zQKKSfOy26DsyNu47te1XTQ85e+c= 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)(376011)(7416011)(52116011)(38350700011);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Rcp4b3VLF18W+YnttuEDovusfggCC8VSQ+Tcv3i6VtW8IOXhhZ27YbtF8M3LwSHJgsSxkJGFzcWgW5QNB4VGdlI8v9i196WYX/WVsMw5HztE/BEl+UHrLhm5H4j+cNYUvxhxDthpeIWhtOamSpBn8l7lp8JTC36IJXwQiuWyp16kvv0kqrM7tJIUaCENZ/9AqO3ZfZDetdxPuMImy6FwwNln/9BCRIH2NZpwcw8HxZEsKDOR5Y7ZTmbYi9tnQyLd06MM6w9LufiTapFeGTozmnothFs7LdCDA0TcL8OLu64jS5sOVNHR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5lzuwnCq+ICKgNkYZytZY9ubVesE40LM/spkZyRwAljmZe0PzzIZHiWwolpQhkq8ix/MftcvyttPvT4QOVeSkjqSyNlUnSTYCpNo3vCUcpKbLIRYmOEq0xZ8JVV/DjSjXwXldE8L3jaIqnMCqr6PdOKzg4VVnCtmOhsqJdFH7Iyei2cCwPOmluWibJJXe9Qs7SSOrxcU5ClBUK3pCxx6C2KtPayefefZiUO X-OriginatorOrg: wesion.com X-MS-Exchange-CrossTenant-Network-Message-Id: 70e15964-e44c-48ea-2cc2-08dc9428486f X-MS-Exchange-CrossTenant-AuthSource: TYZPR03MB7001.apcprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2024 08:33:11.5854 (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: gFQjGaAR+kxcuqN74GqzH20zrxYs/5GM6RGQauAfJkqEcjVTl0+BVyJAae8zEUcNrYSHqY5/qhsdssYEffRFjg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR03MB6456 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240624_013325_590223_1913CBEF X-CRM114-Status: GOOD ( 10.13 ) 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. Co-developed-by: Muhammed Efe Cetin Signed-off-by: Muhammed Efe Cetin 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"; };