diff mbox series

[09/15] arm64: dts: rockchip: add lower USB3 port to opi5max

Message ID 20241026100310.52679-10-honyuenkwun@gmail.com (mailing list archive)
State New
Headers show
Series arm64: dts: rockchip: Add Orange Pi 5 Max board | expand

Commit Message

Jimmy Hon Oct. 26, 2024, 9:48 a.m. UTC
Enable full support (XHCI) for the lower USB3 port from Orange Pi 5 Max.

the vcc5v0_usb30 regulator shares the same enable gpio pin as the
vcc5v0_usb20 regulator.

Signed-off-by: Jimmy Hon <honyuenkwun@gmail.com>
---
 .../dts/rockchip/rk3588-orangepi-5-max.dts    | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Jimmy Hon Oct. 26, 2024, 8:40 p.m. UTC | #1
On Sat, Oct 26, 2024 at 5:03 AM Jimmy Hon <honyuenkwun@gmail.com> wrote:
>
> Enable full support (XHCI) for the lower USB3 port from Orange Pi 5 Max.
>v0
> the vcc5v0_usb30 regulator shares the same enable gpio pin as the
> vcc5v0_usb20 regulator.


> --- a/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-max.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-max.dts
> @@ -111,6 +111,8 @@ vcc5v0_sys: vcc5v0-sys-regulator {
>         };
>
>         /* Represents the vcc5v0_usb20 in the schematic */
> +       /* Also represents the vcc5v0_usb30 in the schematic,
> +          both regulators share the same enable gpio */
>         vcc5v0_host: vcc5v0-host-regulator {
>                 compatible = "regulator-fixed";
>                 enable-active-high;

Is there a better way to represent the two USB host regulators? In the
schematic [1] page 14, there's two regulators vcc5v0_usb20 and
vcc5v0_usb30, however they both use USB_HOST_PWREN as the EN pin.

In the case of the OPI5Plus [2] page 16, it uses a different EN pin
for vcc5v0_usb30. However, in the mainline OPI5Plus, it left
vcc5v0_usb30 regulator out of the dts [3].

[1] http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-Max.html
[2] http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-plus.html
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts#n209

Jimmy
Jimmy Hon Oct. 26, 2024, 8:49 p.m. UTC | #2
On Sat, Oct 26, 2024 at 3:40 PM Jimmy Hon <honyuenkwun@gmail.com> wrote:
>
> In the case of the OPI5Plus [2] page 16, it uses a different EN pin
> for vcc5v0_usb30. However, in the mainline OPI5Plus, it left
> vcc5v0_usb30 regulator out of the dts [3].
>
> [1] http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-Max.html
> [2] http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-plus.html
> [3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts#n209
>
> Jimmy
Wait, I'm wrong about the USB 3 functionality on the Orange Pi 5 Plus.
The Orange Pi 5 Plus is only enabling usb_host1_xhci now [1]. However,
it's only adding the Type C regulator without the usb30 regulator.

[1] https://lore.kernel.org/all/20241025175415.887368-1-wens@kernel.org/

Jimmy
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-max.dts b/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-max.dts
index be4af5006d69..f32e5827dce6 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-max.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-max.dts
@@ -111,6 +111,8 @@  vcc5v0_sys: vcc5v0-sys-regulator {
 	};
 
 	/* Represents the vcc5v0_usb20 in the schematic */
+	/* Also represents the vcc5v0_usb30 in the schematic,
+	   both regulators share the same enable gpio */
 	vcc5v0_host: vcc5v0-host-regulator {
 		compatible = "regulator-fixed";
 		enable-active-high;
@@ -634,6 +636,15 @@  &tsadc {
 	status = "okay";
 };
 
+&u2phy1 {
+	status = "okay";
+};
+
+&u2phy1_otg {
+	phy-supply = <&vcc5v0_host>;
+	status = "okay";
+};
+
 &u2phy2 {
 	status = "okay";
 };
@@ -657,6 +668,10 @@  &uart2 {
 	status = "okay";
 };
 
+&usbdp_phy1 {
+	status = "okay";
+};
+
 &usb_host0_ehci {
 	status = "okay";
 };
@@ -672,3 +687,8 @@  &usb_host1_ehci {
 &usb_host1_ohci {
 	status = "okay";
 };
+
+&usb_host1_xhci {
+	dr_mode = "host";
+	status = "okay";
+};