Skip to contentSkip to conversation

Add Freescale high-speed USB DR module device driver

PATCH New Li Yang 1 participant 1 message Jul 14, 2006 USB

lore
Share & tools
lore

Li Yang

author
#0 lore raw

PATCH 1/1 Add Freescale high-speed USB DR module device driver

Freescale high-speed USB SOC can be found on MPC834x and probably more in the future. Its DR(dual-role) module can work as a USB device. This patch adds its support for Linux USB Gadget.

---
This is a resubmission. The first version of the driver is posted on the lists in Aug, 2005. This version adds OTG support (needs separated OTG patch), works with latest gadget drivers and powerpc arch, and some minor fixes.

drivers/usb/gadget/Kconfig        |   21 drivers/usb/gadget/Makefile       |    1 drivers/usb/gadget/fsl_usb2_udc.c | 2529 +++++++++++++++++++++++++++++++++++++
drivers/usb/gadget/fsl_usb2_udc.h |  608 +++++++++
drivers/usb/gadget/gadget_chips.h |    8 5 files changed, 3167 insertions(+), 0 deletions(-)
drivers/usb/gadget/Kconfig +0 -0
index 363b2ad..598c200 100644
@@ -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
+ 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

drivers/usb/gadget/Makefile +0 -0
index 5a28e61..c283e5e 100644
@@ -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

drivers/usb/gadget/file_storage.c +0 -0
drivers/usb/gadget/fsl_usb2_udc.c new file +2421 -0

2,421 lines not on this page · raw message

drivers/usb/gadget/fsl_usb2_udc.h new file +596 -0

579 lines not on this page · raw message

drivers/usb/gadget/gadget_chips.h +0 -0
index aa80f09..d76f06c 100644
@@ -93,6 +93,12 @@ #else

The rest of this diff is not shown. View the raw message.

#define gadget_is_imx(g) 0
#endif

+#ifdef CONFIG_USB_GADGET_FSL_USB2
+#define gadget_is_fsl_usb2(g) !strncmp("fsl-usb2-dr-udc", (g)->name, 11)
+#else
+#define gadget_is_fsl_usb2(g) 0
+#endif
+
/* Mentor high speed function controller */
#ifdef CONFIG_USB_GADGET_MUSBHSFC
#define gadget_is_musbhsfc(g) !strcmp("musbhsfc_udc", (g)->name)
@@ -169,5 +175,7 @@ static inline int usb_gadget_controller_

		return 0x16;
	else if (gadget_is_mpc8272(gadget))
		return 0x17;
+	else if (gadget_is_fsl_usb2(gadget))
+		return 0x18;
	return -ENOENT;
}

Part of the diff is not shown here. View the raw message.