Chipidea driver failed to detect mx28 USB 0 as gadget Device

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Chipidea driver failed to detect mx28 USB 0 as gadget Device

1,822 Views
tainguyen
Contributor III

ello,

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:

CONFIG_USB_CHIPIDEA=m

CONFIG_USB_CHIPIDEA_UDC=y

CONFIG_USB_CHIPIDEA_HOST=y

CONFIG_USB_CHIPIDEA_DEBUG=y

CONFIG_USB_GADGET=m

CONFIG_USB_G_SERIAL=m

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>;

    disable-over-current;

    status = "okay";

};

reg_usb0_vbus: usb0_vbus {

    compatible = "regulator-fixed";

    regulator-name = "usb0_vbus";

    regulator-min-microvolt = <5000000>;

    regulator-max-microvolt = <5000000>;

    enable-active-high;

};

Labels (2)
0 Kudos
Reply
2 Replies

962 Views
fabio_estevam
NXP Employee
NXP Employee

usb gagdet works fine on mx28 running 3.12-rc3. Please use this version instead.

0 Kudos
Reply

962 Views
tainguyen
Contributor III

Fabio,

That's good news. I'll diff the 2 and see what has change. Unfortunately, I don't have the luxury of upgrading to 3.12 rc3. Mean while, I was looking forward for insight into the ChipIdea USB device initialization. I learned that 3.10 rc3 fixed the USB gadget issue but somehow rc6 does not work for me( usually that shouldn't be the case ). I was also looking to learn the correct way to set up the USB device to be a gadget device.

I appreciate any additional detail information you can throw my way.

Thanks,

Tai

0 Kudos
Reply