linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* MPC8313E-RDB and USB OTG
@ 2009-02-25 19:51 Michael Bergandi
  2009-02-26  6:43 ` Li Yang
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Bergandi @ 2009-02-25 19:51 UTC (permalink / raw)
  To: linuxppc-dev@ozlabs.org

[-- Attachment #1: Type: text/plain, Size: 4918 bytes --]

Hi all,

I am hoping someone can shed some light on the state of the USB support in
the
2.6.28 kernel for USB OTG on the MPC8313E RDB. The configuration options are
a bit different than the ones from the provided LTIB kernel--- for obvious
reasons---
and I am trying to figure out how to get OTG working in this version of the
kernel
on my board.

I have tried to configure the kernel as close as I could to the config for
the LTIB
kernel (2.6.23). This is what it looks like right now:

Kernel config
Device drivers --->
[*]   USB support --->
        --- USB support
        <*>   Support for Host-side USB
        [*]     USB verbose debug messages
        [*]     USB announce new devices

                 *** Miscellaneous USB options ***
        [*]     USB device filesystem
        [*]     USB device class-devices (DEPRECATED)
        [*]     USB Monitor

                    *** USB Host Controller Drivers ***
        <*>     EHCI HCD (USB 2.0) support
        -*-       Root Hub Transaction Translators
        [*]       Support for Freescale on-chip EHCI USB controller
        [*]       EHCI support for PPC USB controller on OF platform bus

                  *** USB Device Class drivers ***
        <*>   USB Mass Storage support
         [*]     USB Mass Storage verbose debug

                  *** USB Miscelaneous drivers ***
        <*>   USB Gadget Support  --->
                  --- USB gadget support
                  (2)   Maximum VBUS Power usage (2-500 mA)
                         USB Peripheral Controller (Freescale Highspeed USB
DR Peripheral Controller)  --->
                                 Freescale Highspeed USB DR Peripheral
Controller
                  <*>   USB Gadget Drivers (Ethernet Gadget (with CDC
Ethernet support))  --->
                                 Ethernet Gadget (with CDC Ethernet support)
                   [*]       RNDIS support

The device tree node seems to be pretty straight forward.
Device tree node:

        usb@23000 {
            compatible = "fsl-usb2-dr";
            reg = <0x23000 0x1000>;
            #address-cells = <1>;
            #size-cells = <0>;
            interrupt-parent = <&ipic>;
            interrupts = <38 0x8>;
            phy_type = "ulpi";
            dr_mode = "otg";
            sleep = <&pmc 0x00300000>;
        };

Here is the output I get from the kernel when bringing up the USB:

usbmon: debugfs is not available
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
fsl-ehci fsl-ehci.0: irq 38, io base 0xe0023000
fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: Freescale On-Chip EHCI Host Controller
usb usb1: Manufacturer: Linux 2.6.28 ehci_hcd
usb usb1: SerialNumber: fsl-ehci.0
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
Freescale High-Speed USB SOC Device Controller driver (Apr 20, 2007)
udc: request mem region for fsl-usb2-udc failed
fsl-usb2-udc: probe of fsl-usb2-udc.0 failed with error -16

I tracked down the error to the fsl_udc_probe function in fsl_usb2_udc.c:

static int __init fsl_udc_probe(struct platform_device *pdev)
{
    struct resource *res;
    int ret = -ENODEV;
    unsigned int i;
    u32 dccparams;

    if (strcmp(pdev->name, driver_name)) {
        VDBG("Wrong device");
        return -ENODEV;
    }

    udc_controller = kzalloc(sizeof(struct fsl_udc), GFP_KERNEL);
    if (udc_controller == NULL) {
        ERR("malloc udc failed\n");
        return -ENOMEM;
    }

    spin_lock_init(&udc_controller->lock);
    udc_controller->stopped = 1;

    res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
    if (!res) {
        ret = -ENXIO;
        goto err_kfree;
    }

    if (!request_mem_region(res->start, res->end - res->start + 1,
                driver_name)) {
        ERR("request mem region for %s failed\n", pdev->name);
        ret = -EBUSY;
        goto err_kfree;
    }
...


Now, I can stick in a USB flash drive and mount it. So, I know the host side

is working fine. The gadget driver doesn't appear to be able to load,
presumably because the host driver has already registered its memory
resources and will not release/share them.

What is the correct configuration to have real OTG working? Specifically,
what is the configuration that will allow me to plug in a flash drive and
mount it, unmount it, plug in a host (laptop or such) and have it think it
is connected to a USB Ethernet gadget WITHOUT having to manually
load and unload modules?

Thanks any help you can provide.

Mike

[-- Attachment #2: Type: text/html, Size: 5586 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MPC8313E-RDB and USB OTG
  2009-02-25 19:51 MPC8313E-RDB and USB OTG Michael Bergandi
@ 2009-02-26  6:43 ` Li Yang
  2009-02-26 13:22   ` Michael Bergandi
  0 siblings, 1 reply; 4+ messages in thread
From: Li Yang @ 2009-02-26  6:43 UTC (permalink / raw)
  To: Michael Bergandi; +Cc: linuxppc-dev@ozlabs.org

On Thu, Feb 26, 2009 at 3:51 AM, Michael Bergandi <mbergandi@gmail.com> wrote:
> Hi all,
>
> I am hoping someone can shed some light on the state of the USB support in
> the
> 2.6.28 kernel for USB OTG on the MPC8313E RDB. The configuration options are
> a bit different than the ones from the provided LTIB kernel--- for obvious
> reasons---
> and I am trying to figure out how to get OTG working in this version of the
> kernel
> on my board.

USB OTG support for Freescale USB has not been included in mainline.
So you need to bring the OTG code up-to-date, or stay with the LTIB
kernel.

- Leo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MPC8313E-RDB and USB OTG
  2009-02-26  6:43 ` Li Yang
@ 2009-02-26 13:22   ` Michael Bergandi
  2009-02-27  9:46     ` Li Yang
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Bergandi @ 2009-02-26 13:22 UTC (permalink / raw)
  To: Li Yang; +Cc: linuxppc-dev@ozlabs.org

[-- Attachment #1: Type: text/plain, Size: 763 bytes --]

Leo, sorry for sending this twice. Forgot to cc the list.

> I am hoping someone can shed some light on the state of the USB support in
> > the
> > 2.6.28 kernel for USB OTG on the MPC8313E RDB. The configuration options
> are
> > a bit different than the ones from the provided LTIB kernel--- for
> obvious
> > reasons---
> > and I am trying to figure out how to get OTG working in this version of
> the
> > kernel
> > on my board.
>
> USB OTG support for Freescale USB has not been included in mainline.
> So you need to bring the OTG code up-to-date, or stay with the LTIB
> kernel.
>
> - Leo
>

Thanks Leo. I will look into getting the OTG code included.

Do you have a general outline of what would need to be done to it?

Any potential trouble spots?

Mike

[-- Attachment #2: Type: text/html, Size: 1059 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MPC8313E-RDB and USB OTG
  2009-02-26 13:22   ` Michael Bergandi
@ 2009-02-27  9:46     ` Li Yang
  0 siblings, 0 replies; 4+ messages in thread
From: Li Yang @ 2009-02-27  9:46 UTC (permalink / raw)
  To: Michael Bergandi; +Cc: linuxppc-dev@ozlabs.org

On Thu, Feb 26, 2009 at 9:22 PM, Michael Bergandi <mbergandi@gmail.com> wrote:
> Leo, sorry for sending this twice. Forgot to cc the list.
>
>> > I am hoping someone can shed some light on the state of the USB support
>> > in
>> > the
>> > 2.6.28 kernel for USB OTG on the MPC8313E RDB. The configuration options
>> > are
>> > a bit different than the ones from the provided LTIB kernel--- for
>> > obvious
>> > reasons---
>> > and I am trying to figure out how to get OTG working in this version of
>> > the
>> > kernel
>> > on my board.
>>
>> USB OTG support for Freescale USB has not been included in mainline.
>> So you need to bring the OTG code up-to-date, or stay with the LTIB
>> kernel.
>>
>> - Leo
>
> Thanks Leo. I will look into getting the OTG code included.
>
> Do you have a general outline of what would need to be done to it?
>
> Any potential trouble spots?

The current code requires OTG driver loaded before host and udc
driver, otherwise won't work correctly.  It's better to make them work
correctly no matter what loading sequence.

- Leo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-27  9:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-25 19:51 MPC8313E-RDB and USB OTG Michael Bergandi
2009-02-26  6:43 ` Li Yang
2009-02-26 13:22   ` Michael Bergandi
2009-02-27  9:46     ` Li Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).