[3/4] arm64: dts: allwinner: h5: orangepi-zero-plus2: Fix USB peripheral mode

Message ID 20261120-orangepi-zero-plus2-fixes-v1-3-ecd792189f27@gmail.com (mailing list archive)
State New
Headers
Series arm64: dts: allwinner: h5: orangepi-zero-plus2: Fix Bluetooth and USB gadget |

Commit Message

Ivan Pfarher via B4 Relay Nov. 20, 2026, 11:40 a.m. UTC
From: Ivan Pfarher <ipfarher@gmail.com>

The micro USB port is set to dr_mode = "peripheral" because it cannot
supply VBUS, but EHCI0/OHCI0, which share USB PHY 0 with the MUSB
controller, are enabled too.

When they register, usb_add_hcd() asks the shared PHY for host mode
(since commit e671765e521c ("usb: core: Try generic PHY_MODE_USB_HOST
if usb_phy_roothub_set_mode fails")), and phy-sun4i-usb switches PHY 0
to host ("Changing dr_mode to 1"). MUSB then stays in a_wait_vrise, the
UDC stays "not attached", and a gadget never shows up on the host.

The port cannot work as a host on this board anyway, so drop EHCI0 and
OHCI0.

Tested on an Orange Pi Zero Plus2 (H5) running Linux 6.6.160 with this
change applied: g_cdc enumerates on the PC (CDC ECM + ACM), the UDC
state is "configured" and MUSB is in b_peripheral. Build-tested only
against current mainline.

The H3 version of the board (sun8i-h3-orangepi-zero-plus2.dts) has the
same setup from the same commit but is not changed here, as it could
not be tested.

This problem was investigated, and the patch drafted, in an interactive
session with an AI coding assistant (Claude by Anthropic). The submitter
reviewed the change and ran the tests described above.

Fixes: 43aad09c7928 ("ARM: dts: orange-pi-zero-plus2: enable USB OTG port")
Signed-off-by: Ivan Pfarher <ipfarher@gmail.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts | 8 --------
 1 file changed, 8 deletions(-)
  

Comments

Chen-Yu Tsai Nov. 20, 2026, 3:33 p.m. UTC | #1
On Fri, Nov 20, 2026 at 7:40 PM Ivan Pfarher via B4 Relay
<devnull+ipfarher.gmail.com@kernel.org> wrote:
>
> From: Ivan Pfarher <ipfarher@gmail.com>
>
> The micro USB port is set to dr_mode = "peripheral" because it cannot
> supply VBUS, but EHCI0/OHCI0, which share USB PHY 0 with the MUSB
> controller, are enabled too.
>
> When they register, usb_add_hcd() asks the shared PHY for host mode
> (since commit e671765e521c ("usb: core: Try generic PHY_MODE_USB_HOST
> if usb_phy_roothub_set_mode fails")), and phy-sun4i-usb switches PHY 0
> to host ("Changing dr_mode to 1"). MUSB then stays in a_wait_vrise, the
> UDC stays "not attached", and a gadget never shows up on the host.
>
> The port cannot work as a host on this board anyway, so drop EHCI0 and
> OHCI0.
>
> Tested on an Orange Pi Zero Plus2 (H5) running Linux 6.6.160 with this
> change applied: g_cdc enumerates on the PC (CDC ECM + ACM), the UDC
> state is "configured" and MUSB is in b_peripheral. Build-tested only
> against current mainline.
>
> The H3 version of the board (sun8i-h3-orangepi-zero-plus2.dts) has the
> same setup from the same commit but is not changed here, as it could
> not be tested.

Just want to point out that the board is actually the same. H3 and H5 are
pin compatible so they just swap out the SoC. This board should have a
shared .dtsi file.

> This problem was investigated, and the patch drafted, in an interactive
> session with an AI coding assistant (Claude by Anthropic). The submitter
> reviewed the change and ran the tests described above.
>
> Fixes: 43aad09c7928 ("ARM: dts: orange-pi-zero-plus2: enable USB OTG port")
> Signed-off-by: Ivan Pfarher <ipfarher@gmail.com>

Reviewed-by: Chen-Yu Tsai <wens@kernel.org>

> ---
>  arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts | 8 --------
>  1 file changed, 8 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
> index 5697251b9..892723b46 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
> @@ -66,10 +66,6 @@
>         status = "okay";
>  };
>
> -&ehci0 {
> -       status = "okay";
> -};
> -
>  &hdmi {
>         status = "okay";
>  };
> @@ -115,10 +111,6 @@
>         status = "okay";
>  };
>
> -&ohci0 {
> -       status = "okay";
> -};
> -
>  &uart0 {
>         pinctrl-names = "default";
>         pinctrl-0 = <&uart0_pa_pins>;
>
> --
> 2.43.0
>
>
  

Patch

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
index 5697251b9..892723b46 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
@@ -66,10 +66,6 @@ 
 	status = "okay";
 };
 
-&ehci0 {
-	status = "okay";
-};
-
 &hdmi {
 	status = "okay";
 };
@@ -115,10 +111,6 @@ 
 	status = "okay";
 };
 
-&ohci0 {
-	status = "okay";
-};
-
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pa_pins>;