usb: add Freescale QE/CPM USB peripheral controller driver
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
@@ -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
@@ -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
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.
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.
Signed-off-by Xie Xiaobo <[email protected]>Signed-off-by Li Yang <[email protected]>
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 <><
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.
Signed-off-by Xie Xiaobo <[email protected]>Signed-off-by Li Yang <[email protected]>
Quoted 8 lines
Acked-by Arnd Bergmann <[email protected]>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