Skip to contentSkip to conversation

usb: add Freescale QE/CPM USB peripheral controller driver

PATCH In review Li Yang 2 participants 3 messages Sep 2, 2008 – Sep 3, 2008 USB

lore
Share & tools
lore

Li Yang

author
#0 lore raw

PATCH v3 1/1 usb: add Freescale QE/CPM USB peripheral controller driver

Some of Freescale SoC chips have a QE or CPM co-processor which supports full speed USB. The driver adds device mode support of both QE and CPM USB controller to Linux USB gadget. The driver is tested with MPC8360 and MPC8272, and should work with other models having QE/CPM given minor tweaks.

---
Thanks to Arnd Bergmann, Anton and Scott for the review and comments. This version removes proprietary VDBG, supports both CPM/QE without re-build, updates Kconfig, updates device node reading code, fixes spinlock problem found by Anton.

 drivers/usb/gadget/Kconfig        |   19 +
 drivers/usb/gadget/Makefile       |    1 +
 drivers/usb/gadget/fsl_qe_udc.c   | 2723 +++++++++++++++++++++++++++++++++++++
 drivers/usb/gadget/fsl_qe_udc.h   |  436 ++++++
 drivers/usb/gadget/gadget_chips.h |    9 +
 5 files changed, 3188 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/fsl_qe_udc.c
 create mode 100644 drivers/usb/gadget/fsl_qe_udc.h
drivers/usb/gadget/Kconfig +19 -0
index acc95b2..5d8df12 100644
@@ -150,6 +150,25 @@ config USB_FSL_USB2
 	default USB_GADGET
 	select USB_GADGET_SELECTED
 
+config USB_GADGET_FSL_QE
+	boolean "Freescale QE/CPM USB Device Controller"
+	depends on FSL_SOC && (QUICC_ENGINE || CPM)
+	help
+	   Some of Freescale PowerPC processors have a Full Speed
+	   QE/CPM2 USB controller, which support device mode with 4
+	   programmable endpoints. This driver supports the
+	   controller in the MPC8360 and MPC8272, and should work with
+	   controllers having QE or CPM2, given minor tweaks.
+
+	   Set CONFIG_USB_GADGET to "m" to build this driver as a
+	   dynmically linked module called "fsl_qe_udc".
+
+config USB_FSL_QE
+	tristate
+	depends on USB_GADGET_FSL_QE
+	default USB_GADGET
+	select USB_GADGET_SELECTED
+
 config USB_GADGET_NET2280
 	boolean "NetChip 228x"
 	depends on PCI
drivers/usb/gadget/Makefile +1 -0
index fcb5cb9..4871554 100644
@@ -18,6 +18,7 @@ obj-$(CONFIG_USB_AT91)		+= at91_udc.o
 obj-$(CONFIG_USB_ATMEL_USBA)	+= atmel_usba_udc.o
 obj-$(CONFIG_USB_FSL_USB2)	+= fsl_usb2_udc.o
 obj-$(CONFIG_USB_M66592)	+= m66592-udc.o
+obj-$(CONFIG_USB_FSL_QE)	+= fsl_qe_udc.o
 
 #
 # USB gadget drivers
drivers/usb/gadget/fsl_qe_udc.c new file +2723 -0

2,723 lines not on this page · raw message

drivers/usb/gadget/fsl_qe_udc.h new file +436 -0

245 lines not on this page · raw message

drivers/usb/gadget/gadget_chips.h +9 -0
index 17d9905..4e3107d 100644

Lines of this file are not shown. View the raw message.

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

Signature · 1 line
1.5.5.1.248.g4b17

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

Acked-by on v3 1/1
#1 lore raw
Quoted 8 lines · Li Yang

Some of Freescale SoC chips have a QE or CPM co-processor which supports full speed USB. The driver adds device mode support of both QE and CPM USB controller to Linux USB gadget. The driver is tested with MPC8360 and MPC8272, and should work with other models having QE/CPM given minor tweaks.

All my previous review comments have been addressed.

drivers/usb/gadget/fsl_qe_udc.c line 2490

Quoted 1 line
drivers/usb/gadget/fsl_qe_udc.c new file +1 -0
+	udc_controller->soc_type = (unsigned long)np->data;

I'm not sure about this line, shouldn't that be

	udc_controller->soc_type = (unsigned long)match->data; ?

	Arnd <><
author
#2 lore raw
Quoted 10 lines · Arnd Bergmann
Quoted 8 lines · Li Yang

Some of Freescale SoC chips have a QE or CPM co-processor which supports full speed USB. The driver adds device mode support of both QE and CPM USB controller to Linux USB gadget. The driver is tested with MPC8360 and MPC8272, and should work with other models having QE/CPM given minor tweaks.

Quoted 8 lines

All my previous review comments have been addressed.

Quoted 1 line

+ udc_controller->soc_type = (unsigned long)np->data;

I'm not sure about this line, shouldn't that be

       udc_controller->soc_type = (unsigned long)match->data; ?

Oops. You are right.

- Leo