Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => iMX233 => Topic started by: devslashfoo on July 22, 2013, 06:00:08 pm

Title: USB Gadget w. kernel 3.10.1
Post by: devslashfoo on July 22, 2013, 06:00:08 pm
I'm having problems getting USB gadget support working with iMX233-OLinuXino-Micro. According to an earlier (ancient) thread, it can be (and has been) done: https://www.olimex.com/forum/index.php?topic=169.0 (https://www.olimex.com/forum/index.php?topic=169.0)

USB host is working perfectly. However, the best I've got with USB device is:
[    0.770000] imx_usb 80080000.usb: pinctrl get/select failed, err=-19
[    0.780000] ci_hdrc ci_hdrc.0: doesn't support host
[    0.790000] ci_hdrc ci_hdrc.0: can't start gadget role

This was reached with related kernel config:
Device Drivers -> USB Support:
< >   Support for Host-side USB
<*>   ChipIdea Highspeed Dual Role Controller
[*]     ChipIdea device controller
[*]   USB Physical Layer drivers  --->
  <*>   Freescale MXS USB PHY support
<*>   USB Gadget Support  --->
  [*]   Debugging messages (DEVELOPMENT)
  [*]   Debugging information files (DEVELOPMENT)
  (200) Maximum VBUS Power usage (2-500 mA)
  (2)   Number of storage pipeline buffers
  <M>   USB Gadget Drivers
    <M>     Gadget Zero (DEVELOPMENT)
    <M>     Ethernet Gadget (with CDC Ethernet support)
      [*]       RNDIS support

Can anyone advice? I tried to read drivers/usb/chipidea/* but I couldn't make heads or tails of it.
Title: Re: USB Gadget w. kernel 3.10.1
Post by: devslashfoo on July 24, 2013, 03:47:25 pm
ChipIdea kernel driver seems to be under heavy development. A partially working patch can be found at:  http://git.pengutronix.de/?p=mgr/linux.git;a=shortlog;h=refs/heads/v3.10/topic/usb-peterchen (http://git.pengutronix.de/?p=mgr/linux.git;a=shortlog;h=refs/heads/v3.10/topic/usb-peterchen)

The patch also requires following changes to arch/arm/boot/dts/imx23-olinuxino.dts:
usb0: usb@80080000 {
        dr_mode = "peripheral";
        status = "okay";

For additional information, see: http://archive.arm.linux.org.uk/lurker/thread/20130529.075044.56137dd8.en.html#i20130529.075044.56137dd8