I'm developing a device which needs to have an USB OTG port, which can switch between host or device on the fly. At the moment I can only get the USB0 port to operate as a host or device, not both. I can't find any examples of anyone actually getting this to work.
I think I've narrowed the problem down to the usb device driver fsl-usb2-udc (drivers/usb/gadget/fsl_udc_core.c), which when configured as OTG does not ever detect being connected to a host. If I configure that driver as device only, it works ok, although it still doesn't actually detect the connect/disconnect.
Chris Sawran mentions here http://forums.freescale.com/t5/i-MX-Microprocessors/IMX233-as-USB-device/m-p/55090#M643 that vbus sensing is not actually implemented.
I've had to modify mxs-usbphy.c to be able to load both fsl-usb2-udc and ehci-hcd at the same time - previously it caused crashes or one of the initialisations would fail.
Has anyone been able to get USB OTG working properly?