MPC8306 OTG Linux support

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

MPC8306 OTG Linux support

1,820 Views
qwerty
Contributor I

Hi,

We are trying to enable USB OTG support on an MPC8306  with a SMSC 3300 USB PHY attached - the same as the Dev Kit.

I have built various Linux OTG device driver modules. At first, when I tried to insmod them, they failed because a prerequisite was not present. At this point USB host-mode did work. I noticed that the USB driver was failing during initialization to allocate memory region for the IMMR USB registers.

As this isn't normally done, I took it out and allowed the driver to complete initialization. USB OTG Device Gadget drivers will now install. However, at this point, the USB driver stopped responding to plugging in devices (so that it acts like a host) too -- no Gadget drivers are installed.

My questions are:

1) Is USB, especially full OTG device mode, supported in the Linux MPC8306 drivers?

2) Any suggestions on where this driver is likely going wrong?

3) Are there any other similar processors MPC83xx which have OTG host and device mode drivers working?

Thanks.

Regards,

Quinn.

0 Kudos
2 Replies

763 Views
qwerty
Contributor I

Further follow-up.

I have finally tried this on the 8306 SOM Kit without success.

  1. The precompiled binaries don't have support for gadget USB.
  2. Recompiling the kernel with gadget support and adding the gadget drivers to the filesystem, I get the same "no such device" error as above when I try to install the modules.
  3. Modifying the gadget source to get rid of the memory allocation as described above did not improve things and it looks like the probe function is never called.

<<<< USB Host Drivers being initialized. >>>>

USB Mass Storage support registered.

usbcore: registered new interface driver usbserial

usbserial: USB Serial Driver core

<<<< USB Gadget driver fsl_udc_core.c:udc_init(). >>>>

--- QQQ --- about to probe

Freescale High-Speed USB SOC Device Controller driver (Apr 20, 2007)

<<<< Now calls platform_driver_probe(), but doesn't print anything from the fsl_udc_probe function. >>>>

i2c /dev entries driver

sdhci: Secure Digital Host Controller Interface driver

sdhci: Copyright(c) Pierre Ossman

0 Kudos

763 Views
qwerty
Contributor I

A follow up with additional information.

When the FSL USB driver is left as originally written, with the "request_mem_region" for the USB registers in the MPC8306, I see the following output (the "QQQ" line is my additional debugging):

Freescale High-Speed USB SOC Device Controller driver (Apr 20, 2007)
QQQ: fsl_udc_probe(2619) about to request mem region: start = 0xE0023000; end = 0xE0023FFF; size = 0x00001000; driver name=fsl-usb2-udc
udc: request mem region for fsl-usb2-udc failed
fsl-usb2-udc: probe of fsl-usb2-udc.0 failed with error -16

When I fixed our USB_RESET signal, I was able to use it as a host port, even with the mem failure about:

[root@mpc8306-mio /root]# usb 1-1: new full speed USB device using fsl-ehci and address 2
usb 1-1: New USB device found, idVendor=0403, idProduct=6001
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: US232R
usb 1-1: Manufacturer: FTDI
usb 1-1: SerialNumber: FTF2SSGO
ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
usb 1-1: Detected FT232RL
usb 1-1: Number of endpoints 2
usb 1-1: Endpoint 1 MaxPacketSize 16384
usb 1-1: Endpoint 2 MaxPacketSize 16384
usb 1-1: Setting MaxPacketSize 64
usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0

But not as a device port:

[root@mpc8306-mio gadget]# insmod g_serial.ko 
insmod: cannot insert 'g_serial.ko': No such device

However, when I take out that request_mem_region() call, things look promising. host mode still works and I'm able to install the gadget modules.

[root@mpc8306-mio gadget]# insmod g_serial.ko
g_serial gadget: Gadget Serial v2.4
g_serial gadget: g_serial ready
fsl-usb2-udc: bind to driver g_serial

When I then connect this to the PC (Win 7 64 bit), after a long time, I get an "Unrecognized device" error. I tried g_file_storage and g_mass_storage as well -- all with the same results. I tried installing the serial driver inf file located under the kernel's Documentation/usb, but Windows always refused to use it. Either claiming it didn't support right-click install or that the driver it was using was newer or not compatible (manual update).

When I look up the "Hardware IDs" for this Unknown Device in Windows, they are unknown. Suggesting to me that the values from the driver aren't getting across to Windows, but I don't know enough about how this works to debug it.

0 Kudos