Skip to content

[Bug]: peripheral port/gadget mode stopped working on orange pi zero lts after upgrading to 6.12 #8871

@schmorp

Description

@schmorp

What happened?

First of all, I am sorry if this is the wrong way to report this, but the linux kernel bug report path requires one to jump through a lot of unrelated hoops - I think it sends the wrong message if one wants to make a good faith bug report about an armbian package and is suddenly required to actually run a full armbian image and provide completely unrelated debugging info, making reporting a linux-kernel package bug impractical.

In any case, after upgrading from the 6.1 and 6.6 armbian kernels on my orange pi zero lts to the 6.12.51 kernel, gadget mode stopped working. /sys/class/udc/*/state keeps reporting "not connected".

I tracked it down to a change to the usb host port config (not surprisingly :), and found that this device tree overlay fixes it, when applied to the base sun8i-h2-plus-orangepi-zero.dtb:

/dts-v1/;
/plugin/;

/ {
        compatible = "xunlong,orangepi-zero";

        fragment@0 {
                target = <&ehci0>;
                __overlay__ {
                        // Remove PHY linkage to fix OTG conflict
                        /delete-property/ phys;
                        /delete-property/ phy-names;
                };
        };

        fragment@1 {
                target = <&ohci0>;
                __overlay__ {
                        // Remove PHY linkage to fix OTG conflict
                        /delete-property/ phys;
                        /delete-property/ phy-names;
                };
        };

};

From what I gather, this is part of an attempt to convert this into a normal usb host port with otg functionality.

However, I think the "otg" port on the orange pi zero is not an otg port but simply a peripheral port without the necessary hardware for vbus detection &c. As such, this means that dr_mode should probably also be set to peripheral, but gadget mode works after the above overlay is applied.

As far as I can see, this change is armbian-specific. I apologize in advance if I overlooked it and this is actually an upstream bug.

How to reproduce?

Load g_ether, see that the orange pi is not recognized as a usb device with 6.12, but is with 6.1.

Apply the overlay, reboot, load g_ether, see that it is now recognized.

Branch

main (main development branch)

On which host OS are you running the build script and observing this problem?

Debian 13 Trixie

Are you building on Windows WSL2?

  • Yes, my Ubuntu/Debian/OtherOS is running on WSL2

Relevant log URL

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working as it shouldGood first issueFeel free to contribute :)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions