Allwinner H3 (Opi PC) USB OTG - Multiple gadgets issue

64 views
Skip to first unread message

Artem Komissarov

unread,
Nov 27, 2022, 12:28:17 PM11/27/22
to linux-sunxi
Hello,

I apologize in advance if this has been brought up before or discussed, I'm new here and did not find it in the previous posts.
I'm working on a port of PiKVM to Orange Pi (PC in this case) among other SBC's and having an issue running multiple USB gadgets (config-fs) at the same time. The most i can seem to run is Keyboard(HID)+Mouse(HID)+ either USB Ethernet or MSD. If i try to do USB Ethernet and MSD the UDC crashes and nothing works. This is on Armbian BTW, and I'm wondering if there is a limit to how many USB gadget devices you can run on Allwinner chips or if it's a kernel compilation misconfiguration on my part (perhaps a patch?). This setup works perfectly fine on RK3328 for example and of course of native hardware for PiKVM the RPI4.
I can provide logs if need be, but i figured someone on here would know the answer simply by explaining the situation.
Thank you in advance and appreciate you taking the time to read this!

Artem Komissarov


Andre Przywara

unread,
Nov 28, 2022, 12:21:52 PM11/28/22
to Artem Komissarov, linux-sunxi
On Sun, 27 Nov 2022 01:28:30 -0800 (PST)
Artem Komissarov <artem...@gmail.com> wrote:

Hi Artem,

> I apologize in advance if this has been brought up before or discussed, I'm
> new here and did not find it in the previous posts.
> I'm working on a port of PiKVM to Orange Pi (PC in this case) among other
> SBC's and having an issue running multiple USB gadgets (config-fs) at the
> same time. The most i can seem to run is Keyboard(HID)+Mouse(HID)+ either
> USB Ethernet or MSD. If i try to do USB Ethernet and MSD the UDC crashes
> and nothing works. This is on Armbian BTW, and I'm wondering if there is a
> limit to how many USB gadget devices you can run on Allwinner chips

Yes, there is a hardware limit in the Allwinner implementation of the MUSB
USB controller. The H3 only supports four endpoints (most other
Allwinner SoCs can do five), each with an RX and FX FIFO. So depending on
how much resources your gadget needs, you run out very quickly. For
instance you will be limited to just two serial gadgets, since the normal
one requires three streams (bulk in, bulk out, control), which consumes
two endpoints.
If you dig deeper into the USB setup, it should say somewhere how many
resources your gadgets use, I bet you run into the limit here.

Cheers,
Andre

Artem Komissarov

unread,
Nov 30, 2022, 4:09:21 PM11/30/22
to linux-sunxi
Thank you very much for the reply. I found the same answer actually the same night i posted the question and was disappointed lol
Oh well, we will use another board. BTW how do you check the "USB setup" and see what each device is taking up and perhaps actually see the total amount of end points without having to go digging into hardware docs?
Reply all
Reply to author
Forward
0 new messages