iMX28 : Configure USB0 without OTG feature

Hello,

I am trying to configure the kernel of the ConnectCard Wi-i.MX287 in order to use the USB0 port without the USB OTG feature.

I want to do that in order to use the pin 21 of the ConnectCard for GPIO usage.

So, I have changed the configuration of the kernel by disabling the following configuration parameters :

  • CONFIG_USB_OTG
  • CONFIG_USB_OTG_UTILS
  • CONFIG_MXC_OTG

Now, I can configure the pin 21 of the ConnectCard as a GPIO, but when I connect the 3G USB key Huawei E3131, two exceptions occurs :


irq 93: nobody cared (try booting with the "irqpoll" option)
handlers:
[] (ehci_fsl_pre_irq+0x0/0x5c)
[] (usb_hcd_irq+0x0/0xa0)
Disabling IRQ #93


irq 95: nobody cared (try booting with the "irqpoll" option)
handlers:
[] (usb_wakeup_handler+0x0/0x94)
Disabling IRQ #95

And the 3G USB key is not recognized :


# lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0002

(Note that this 3G USB key is correctly recognized when the OTG feature is activated, and the pin 21 of the ConnectCard is set to the ground)

I tried with another 3G USB key (MultiTech) with the same behavior.

Does anyone success in disabling the OTG feature on the ConnectCard Wi-i-MX28 ?

No, I want to use OTG USB0 but I do not need OTG mode, I’d like to force it to Host only mode in software and free the pin 21 that is normally used for OTG Host/Device selection to GPIO use.
At this point I assume it is not possible, but would like to confirm.

On arch/arm/mach-mx28/mx28_ccardxmx28_pins.c pin 21 of the ConnectCard for i.MX28 is configured as USB0_ID if CONFIG_USB_OTG is enabled. Disabling CONFIG_USB_OTG is all you need to free the GPIO for other purpose. This configuration switch however is not Freescale specific, but a common kernel switch, so it may disable other desired support.
That said, the USB0 is an On-The-Go port. On DEL-5.9 the driver is located at arch/arm/mach-mx28/usb_dr.c. Apparently it is prepared to be built for host-only support. You could disable CONFIG_USB_GADGET_ARC to build only for host (CONFIG_USB_EHCI_ARC_OTG enabled).
This however never been verified if this is a valid configuration. It might require additional changes (if at all possible).

I have disabled the configuration parameters CONFIG_USB_OTG and CONFIG_MXC_OTG, and I have selected the configuration parameter CONFIG_USB_GADGET_DUMMY_HCD instead of CONFIG_USB_GADGET_ARC.

That works perfectly. Thanks a lot for your answer.