Hi all,<br><br>I am hoping someone can shed some light on the state of the USB support in the <br>2.6.28 kernel for USB OTG on the MPC8313E RDB. The configuration options are<br>a bit different than the ones from the provided LTIB kernel--- for obvious reasons---<br>
and I am trying to figure out how to get OTG working in this version of the kernel<br>on my board.<br><br>I have tried to configure the kernel as close as I could to the config for the LTIB<br>kernel (2.6.23). This is what it looks like right now:<br>
<br>Kernel config<br>Device drivers ---><br>[*] USB support ---> <br> --- USB support<br> <*> Support for Host-side USB<br> [*] USB verbose debug messages <br> [*] USB announce new devices<br>
<br> *** Miscellaneous USB options ***<br> [*] USB device filesystem<br> [*] USB device class-devices (DEPRECATED)<br> [*] USB Monitor<br><br> *** USB Host Controller Drivers ***<br clear="all">
<*> EHCI HCD (USB 2.0) support<br> -*- Root Hub Transaction Translators<br> [*] Support for Freescale on-chip EHCI USB controller<br> [*] EHCI support for PPC USB controller on OF platform bus<br>
<br> *** USB Device Class drivers ***<br> <*> USB Mass Storage support<br> [*] USB Mass Storage verbose debug<br><br> *** USB Miscelaneous drivers ***<br> <*> USB Gadget Support ---><br>
--- USB gadget support <br> (2) Maximum VBUS Power usage (2-500 mA)<br> USB Peripheral Controller (Freescale Highspeed USB DR Peripheral Controller) ---><br>
Freescale Highspeed USB DR Peripheral Controller<br> <*> USB Gadget Drivers (Ethernet Gadget (with CDC Ethernet support)) ---><br> Ethernet Gadget (with CDC Ethernet support)<br>
[*] RNDIS support <br><br>The device tree node seems to be pretty straight forward.<br>Device tree node:<br><br> usb@23000 {<br> compatible = "fsl-usb2-dr";<br> reg = <0x23000 0x1000>;<br>
#address-cells = <1>;<br> #size-cells = <0>;<br> interrupt-parent = <&ipic>;<br> interrupts = <38 0x8>;<br> phy_type = "ulpi";<br>
dr_mode = "otg";<br> sleep = <&pmc 0x00300000>;<br> };<br><br>Here is the output I get from the kernel when bringing up the USB:<br><br>usbmon: debugfs is not available<br>
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver<br>fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller<br>fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1<br>fsl-ehci fsl-ehci.0: irq 38, io base 0xe0023000<br>
fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00<br>usb usb1: configuration #1 chosen from 1 choice<br>hub 1-0:1.0: USB hub found<br>hub 1-0:1.0: 1 port detected<br>usb usb1: New USB device found, idVendor=1d6b, idProduct=0002<br>
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1<br>usb usb1: Product: Freescale On-Chip EHCI Host Controller<br>usb usb1: Manufacturer: Linux 2.6.28 ehci_hcd<br>usb usb1: SerialNumber: fsl-ehci.0<br>Initializing USB Mass Storage driver...<br>
usbcore: registered new interface driver usb-storage<br>USB Mass Storage support registered.<br>Freescale High-Speed USB SOC Device Controller driver (Apr 20, 2007)<br>udc: request mem region for fsl-usb2-udc failed<br>fsl-usb2-udc: probe of fsl-usb2-udc.0 failed with error -16<br>
<br>I tracked down the error to the fsl_udc_probe function in fsl_usb2_udc.c:<br><br>static int __init fsl_udc_probe(struct platform_device *pdev)<br>{<br> struct resource *res;<br> int ret = -ENODEV;<br> unsigned int i;<br>
u32 dccparams;<br><br> if (strcmp(pdev->name, driver_name)) {<br> VDBG("Wrong device");<br> return -ENODEV;<br> }<br><br> udc_controller = kzalloc(sizeof(struct fsl_udc), GFP_KERNEL);<br>
if (udc_controller == NULL) {<br> ERR("malloc udc failed\n");<br> return -ENOMEM;<br> }<br><br> spin_lock_init(&udc_controller->lock);<br> udc_controller->stopped = 1;<br><br>
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);<br> if (!res) {<br> ret = -ENXIO;<br> goto err_kfree;<br> }<br><br> if (!request_mem_region(res->start, res->end - res->start + 1,<br>
driver_name)) {<br> ERR("request mem region for %s failed\n", pdev->name);<br> ret = -EBUSY;<br> goto err_kfree;<br> }<br>...<br><br><br>Now, I can stick in a USB flash drive and mount it. So, I know the host side <br>
is working fine. The gadget driver doesn't appear to be able to load, <br>presumably because the host driver has already registered its memory<br>resources and will not release/share them. <br><br>What is the correct configuration to have real OTG working? Specifically, <br>
what is the configuration that will allow me to plug in a flash drive and <br>mount it, unmount it, plug in a host (laptop or such) and have it think it <br>is connected to a USB Ethernet gadget WITHOUT having to manually <br>
load and unload modules?<br><br>Thanks any help you can provide.<br><br>Mike<br>