AnsweredAssumed Answered

Chipidea driver failed to detect mx28 USB 0 as gadget Device

Question asked by Tai Nguyen on Oct 3, 2013
Latest reply on Oct 3, 2013 by Tai Nguyen



first: sorry for my english.


Setup: Mx28 with USB0 connect to linux PC. USB0 is capable of OTG.


USB0 is set up to be an OTG device. I am running linux 3.10 rc6. I would like to turn the USB0 into a gadget_serial device so I can talk to it from the PC using minicom.


I compiled the linux image with the following config:










I can't load the g_serial module because it couldn't find any UDC device. This is the chipidea core did not register any udc device in the udc_device list. The reason: it thinks the USB0 is a host device instead of a gadget device.


I put print statement inside the driver and observed the following:


Inside /chipidea/core.c: ci_hdrc_probe(),  after calling ci_hdrc_gadet_init(ci), the result is a dual role for both host and gadget. This is correct since the DCCPARAMS register has both HC and DC bits set to 1. However, afterward, it calls ci_otg_role(ci). The result is always return as HOST. This is because bit OTGSC_ID of the OTGSC register is reporting 0 which stand for A  device.


As i understand, and that's not much, the PC and the mx28 negotiate and determine who can be host/device. I would expect that the OTGSC register reports result of this negotiation. When and where does this happen? I also expect that the MX28 will be a Device, where did it go wrong?


What is the appropriate step to turn the USB0 into a gadget device?

What do I need as far as device tree? configuration?

Or is there a bug somewhere that cause the device to always be a host?

what am i missing?

Gosh, i am desperate.


Here is a catch: with the same hardware setup and the mx28 running kernel 2.6,  works like a charm.


I appreciate any idea.


here is the device tree for USB0


usb0: usb@80080000 {

    vbus-supply = <&reg_usb0_vbus>;


    status = "okay";



reg_usb0_vbus: usb0_vbus {

    compatible = "regulator-fixed";

    regulator-name = "usb0_vbus";

    regulator-min-microvolt = <5000000>;

    regulator-max-microvolt = <5000000>;