From patchwork Tue Feb 13 16:32:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 200517 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp660298dyb; Tue, 13 Feb 2024 08:39:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhFIYMk6Vz3jcPT05BzmLmIiPjJ9izH4SkZQ9J8GE2BExuKW3+l1YsGuleirbKMlvvmByT X-Received: by 2002:a17:903:48c:b0:1d9:7e0f:c398 with SMTP id jj12-20020a170903048c00b001d97e0fc398mr41845plb.18.1707842365718; Tue, 13 Feb 2024 08:39:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707842365; cv=pass; d=google.com; s=arc-20160816; b=jynz2t7kRKPod4eZ6oLA5bRY1Axnz9FuEshWegKOVVwjCk4KV0X3uDNNVSt4G25oUG kqgH4F/mitaT92zOwJhu89XAIkgQBgWcQkwKrV3v2fuLklWMwkkyUs7Bjk/aiLq/DQRo x/GkndevoeNtqL5oKRVbIRPpzEb49ZIKtMzZpqKK9MWOKw5Jg9EtGWKDCSISsGdPbkA+ LOTzeQalSuHhHfVq9HIo330pR/k56Oqh0jyk9WtIr2iADRPNOgr5At0A4OrFALvLrMm6 49ZEZxxZfmooxN56IkqRnyjSunDoJmMj/fPUFQiGi45OzJGV8Jb6N/BXFzdj6FfzIpsC RZ7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=LRW9Tk8JZWrRkRGBiY1nUgdy5mpV7oovSv+mRV+jFOU=; fh=uTSK7KB3vESihPf5O7+ndhsHLmXK9or87CA1IZ77GVU=; b=Ix9TDr0o9KjSHl1pkTmMELNyHe7DZ65MsfRiMJ70euKKdOuzEnhbZYwZuYi1wwIwOD +g2uL2bP+z9kzLcvauqdhD7rEh3xjENbQMrcS8U8rv+lLLOjT+38pAebntp1nIb65S5g cgVwBoN6QrQqxpsdddRMGv3HTvBM3Peg5km6Ml3QDkMkwCP/KQmtE5WFdZlk2m35lwUY By1aQe7JTqbU7D6RPcCzzMNGog5Vdrmgd6BkIWeQGqRDjIkmvZsbyvhBhXlrdnTSB7iP hsUNFSxIrd+42FAklCq5+eIMBU6MFgSF2fuUocOtSgqExOCbAMQrO/nhJ4ijAp5TyK85 D5UQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=aN2LvDSc; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-63906-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63906-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=2; AJvYcCURbxwkMg4+dzEFqePwQ7dspPpxHQX2fBuIqhSsYnTloyfcTjzG95yKnS8JDpfFRvJa9pk3Y2yQZ9ivilif0G/4Wrvvsg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id f15-20020a170902ce8f00b001d9cfd20f7fsi2243679plg.473.2024.02.13.08.39.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 08:39:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63906-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=aN2LvDSc; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-63906-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63906-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7BD4B286580 for ; Tue, 13 Feb 2024 16:39:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDA8D60B8D; Tue, 13 Feb 2024 16:36:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="aN2LvDSc" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB6BE5FEEF; Tue, 13 Feb 2024 16:36:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707842179; cv=none; b=EO38PgWMf98si/CUD6STYJ5ytJk3DDTeFv02grUPQ6Pil8oFbxPmE/EJh74yqD9MtbdvOoIzFYnd72mH1d96OUNqzTnSXsgM8w4wiLesSG7OV6dtJPH0I837NTP6I9p/kGEZWmcCLGo8/5FJ2qE8zXb/d3/hUb2uLI5JNQiNJok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707842179; c=relaxed/simple; bh=+bnYk1BYj3u3N4iOBFsXjnHlC1pJe00wOp5nI388mvs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Aa7iL1dA2onFznFYTGDIabH8QV6ygDh9f+nJbZbvhtp4Es1x38r3Pn0mSsOxxY7eFfEbOPMCsAepq1SI/bnxKMllhQhFFf6VINiaiOHV5TabAJYpMN37RUY9rDTiI6yyYPQhm/OnkHEbCX+YA1mfVwNLBO24E5bkwpfEPnU9x3I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=aN2LvDSc; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707842172; bh=+bnYk1BYj3u3N4iOBFsXjnHlC1pJe00wOp5nI388mvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aN2LvDSc8S1MpsocnRPVWF07y5h0vIvW/cm4uXntq+vw8ZxXNHcUDJgzKdX5GPj1K Ae6tbqidJYcy0w0/Qqitdw11MBc2Scc2bqgu501UM9cVg5iLxUJJMC/KkAZQrO1Cgl dLc4yhnEP6jbknV7U742uyH4SSjnKBWo1BYnELrmnQXZrt50aYXPohySpSmShjHe6u pxsUvWrNnw/uTA8GpPdrzgm8X4rlKmUFIW4Kyy11pKwrxh94VTQz65XNcoRWDfJi5w nPIFX7Q/io3eAxqMuyT6wzRDeJJl+pqUCuQhDqATg84AJ0Nbr+iTiIzWUg+GwS8Gpp 1R5+W+qVgqsmg== Received: from jupiter.universe (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 152533782083; Tue, 13 Feb 2024 16:36:12 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id 0C2924800DD; Tue, 13 Feb 2024 17:36:11 +0100 (CET) From: Sebastian Reichel To: Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Wang , Kever Yang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v2 10/12] arm64: dts: rockchip: add USB3 to rk3588-evb1 Date: Tue, 13 Feb 2024 17:32:44 +0100 Message-ID: <20240213163609.44930-11-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240213163609.44930-1-sebastian.reichel@collabora.com> References: <20240213163609.44930-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790802516420404911 X-GMAIL-MSGID: 1790802516420404911 Add support for the board's USB3 connectors. It has 1x USB Type-A and 1x USB Type-C. Signed-off-by: Sebastian Reichel --- .../boot/dts/rockchip/rk3588-evb1-v10.dts | 151 ++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts b/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts index ac7c677b0fb9..6b7d54455ca1 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts @@ -9,6 +9,7 @@ #include #include #include +#include #include "rk3588.dtsi" / { @@ -224,6 +225,18 @@ vcc5v0_usb: vcc5v0-usb-regulator { regulator-max-microvolt = <5000000>; vin-supply = <&vcc5v0_usbdcin>; }; + + vbus5v0_typec: vbus5v0-typec { + compatible = "regulator-fixed"; + regulator-name = "vbus5v0_typec"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&gpio4 RK_PD0 GPIO_ACTIVE_HIGH>; + vin-supply = <&vcc5v0_usb>; + pinctrl-names = "default"; + pinctrl-0 = <&typec5v_pwren>; + }; }; &combphy0_ps { @@ -284,6 +297,56 @@ &gmac0_rgmii_clk &i2c2 { status = "okay"; + usbc0: usb-typec@22 { + compatible = "fcs,fusb302"; + reg = <0x22>; + interrupt-parent = <&gpio3>; + 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>; @@ -410,6 +473,16 @@ vcc5v0_host_en: vcc5v0-host-en { rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; }; }; + + usb-typec { + usbc0_int: usbc0-int { + rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>; + }; + + typec5v_pwren: typec5v-pwren { + rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; }; &pwm2 { @@ -1040,6 +1113,22 @@ &sata0 { status = "okay"; }; +&u2phy0 { + status = "okay"; +}; + +&u2phy0_otg { + status = "okay"; +}; + +&u2phy1 { + status = "okay"; +}; + +&u2phy1_otg { + status = "okay"; +}; + &u2phy2 { status = "okay"; }; @@ -1078,3 +1167,65 @@ &usb_host1_ehci { &usb_host1_ohci { status = "okay"; }; + +&usbdp_phy0 { + orientation-switch; + mode-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_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>; + }; + }; +}; + +&usbdp_phy0_u3 { + status = "okay"; +}; + +&usbdp_phy1 { + /* + * USBDP PHY1 is wired to a female USB3 Type-A connector. Additionally + * the differential pairs 2+3 and the aux channel are wired to a RTD2166, + * which converts the DP signal into VGA. This is exposed on the + * board via a female VGA connector. + */ + rockchip,dp-lane-mux = <2 3>; + status = "okay"; +}; + +&usbdp_phy1_u3 { + status = "okay"; +}; + +&usb_host0_xhci { + dr_mode = "otg"; + 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_xhci { + dr_mode = "host"; + status = "okay"; +};