I’m trying to configure the USB OTG port in “device” mode.
According to the Device Tree, the DWC3 driver seems to be the one used to control the USB OTG port.
However, it seems to be working only in “host” mode.
After searching the web for a while, I found these two sources, explaining that USB device mode is not available by default, that the DWC3 driver is responsible for the “host” mode and that we have to add a DWC2 driver to support the “device” mode.
please note that device mode and OTG support on Amlogic Meson GXL is
more complicated, as it uses dwc2 and dwc3 controllers in combination:
- dwc3 is reponsible for host-only mode
- dwc2 is responsible for device-only mode
- OTG detection is done by the USB3 PHY
The dwc3 controller supports host mode only. Peripheral mode is implemented through an additional dwc2 controller (which only enables device mode). The USB3 PHY has register bits which allow a driver to detect the current mode - however this is currently not implemented as the dwc2 controller seems to hang during reset (and I do not have a use-case where I need peripheral/device mode).
I tried adding a DWC2 driver in the DTS file, however I don’t know how to configure it propertly.
Have you ever faced this issue?
Do you have any ideas about how to configure USB OTG?
Thanks for your help,