Re: [PATCH/RFC] gadget: extend fsl_usb2_udc.c to support i.MX31

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 12, 2009 at 1:40 AM, Guennadi Liakhovetski <lg@xxxxxxx> wrote:
> MPC8313 / MPC8349 PPC SoCs and i.MX31 ARM SoCs use the same USB device
> core, extend the driver to support i.MX31. We just have to disable using

Thanks a lot to make it work.  Less change than what I expected.

> usb_sys_interface and add clock management.

Is the clock manipulating code board specific or chip specific?  IMO,
it's better to be placed under platform domain like we did for
PowerPC.  That will make the driver cleaner as a common code for all
ARC USB controller.

>
> Signed-off-by: Guennadi Liakhovetski <lg@xxxxxxx>
> ---
>
> Ok, it does indeed seem to work - tested with g-ether and g-file-storage,
> but my gadgetfs PTP driver (yes, it should be released as open source,
> stay tunes) doesn't work with it. Namely, I'm using pieces from the usb.c
> gadgetfs example, and it generates a random 64-character (128 UCS-2LE byte
> long) string for use as a serial number. And it is this string that cannot
> be transfered. 32-character doesn't work either, only if I reduce it to
> 16-character (I guess, data+header should fit in 64-byte packet?), then it
> works. With the Freescale arcotg driver 128-character works too. Any idea
> what the problem is?
>
> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
> index 93dbd70..6bcb64c 100644
> --- a/drivers/usb/gadget/Kconfig
> +++ b/drivers/usb/gadget/Kconfig
> @@ -156,7 +156,7 @@ config USB_ATMEL_USBA
>
>  config USB_GADGET_FSL_USB2
>        boolean "Freescale Highspeed USB DR Peripheral Controller"
> -       depends on FSL_SOC
> +       depends on FSL_SOC || ARCH_MXC
>        select USB_GADGET_DUALSPEED
>        help
>           Some of Freescale PowerPC processors have a High Speed
> diff --git a/drivers/usb/gadget/fsl_usb2_udc.c b/drivers/usb/gadget/fsl_usb2_udc.c
> index f3c6703..f6b95a1 100644
> --- a/drivers/usb/gadget/fsl_usb2_udc.c
> +++ b/drivers/usb/gadget/fsl_usb2_udc.c
> @@ -38,6 +38,8 @@
>  #include <linux/platform_device.h>
>  #include <linux/fsl_devices.h>
>  #include <linux/dmapool.h>
> +#include <linux/delay.h>
> +#include <linux/clk.h>
>
>  #include <asm/byteorder.h>
>  #include <asm/io.h>
> @@ -57,7 +59,9 @@ static const char driver_name[] = "fsl-usb2-udc";
>  static const char driver_desc[] = DRIVER_DESC;
>
>  static struct usb_dr_device *dr_regs;
> +#ifndef CONFIG_ARCH_MXC
>  static struct usb_sys_interface *usb_sys_regs;
> +#endif
>
>  /* it is initialized in probe()  */
>  static struct fsl_udc *udc_controller = NULL;
> @@ -237,9 +241,11 @@ static int dr_controller_setup(struct fsl_udc *udc)
>        fsl_writel(portctrl, &dr_regs->portsc1);
>
>        /* Config control enable i/o output, cpu endian register */
> +#ifndef CONFIG_ARCH_MXC
>        ctrl = __raw_readl(&usb_sys_regs->control);
>        ctrl |= USB_CTRL_IOENB;
>        __raw_writel(ctrl, &usb_sys_regs->control);
> +#endif
>
>  #if defined(CONFIG_PPC32) && !defined(CONFIG_NOT_COHERENT_CACHE)
>        /* Turn on cache snooping hardware, since some PowerPC platforms
> @@ -2038,6 +2044,7 @@ static int fsl_proc_read(char *page, char **start, off_t off, int count,
>        size -= t;
>        next += t;
>
> +#ifndef CONFIG_ARCH_MXC

I believe this is not needed, as we already have if defined(CONFIG_PPC32)

>        tmp_reg = usb_sys_regs->snoop1;
>        t = scnprintf(next, size, "Snoop1 Reg : = [0x%x]\n\n", tmp_reg);
>        size -= t;
> @@ -2048,6 +2055,7 @@ static int fsl_proc_read(char *page, char **start, off_t off, int count,
>                        tmp_reg);
>        size -= t;
>        next += t;
> +#endif
>
{snip}

- Leo
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux