AnsweredAssumed Answered

i.MX6 USB OTG with 3.18.19 kernel

Question asked by David Robinson on Sep 14, 2015
Latest reply on Sep 14, 2017 by Fabio Estevam

Hi,

 

I am porting a Linux 3.18.19 kernel on a board which features an i.MX6.

I would like to use it as a real USB OTG, ie as a device or as a host depending on the USB_OTG_ID pin: when low the interface act as a host, when high it acts as a device.

 

The hardware is OK, as the USB OTG is working as host or device with a Linux 3.0.35 kernel.

When I connect a USB stick to USB OTG, it is enumerated.

When I connect USB OTG to a host PC and "modprobe g_mass_storage", the USB OTG is enumerated by the host PC.

I also see on the a scope that the USB_OTG_ID pin is correctly driven.

 

With the 3.18.19 kernel, I cannot have both device and host working as expected, even if the USB_OTG_ID is correctly driven.

I can only have one feature working, depending on dr_mode value in the the device tree.

 

1) &usbotg {

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_usbotg>;

        vbus-supply = <&reg_5p0v>;

        disable-over-current;

        dr_mode = "otg";

        status = "okay";

};

=> USB OTG can enumerate a USB stick (host OK), but cannot be enumerated by a host PC (device NOK)

After connecting to a host PC, I see the following output in dmesg:  ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11

 

2)

&usbotg {

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_usbotg>;

        vbus-supply = <&reg_5p0v>;

        disable-over-current;

        dr_mode = "peripheral";

        status = "okay";

};

=> USB OTG is enumerated by the host PC (device OK), but it cannot enumerate a USB stick (host NOK)

This seems normal, as the USB OTG is described as a peripheral, so it cannot work as a host.

 

What am I missing to have USB OTG working as a real OTG in case 1) ?

 

Regards,

David

Outcomes