> -----Original Message-----
> From: Kumar Gala [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 08, 2007 7:57 AM
> To: Li Yang-r58472
> Cc: [EMAIL PROTECTED]; Schmid Bruce-R62923;
> linux-usb-devel@lists.sourceforge.net
> Subject: Re: [PATCH 1/2] USB: add Freescale high-speed USB SOC device
controller
> driver
> 
> On Mon, 5 Feb 2007, Li Yang wrote:
> 
> > Freescale high-speed USB SOC can be found on some Freescale
processors
> > among different architectures.  It supports both host and device
functions.
> > This driver adds its device support for Linux USB Gadget layer.
> > It is tested for MPC834x DR module, but should work on other
platforms
> > with minor tweaks.  The driver passed USBCV 1.3 compliance tests.
> >
> > Signed-off-by: Li Yang <[EMAIL PROTECTED]>
> > Signed-off-by: Jiang Bo <[EMAIL PROTECTED]>
> > Signed-off-by: Bruce Schmid <[EMAIL PROTECTED]>
> >
> > ---
> > The latest udc driver after massive enhancement and cleanup.
> >
> > drivers/usb/gadget/Kconfig        |   21 +
> > drivers/usb/gadget/Makefile       |    1 +
> > drivers/usb/gadget/fsl_usb2_udc.c | 2489
+++++++++++++++++++++++++++++++++++++
> > drivers/usb/gadget/fsl_usb2_udc.h |  577 +++++++++
> > drivers/usb/gadget/gadget_chips.h |    8 +
> > 5 files changed, 3096 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
> > index 4097a86..601e8d1 100644
> > --- a/drivers/usb/gadget/Kconfig
> > +++ b/drivers/usb/gadget/Kconfig
> > @@ -68,6 +68,27 @@ choice
> >        Many controller drivers are platform-specific; these
> >        often need board-specific hooks.
> >
> > +config USB_GADGET_FSL_USB2
> > +   boolean "Freescale MPC834x DR"
> > +   depends on MPC834x
> 
> The same controller exists on MPC831x, this should be made more
generic.
> We have the host support as MPC83xx.  This is a general comment for
the
> rest of the code.

I have only tested it on 8349, but Bruce and I are working to expend it
to all Freescale Highspeed SOCs including ARM and MCU.  More will be
added once tested.

> 
> > +   select USB_GADGET_DUALSPEED
> > +   help
> > +      Some of Freescale PowerPC processors have a High Speed
> > +      Dual-Role(DR) USB controller, which support device mode
> > +      with 5 programmable endpoints. This driver supports the
> > +      controller in the MPC834x, and should work with DR module
> > +      in other Freescale processors too, given minor tweaks.
> > +
> > +      Say "y" to link the driver statically, or "m" to build a
> > +      dynamically linked module called "fsl_usb2_udc" and force
> > +      all gadget drivers to also be dynamically linked.
> > +
> > +config USB_FSL_USB2
> > +   tristate
> > +   depends on USB_GADGET_FSL_USB2
> > +   default USB_GADGET
> > +   select USB_GADGET_SELECTED
> > +
> > config USB_GADGET_NET2280
> >     boolean "NetChip 228x"
> >     depends on PCI
> > diff --git a/drivers/usb/gadget/Makefile
b/drivers/usb/gadget/Makefile
> > index e71e086..5db1939 100644
> > --- a/drivers/usb/gadget/Makefile
> > +++ b/drivers/usb/gadget/Makefile
> > @@ -8,6 +8,7 @@ obj-$(CONFIG_USB_GOKU)              += goku_udc.o
> > obj-$(CONFIG_USB_OMAP)              += omap_udc.o
> > obj-$(CONFIG_USB_LH7A40X)   += lh7a40x_udc.o
> > obj-$(CONFIG_USB_AT91)              += at91_udc.o
> > +obj-$(CONFIG_USB_FSL_USB2) += fsl_usb2_udc.o
> >
> > #
> > # USB gadget drivers
> > diff --git a/drivers/usb/gadget/fsl_usb2_udc.c
> b/drivers/usb/gadget/fsl_usb2_udc.c
> > new file mode 100644
> > index 0000000..db3fabc
> > --- /dev/null
> > +++ b/drivers/usb/gadget/fsl_usb2_udc.c
> > @@ -0,0 +1,2489 @@
> > +/*
> > + * Copyright (C) 2004-2007 Freescale Semicondutor, Inc. All rights
reserved.
> > + *
> > + * Author: Li Yang <[EMAIL PROTECTED]>
> > + *         Jiang Bo <[EMAIL PROTECTED]>
> > + *
> > + * Description:
> > + * Freescale high-speed USB SOC DR module device controller driver.
> > + * This SOC can be found on MPC8349E cpu.  The driver is previously
named
> > + * as mpc_udc.  Based on bare board code from Dave Liu and Shlomi
Gridish.
> > + *
> > + * Note: The driver will not work with old gadget drivers, as the
API
> > + * parameter endian has changed.
> > + *
> > + * Changelog:
> > + * Aug 1, 2005
> > + * - initial release
> > + * Jul 13, 2006 Li Yang
> > + * - adopted to powerpc arch and gadget drivers in latest kernel
> > + * - add otg support, and minor style fixes
> > + * Feb 5, 2007 Li Yang
> > + * - massive enhancement and cleanup
> > + * - verified through USBCV tests
> > + *
> > + * This program is free software; you can redistribute  it and/or
modify it
> > + * under  the terms of  the GNU General  Public License as
published by the
> > + * Free Software Foundation;  either version 2 of the  License, or
(at your
> > + * option) any later version.
> > + */
> > +
> > +#undef DEBUG
> > +#undef VERBOSE
> > +
> > +#include <linux/module.h>
> > +#include <linux/kernel.h>
> > +#include <linux/ioport.h>
> > +#include <linux/types.h>
> > +#include <linux/errno.h>
> > +#include <linux/delay.h>
> > +#include <linux/sched.h>
> > +#include <linux/slab.h>
> > +#include <linux/init.h>
> > +#include <linux/timer.h>
> > +#include <linux/list.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/proc_fs.h>
> > +#include <linux/mm.h>
> > +#include <linux/moduleparam.h>
> > +#include <linux/device.h>
> > +#include <linux/usb_ch9.h>
> > +#include <linux/usb_gadget.h>
> > +#include <linux/usb/otg.h>
> > +#include <linux/dma-mapping.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/fsl_devices.h>
> > +#include <linux/dmapool.h>
> > +
> > +#include <asm/byteorder.h>
> > +#include <asm/io.h>
> > +#include <asm/irq.h>
> > +#include <asm/system.h>
> > +#include <asm/unaligned.h>
> > +#include <asm/dma.h>
> > +#include <asm/cacheflush.h>
> > +
> > +#include "fsl_usb2_udc.h"
> > +
> > +#define    DRIVER_DESC     "Freescale High-Speed USB SOC Device
Controller
> driver"
> > +#define    DRIVER_AUTHOR   "Li Yang/Jiang Bo"
> > +#define    DRIVER_VERSION  "Feb 5, 2007"
> > +
> > +#define    DMA_ADDR_INVALID        (~(dma_addr_t)0)
> > +
> > +static const char driver_name[] = "fsl-usb2-udc";
> > +static const char driver_desc[] = DRIVER_DESC;
> > +
> > +volatile static struct usb_dr_device *dr_regs = NULL;
> > +volatile static struct usb_sys_interface *usb_sys_regs = NULL;
> > +
> > +/* it is initialized in probe()  */
> > +static struct fsl_udc *udc_controller = NULL;
> > +
> > +/*ep name should comply to the convention of ep_match()*/
> > +static const char *const ep_name[] = {
> > +   "ep0-control", NULL,    /* everyone has ep0 */
> > +   /* 5 IN eps and 5 OUT eps */
> > +   "ep1out",
> > +   "ep1in",
> > +   "ep2out",
> > +   "ep2in",
> > +   "ep3out",
> > +   "ep3in",
> > +   "ep4out",
> > +   "ep4in",
> > +   "ep5out",
> > +   "ep5in"
> > +};
> > +static struct usb_endpoint_descriptor
> > +fsl_ep0_desc = {
> > +   .bLength =              USB_DT_ENDPOINT_SIZE,
> > +   .bDescriptorType =      USB_DT_ENDPOINT,
> > +   .bEndpointAddress =     0,
> > +   .bmAttributes =         USB_ENDPOINT_XFER_CONTROL,
> > +   .wMaxPacketSize =       USB_MAX_CTRL_PAYLOAD,
> > +};
> > +
> > +static int fsl_udc_suspend(struct platform_device *pdev,
pm_message_t state);
> > +static int fsl_udc_resume(struct platform_device *pdev);
> > +static void fsl_ep_fifo_flush(struct usb_ep *_ep);
> > +
> > +#ifdef CONFIG_PPC32
> 
> Any reason we need to protect these with CONFIG_PPC32?
> 
> > +#undef     NO_SNOOPING
> > +#define fsl_readl(addr)            in_le32(addr)
> > +#define fsl_writel(addr, val32) out_le32(val32, addr)
> > +#endif

For example, MX31 doesn't have the SNOOPING feature and will use other
I/O accessors.

- Leo

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to