From nobody Thu Oct 9 07:05:19 2025 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) (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 9E8EA28CF6B; Thu, 19 Jun 2025 18:37:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.112 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750358251; cv=pass; b=X975m0LBNQvZkOvJwwxx/i33Rjkks0UotPVxpiF/NwQUL7ZSBgw2E6dGpAiWXErbmvRtqUFxeN5EFOCzKjNMyGOXLICXxkHwy89nfL8pXDRO6JM1wiBpuuGKIaxfVEVKOr4KmXREPw/IOvjwGoEp0xAC/yp9K4scaVn9fuknQmI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750358251; c=relaxed/simple; bh=V9CQvzys+m7Loz1PpNe3/GgsFMgX2Mnh9CateKTX9aM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cXG0+oLgM7ATaOQN2GInV2Q2ttmB+i0U25BzY+FGpq961eAzuMqt0iE9q+bNXOCfNDp+DTAN8+u2yE27+j7UwUkCArR1y93TeQxH0UqSvsWar8zfNFC1Wf/tH4YMXJZnut4is9W6tz+1NpOWv3NM+6IhUv3jYDwz9phvXlPKN/U= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (1024-bit key) header.d=collabora.com header.i=nicolas.frattaroli@collabora.com header.b=XvZjDPEe; arc=pass smtp.client-ip=136.143.188.112 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=collabora.com header.i=nicolas.frattaroli@collabora.com header.b="XvZjDPEe" ARC-Seal: i=1; a=rsa-sha256; t=1750358218; cv=none; d=zohomail.com; s=zohoarc; b=A8azS6m+S5iFUo0+brLwmHycViLdwvdq+AZEe7p66hKfi5uPE/dd7zF/AuHSOGoy+BUlbOMgZPwq54snpnKonL2jpwlBixl1XVk/cvwSXoX2/EcPIIjqUzZ0QW7j0/HnovTrDrUmB+z4V5SYyUEJOHCH5u/sfzVOy2h8ADDxN64= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750358218; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=LD61zwrmreCa4aB/M9FxrH821zs6AkG4g0unv/BUYoY=; b=PIDbaAQYPoSZJSPBgxu/m711LYDMfFr7OK6JF0UdABo6S7eu3Oovmbtwd5mezpezmi7z8oI6Fk6F7i3JaURJ47r6LHWoilNr66XB6oLYQvZQsFvferlI6selm85d8buOMHncJqvMZBGdGGv4FRAB9uki4xsGYF+h/Osvn8BG2rM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=nicolas.frattaroli@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1750358218; s=zohomail; d=collabora.com; i=nicolas.frattaroli@collabora.com; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:References:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=LD61zwrmreCa4aB/M9FxrH821zs6AkG4g0unv/BUYoY=; b=XvZjDPEeomfmPUObvXs1e7kdzLzehZrXrgMECUnek+8dZNE31wLTam19y9uE8EoJ EVwKPnY0zx712uVchfo7m89H/n5B249adXdTstTGQsA9hTakw1JpSNJ2bP4WUCr2u01 4Xd3JZo351upElVit+mexZCwliiv3yr2OxFt1VXk= Received: by mx.zohomail.com with SMTPS id 1750358216401837.8847047716139; Thu, 19 Jun 2025 11:36:56 -0700 (PDT) From: Nicolas Frattaroli Date: Thu, 19 Jun 2025 20:36:37 +0200 Subject: [PATCH v5 2/2] arm64: dts: rockchip: enable USB on Sige5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250619-rk3576-sige5-usb-v5-2-9069a7e750e1@collabora.com> References: <20250619-rk3576-sige5-usb-v5-0-9069a7e750e1@collabora.com> In-Reply-To: <20250619-rk3576-sige5-usb-v5-0-9069a7e750e1@collabora.com> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Kever Yang , Frank Wang , Neil Armstrong Cc: Alexey Charkov , Sebastian Reichel , kernel@collabora.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Nicolas Frattaroli X-Mailer: b4 0.14.2 The ArmSoM Sige5 has several USB ports: a Type-A USB 3 port (USB2 lines going through a hub), a Type-A USB 2.0 port (also going through a hub), a Type-C DC input port that has absolutely no USB data connection and a Type-C port with USB3.2 Gen1x1 that's also the maskrom programming port. Enable these ports, and set the device role to be host for the host ports. The data capable Type-C USB port uses a fusb302 for data role switching. Signed-off-by: Nicolas Frattaroli --- .../boot/dts/rockchip/rk3576-armsom-sige5.dts | 160 +++++++++++++++++= ++++ 1 file changed, 160 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3576-armsom-sige5.dts b/arch/ar= m64/boot/dts/rockchip/rk3576-armsom-sige5.dts index 34e51cd71eac0395c7f36c892fc0711f6c324aea..b52646d76454671d83e7d684f67= c2186f8b8c3d7 100644 --- a/arch/arm64/boot/dts/rockchip/rk3576-armsom-sige5.dts +++ b/arch/arm64/boot/dts/rockchip/rk3576-armsom-sige5.dts @@ -205,6 +205,33 @@ vcc_3v3_ufs_s0: regulator-vcc-ufs-s0 { regulator-max-microvolt =3D <3300000>; vin-supply =3D <&vcc_5v0_sys>; }; + + vcc_5v0_typec0: regulator-vcc-5v0-typec0 { + compatible =3D "regulator-fixed"; + enable-active-high; + gpios =3D <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&usb_otg0_pwren>; + regulator-name =3D "vcc_5v0_typec0"; + regulator-min-microvolt =3D <5000000>; + regulator-max-microvolt =3D <5000000>; + vin-supply =3D <&vcc_5v0_device>; + }; + vcc_5v0_usbhost: regulator-vcc-5v0-usbhost { + compatible =3D "regulator-fixed"; + enable-active-high; + gpios =3D <&gpio4 RK_PA4 GPIO_ACTIVE_HIGH>; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&usb_host_pwren>; + regulator-name =3D "vcc_5v0_usbhost"; + regulator-min-microvolt =3D <5000000>; + regulator-max-microvolt =3D <5000000>; + vin-supply =3D <&vcc_5v0_device>; + }; +}; + +&combphy1_psu { + status =3D "okay"; }; =20 &combphy0_ps { @@ -631,6 +658,58 @@ regulator-state-mem { &i2c2 { status =3D "okay"; =20 + usbc0: typec-portc@22 { + compatible =3D "fcs,fusb302"; + reg =3D <0x22>; + interrupt-parent =3D <&gpio0>; + interrupts =3D ; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&usbc0_interrupt>; + vbus-supply =3D <&vcc_5v0_typec0>; + + connector { + compatible =3D "usb-c-connector"; + label =3D "USB-C"; + data-role =3D "dual"; + /* fusb302 supports PD Rev 2.0 Ver 1.2 */ + pd-revision =3D /bits/ 8 <0x2 0x0 0x1 0x2>; + power-role =3D "source"; + source-pdos =3D ; + + altmodes { + displayport { + svid =3D /bits/ 16 <0xff01>; + vdo =3D <0xffffffff>; + }; + }; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + usbc0_hs_ep: endpoint { + remote-endpoint =3D <&usb_drd0_hs_ep>; + }; + }; + port@1 { + reg =3D <1>; + usbc0_ss_ep: endpoint { + remote-endpoint =3D <&usb_drd0_ss_ep>; + }; + }; + port@2 { + reg =3D <2>; + usbc0_dp_ep: endpoint { + remote-endpoint =3D <&usbdp_phy_ep>; + }; + }; + }; + }; + }; + hym8563: rtc@51 { compatible =3D "haoyu,hym8563"; reg =3D <0x51>; @@ -736,6 +815,24 @@ pcie_reset: pcie-reset { rockchip,pins =3D <2 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>; }; }; + + usb { + usb_host_pwren: usb-host-pwren { + rockchip,pins =3D <4 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; + }; + usb_otg0_pwren: usb-otg0-pwren { + rockchip,pins =3D <4 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>; + }; + usbc0_interrupt: usbc0-interrupt { + rockchip,pins =3D <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>; + }; + usbc0_sbu1: usbc0-sbu1 { + rockchip,pins =3D <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_down>; + }; + usbc0_sbu2: usbc0-sbu2 { + rockchip,pins =3D <2 RK_PA7 RK_FUNC_GPIO &pcfg_pull_down>; + }; + }; }; =20 &sai1 { @@ -777,11 +874,74 @@ &sdmmc { status =3D "okay"; }; =20 +&u2phy0 { + status =3D "okay"; +}; + +&u2phy0_otg { + status =3D "okay"; +}; + +&u2phy1 { + status =3D "okay"; +}; + +&u2phy1_otg { + phy-supply =3D <&vcc_5v0_usbhost>; + status =3D "okay"; +}; + &uart0 { pinctrl-0 =3D <&uart0m0_xfer>; status =3D "okay"; }; =20 +&usb_drd0_dwc3 { + usb-role-switch; + dr_mode =3D "otg"; + status =3D "okay"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + usb_drd0_hs_ep: endpoint { + remote-endpoint =3D <&usbc0_hs_ep>; + }; + }; + + port@1 { + reg =3D <1>; + usb_drd0_ss_ep: endpoint { + remote-endpoint =3D <&usbc0_ss_ep>; + }; + }; + }; +}; + +&usb_drd1_dwc3 { + dr_mode =3D "host"; + status =3D "okay"; +}; + +&usbdp_phy { + mode-switch; + orientation-switch; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&usbc0_sbu1 &usbc0_sbu2>; + sbu1-dc-gpios =3D <&gpio2 RK_PA6 GPIO_ACTIVE_HIGH>; + sbu2-dc-gpios =3D <&gpio2 RK_PA7 GPIO_ACTIVE_HIGH>; + status =3D "okay"; + + port { + usbdp_phy_ep: endpoint { + remote-endpoint =3D <&usbc0_dp_ep>; + }; + }; +}; + &vop { status =3D "okay"; }; --=20 2.49.0