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 ---&gt;<br>[*]   USB support ---&gt;    <br>        --- USB support<br>        &lt;*&gt;   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">
        &lt;*&gt;     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>        &lt;*&gt;   USB Mass Storage support<br>         [*]     USB Mass Storage verbose debug<br><br>                  *** USB Miscelaneous drivers ***<br>        &lt;*&gt;   USB Gadget Support  ---&gt;<br>
                  --- USB gadget support        <br>                  (2)   Maximum VBUS Power usage (2-500 mA)<br>                         USB Peripheral Controller (Freescale Highspeed USB DR Peripheral Controller)  ---&gt;<br>
                                 Freescale Highspeed USB DR Peripheral Controller<br>                  &lt;*&gt;   USB Gadget Drivers (Ethernet Gadget (with CDC Ethernet support))  ---&gt;<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 = &quot;fsl-usb2-dr&quot;;<br>            reg = &lt;0x23000 0x1000&gt;;<br>
            #address-cells = &lt;1&gt;;<br>            #size-cells = &lt;0&gt;;<br>            interrupt-parent = &lt;&amp;ipic&gt;;<br>            interrupts = &lt;38 0x8&gt;;<br>            phy_type = &quot;ulpi&quot;;<br>
            dr_mode = &quot;otg&quot;;<br>            sleep = &lt;&amp;pmc 0x00300000&gt;;<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 &#39;Enhanced&#39; 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-&gt;name, driver_name)) {<br>        VDBG(&quot;Wrong device&quot;);<br>        return -ENODEV;<br>    }<br><br>    udc_controller = kzalloc(sizeof(struct fsl_udc), GFP_KERNEL);<br>
    if (udc_controller == NULL) {<br>        ERR(&quot;malloc udc failed\n&quot;);<br>        return -ENOMEM;<br>    }<br><br>    spin_lock_init(&amp;udc_controller-&gt;lock);<br>    udc_controller-&gt;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-&gt;start, res-&gt;end - res-&gt;start + 1,<br>
                driver_name)) {<br>        ERR(&quot;request mem region for %s failed\n&quot;, pdev-&gt;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&#39;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>