fsl-udc (USB gadget) anyone?

Baruch Siach baruch at tkos.co.il
Tue Aug 17 10:13:16 EDT 2010


Hi Sascha,

On Mon, Aug 16, 2010 at 09:09:04AM +0200, Sascha Hauer wrote:
> On Mon, Aug 16, 2010 at 09:37:04AM +0300, Baruch Siach wrote:
> > Hi Barebox list,
> > 
> > I see that there are no in-tree fsl-udc driver users. Does anyone here have 
> > experience with this driver on an i.MX based system? What pre-probe() 
> > initialization does this driver require at the platform code?
> 
> 
> We are using it on a custom i.MX25 board (which is not in mainline
> because hardly anyone could make use of the code). Here is the platform
> initialization code (mixed with ehci host support). It works fine in DFU
> mode, serial support is probably not working. I have tried serial
> support, but had problems integrating it properly in barebox.

[snip]

> +static struct fsl_usb2_platform_data usb_pdata = {
> +	.operating_mode	= FSL_USB2_DR_DEVICE,
> +	.phy_mode	= FSL_USB2_PHY_UTMI,
> +};
> +
> +static struct device_d usbotg_dev = {
> +	.name     = "fsl-udc",
> +	.map_base = IMX_OTG_BASE,
> +	.size     = 0x200,
> +	.platform_data = &usb_pdata,
> +};

Thanks for the info. Unfortunately I was not able to get dfu work on both the 
i.MX25 PDK and our custom board. The board doesn't even get enumerated. The 
USB PHY wiring is the same on both.  After running the 'dfu' command as 
follows:

barebox:/ dfu -V 0x082d -P 0x2000 test(script)

I connect the board to my host and see the following on the host side:

[113870.024034] usb 2-1: new high speed USB device using ehci_hcd and address 101
[113870.092245] hub 2-0:1.0: unable to enumerate USB device on port 1
[113870.584048] usb 6-1: new full speed USB device using uhci_hcd and address 27
[113870.700071] hub 6-0:1.0: unable to enumerate USB device on port 1
[113871.080062] usb 6-1: new full speed USB device using uhci_hcd and address 28
[113871.200106] usb 6-1: device descriptor read/64, error -71
[113871.424073] usb 6-1: device descriptor read/64, error -71
[113871.640069] usb 6-1: new full speed USB device using uhci_hcd and address 29
[113871.760068] usb 6-1: device descriptor read/64, error -71
[113871.984068] usb 6-1: device descriptor read/64, error -71
[113872.200067] usb 6-1: new full speed USB device using uhci_hcd and address 30
[113872.608070] usb 6-1: device not accepting address 30, error -71
[113872.720073] usb 6-1: new full speed USB device using uhci_hcd and address 31
[113873.128058] usb 6-1: device not accepting address 31, error -71
[113873.128079] hub 6-0:1.0: unable to enumerate USB device on port 1

Sprinkling printfs over the fsl-udc driver code didn't reveal much, except 
from repeated USB_STS_PORT_CHANGE and USB_STS_RESET interrupts. Before giving 
up completely I thought I'd just report this failure, maybe someone has a 
clue.

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -



More information about the barebox mailing list