# iMX28 : Configure USB0 without OTG feature

**URL:** <https://forums.digi.com/t/imx28-configure-usb0-without-otg-feature/15685>\
**Category:** Linux\
**Tags:** kernel, usb, linux, wi-imx28, otg\
**Created:** [October 30, 2015, 10:00am UTC](https://forums.digi.com/t/imx28-configure-usb0-without-otg-feature/15685 "2015-10-30T10:00:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbrizard\_scheiber](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@sbrizard\_scheiber](https://forums.digi.com/u/sbrizard_scheiber)\
**Post date:** [October 30, 2015, 10:00am UTC](https://forums.digi.com/t/imx28-configure-usb0-without-otg-feature/15685/1 "2015-10-30T10:00:31Z")

</div>

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 :

```auto

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

```

```auto

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 :

```auto

# 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 ?

---

<div class="post-metadata">

**Author:** ![LeonidM](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@LeonidM](https://forums.digi.com/u/LeonidM)\
**Post date:** [November 2, 2015, 9:31am UTC](https://forums.digi.com/t/imx28-configure-usb0-without-otg-feature/15685/2 "2015-11-02T09:31:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![LeonidM](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@LeonidM](https://forums.digi.com/u/LeonidM)\
**Post date:** [November 2, 2015, 10:21am UTC](https://forums.digi.com/t/imx28-configure-usb0-without-otg-feature/15685/3 "2015-11-02T10:21:49Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![sbrizard\_scheiber](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@sbrizard\_scheiber](https://forums.digi.com/u/sbrizard_scheiber)\
**Post date:** [November 3, 2015, 10:20am UTC](https://forums.digi.com/t/imx28-configure-usb0-without-otg-feature/15685/4 "2015-11-03T10:20:19Z")

</div>

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.
