USB OTG Usage on SAMA5D2

Discussion around products based on ARM Cortex-A5 core.

Moderator: nferre

mkurnaz
Posts: 2
Joined: Mon Jan 18, 2021 11:09 pm

USB OTG Usage on SAMA5D2

Tue Jan 19, 2021 11:18 am

Dear All,
We have a custom SOM module with SAMA5D27. We want to use OTG on USBA port and host on USBB port. But I coulnbd't find any id pin in schematics or linux drivers. Is there any one who used USBA port as OTG on SAMA5D2?

We use Linux version 5.4.81 with Yocto Dunfell.

Best Regards
nferre
Site Admin
Posts: 226
Joined: Wed Feb 14, 2007 11:17 am

Re: USB OTG Usage on SAMA5D2

Tue Jan 19, 2021 7:15 pm

Hi,

SAMA5D2 doesn't have a "real" OTG controller. It just can do both USB host and USB device (aka gadget in Linux wording) on the same port.
The way to decide whether this port is to behave as a host or a device is to be figured out by the application. Cable ID can give a hint but don't expect the whole OTG stack on top of it.

Best regards,
Nicolas
mkurnaz
Posts: 2
Joined: Mon Jan 18, 2021 11:09 pm

Re: USB OTG Usage on SAMA5D2

Tue Jan 19, 2021 10:30 pm

Dear Nicolas,

So thanks for your quick reply.

My hardware configuration is;
USBA is for user with mUSB connector
USBB is connected to 4 ports USB Hub for 3G, WiFi, Bluetooth and second ethernet.

I think, I can do as below;

I enable usb0 as gadget and usb1 as ehci in device tree.
I control ID pin status in gadget driver(at91_udc.c ) and ehci driver(ehci-atmel.c), then do something.

If one of these drivers control EN_UDPHS bit in UDPHS_CTRL register I can set or clear with ID pin in user level.

So with a little effort it is possible. Am i right?

Best Regards
blue_z
Location: USA
Posts: 2153
Joined: Thu Apr 19, 2007 10:15 pm

Re: USB OTG Usage on SAMA5D2

Wed Jan 20, 2021 3:46 am

See Microchip App Note AN_11201, titled "USB OTG-like Connector Implementation".

Regards

Return to “SAMA5D Cortex-A5 MPU”

Who is online

Users browsing this forum: No registered users and 9 guests