From nobody Fri Dec 19 06:34:57 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6DBF522301; Fri, 20 Dec 2024 16:12:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734711168; cv=none; b=ecTer71+tJQMfB7pfK4viHm+dKthrXjxEBT/vJGYkbERTFU7ObRa13FlxESXgETPfFZyisluVEIzBoV30E0a9WPGnG+ci11Hq6pNWc2WARCE1VJJUqQtMDt4RMizt0MzpIxxG/h5ZpdxWolPEsD7V5jnAcM9gx23yu7c4IqIsZs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734711168; c=relaxed/simple; bh=lT+NvKXEt+wDw547wMVflj0Ny9W3OCFAz0S4kRCQXyc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=IRgiNxPi4ZZWcPeNRUgejUTgZWh9fqCGTPmxKxNeAlxViBOZSYnNrPxQ7WkbXKwQwTtrBykt5+9Echd8/WG16KSoa9hpsZ7bBqrBbSjEpdnsU3OWWU5QV7daEPVQ9axEo65xHX/gCcjnkRsN9rXdKXUUaDXhAkOcCNOyt52ojbI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ob0iH/5c; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ob0iH/5c" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D146FC4CECD; Fri, 20 Dec 2024 16:12:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734711168; bh=lT+NvKXEt+wDw547wMVflj0Ny9W3OCFAz0S4kRCQXyc=; h=From:To:Cc:Subject:Date:From; b=Ob0iH/5cVvLnjtYxJS4SzD2U2vUzqvczNK6PKb13onAJa1JdH2JcBa/LUx469WpFV 51MkXpZbQLTKD2tXqJUL6GpN9flX2/kHmqo84lzpxZ1HR3rTAvWCy9jLDfSlg0F1CC F+m1C+/9J6W5eoqZ/ILzoUxCsXolwifQfCcRcG/WJFyxQzBE4a/R/imyrQb6TSOIby mLerfWhHLLnG9lL5nd9G884coJy3ORjfeVZYgjR2mEb91uFjTXZDoasXy/B9vCsZEb vxVdLGM3UTr08eUKoNW7QrXuIwg/Ib/i563jV3g2G10T9QTm7I60ihfU7zHumgN6z4 Ds0nAp7zXUkjA== Received: by wens.tw (Postfix, from userid 1000) id DBAD15FB8F; Sat, 21 Dec 2024 00:12:44 +0800 (CST) From: Chen-Yu Tsai To: Heiko Stuebner Cc: Chen-Yu Tsai , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Ond=C5=99ej=20Jirman?= Subject: [PATCH v2] arm64: dts: rockchip: orangepi-5-plus: Enable USB 3.0 ports Date: Sat, 21 Dec 2024 00:12:40 +0800 Message-Id: <20241220161240.109253-1-wens@kernel.org> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Chen-Yu Tsai The Orange Pi 5 Plus has its first USB 3.0 interface on the SoC wired directly to the USB type C port next to the MASKROM button, and the second interface wired to a USB 3.0 hub which in turn is connected to the USB 3.0 host ports on the board, as well as the USB 2.0 connection on the M.2 E-key slot. Signed-off-by: Chen-Yu Tsai Reviewed-by: Ondrej Jirman --- Changes since v1: - Dropped source current to 1.4A - Dropped sink current to 10mA, since it doesn't actually sink current - Added try-power-role - Added newline before endpoint device nodes in USB connector node --- .../dts/rockchip/rk3588-orangepi-5-plus.dts | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts b/arch= /arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts index 9f5a38b290bf..000d353645a9 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts @@ -218,6 +218,18 @@ vcc5v0_sys: regulator-vcc5v0-sys { regulator-max-microvolt =3D <5000000>; }; =20 + vbus5v0_typec: vbus-typec-regulator { + compatible =3D "regulator-fixed"; + enable-active-high; + gpio =3D <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&typec5v_pwren>; + regulator-name =3D "vbus5v0_typec"; + regulator-min-microvolt =3D <5000000>; + regulator-max-microvolt =3D <5000000>; + vin-supply =3D <&vcc5v0_sys>; + }; + vcc5v0_usb20: regulator-vcc5v0-usb20 { compatible =3D "regulator-fixed"; enable-active-high; @@ -344,6 +356,57 @@ &i2c6 { clock-frequency =3D <400000>; status =3D "okay"; =20 + usbc0: usb-typec@22 { + compatible =3D "fcs,fusb302"; + reg =3D <0x22>; + interrupt-parent =3D <&gpio0>; + interrupts =3D ; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&usbc0_int>; + vbus-supply =3D <&vbus5v0_typec>; + status =3D "okay"; + + usb_con: connector { + compatible =3D "usb-c-connector"; + label =3D "USB-C"; + data-role =3D "dual"; + power-role =3D "dual"; + source-pdos =3D ; + sink-pdos =3D ; + op-sink-microwatt =3D <10>; + try-power-role =3D "source"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + + usbc0_hs: endpoint { + remote-endpoint =3D <&usb_host0_xhci_drd_sw>; + }; + }; + + port@1 { + reg =3D <1>; + + usbc0_ss: endpoint { + remote-endpoint =3D <&usbdp_phy0_typec_ss>; + }; + }; + + port@2 { + reg =3D <2>; + + usbc0_sbu: endpoint { + remote-endpoint =3D <&usbdp_phy0_typec_sbu>; + }; + }; + }; + }; + }; + hym8563: rtc@51 { compatible =3D "haoyu,hym8563"; reg =3D <0x51>; @@ -485,6 +548,16 @@ vcc5v0_usb20_en: vcc5v0-usb20-en { rockchip,pins =3D <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; }; }; + + usb-typec { + usbc0_int: usbc0-int { + rockchip,pins =3D <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>; + }; + + typec5v_pwren: typec5v-pwren { + rockchip,pins =3D <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; }; =20 &pwm2 { @@ -876,6 +949,23 @@ &tsadc { status =3D "okay"; }; =20 +&u2phy0 { + status =3D "okay"; +}; + +&u2phy0_otg { + status =3D "okay"; +}; + +&u2phy1 { + status =3D "okay"; +}; + +&u2phy1_otg { + phy-supply =3D <&vcc5v0_sys>; + status =3D "okay"; +}; + &u2phy2 { status =3D "okay"; }; @@ -904,6 +994,33 @@ &uart9 { status =3D "okay"; }; =20 +&usbdp_phy0 { + mode-switch; + orientation-switch; + sbu1-dc-gpios =3D <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>; + sbu2-dc-gpios =3D <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>; + status =3D "okay"; + + port { + #address-cells =3D <1>; + #size-cells =3D <0>; + + usbdp_phy0_typec_ss: endpoint@0 { + reg =3D <0>; + remote-endpoint =3D <&usbc0_ss>; + }; + + usbdp_phy0_typec_sbu: endpoint@1 { + reg =3D <1>; + remote-endpoint =3D <&usbc0_sbu>; + }; + }; +}; + +&usbdp_phy1 { + status =3D "okay"; +}; + &usb_host0_ehci { status =3D "okay"; }; @@ -912,6 +1029,17 @@ &usb_host0_ohci { status =3D "okay"; }; =20 +&usb_host0_xhci { + usb-role-switch; + status =3D "okay"; + + port { + usb_host0_xhci_drd_sw: endpoint { + remote-endpoint =3D <&usbc0_hs>; + }; + }; +}; + &usb_host1_ehci { status =3D "okay"; }; @@ -920,6 +1048,11 @@ &usb_host1_ohci { status =3D "okay"; }; =20 +&usb_host1_xhci { + dr_mode =3D "host"; + status =3D "okay"; +}; + &vop_mmu { status =3D "okay"; }; --=20 2.39.5