usb: Add support for Cadence USB controller driver
Subsystems (5)
cover usb: Add support for Cadence USB controller driver
This series adds support for Cadence USB Host and Gadget controller drivers. This is borrowed directly from Linux kernel v5.4-rc1. Driver as such supports both 3.0 and 2.0 speeds. But USB 3.0 requires a PHY driver which will be added in a separate follow series
Patch 7 adds TI wrapper driver for Cadence USB controller.
Both host and device mode has been tested on TI's J721e SoC. DFU, UMS and fastboot gadgets have been tested.
Complete series (+ DT nodes required for J721e) can be found here:
https://github.com/r-vignesh/u-boot.git branch: usb
Regards
Vignesh
Sherry Sun (1):
usb: udc: Introduce ->udc_set_speed() method
Vignesh Raghavendra (7):
list: import list_first_entry_or_null()
bitmaps: import for_each_set_bit() macro
usb: gadget: Add match_ep() op to usb_gadget_ops
usb: Add Cadence USB3 host and gadget driver
usb: cdns3: gadget: Implement udc_set_speed() callback
usb: cdns3: Add TI wrapper driver for CDNS USB3 controller
usb: gadget: Add gadget_is_cdns3() macro
Makefile | 1 + drivers/usb/Kconfig | 2 + drivers/usb/cdns3/Kconfig | 58 + drivers/usb/cdns3/Makefile | 11 + drivers/usb/cdns3/cdns3-ti.c | 193 ++ drivers/usb/cdns3/core.c | 498 ++++++ drivers/usb/cdns3/core.h | 108 ++ drivers/usb/cdns3/debug.h | 162 ++ drivers/usb/cdns3/drd.c | 301 ++++ drivers/usb/cdns3/drd.h | 166 ++ drivers/usb/cdns3/ep0.c | 910 ++++++++++ drivers/usb/cdns3/gadget-export.h | 28 + drivers/usb/cdns3/gadget.c | 2760 +++++++++++++++++++++++++++++ drivers/usb/cdns3/gadget.h | 1338 ++++++++++++++ drivers/usb/cdns3/host-export.h | 28 + drivers/usb/cdns3/host.c | 55 + drivers/usb/cdns3/trace.c | 11 + drivers/usb/cdns3/trace.h | 26 + drivers/usb/gadget/epautoconf.c | 3 + drivers/usb/gadget/gadget_chips.h | 8 + drivers/usb/gadget/udc/udc-core.c | 23 + include/linux/bitmap.h | 61 + include/linux/list.h | 14 + include/linux/usb/gadget.h | 25 + scripts/Makefile.spl | 1 + 25 files changed, 6791 insertions(+) create mode 100644 drivers/usb/cdns3/Kconfig create mode 100644 drivers/usb/cdns3/Makefile create mode 100644 drivers/usb/cdns3/cdns3-ti.c create mode 100644 drivers/usb/cdns3/core.c create mode 100644 drivers/usb/cdns3/core.h create mode 100644 drivers/usb/cdns3/debug.h create mode 100644 drivers/usb/cdns3/drd.c create mode 100644 drivers/usb/cdns3/drd.h create mode 100644 drivers/usb/cdns3/ep0.c create mode 100644 drivers/usb/cdns3/gadget-export.h create mode 100644 drivers/usb/cdns3/gadget.c create mode 100644 drivers/usb/cdns3/gadget.h create mode 100644 drivers/usb/cdns3/host-export.h create mode 100644 drivers/usb/cdns3/host.c create mode 100644 drivers/usb/cdns3/trace.c create mode 100644 drivers/usb/cdns3/trace.h
Signature · 1 line
2.23.0
PATCH 1/8 list: import list_first_entry_or_null()
Import list_first_entry_or_null() macro from Linux that would be used by Cadence USB driver
--- include/linux/list.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
include/linux/list.h +14 -0
@@ -348,6 +348,20 @@ static inline void list_splice_tail_init(struct list_head *list,#define list_last_entry (ptr, type, member) \ list_entry((ptr)->prev, type, member) +/** +* list_first_entry_or_null - get the first element from a list +* @ptr: the list head to take the element from. +* @type: the type of the struct this is embedded in. +* @member: the name of the list_head within the struct. +* +* Note that if the list is empty, it returns NULL. +*/ +#define list_first_entry_or_null (ptr, type, member) ({ \ + struct list_head *head__ = (ptr); \ + struct list_head *pos__ = READ_ONCE(head__->next); \ + pos__ != head__ ? list_entry(pos__, type, member) : NULL; \ +}) +/** * list_for_each - iterate over a list * @pos: the &struct list_head to use as a loop cursor.
Signature · 1 line
2.23.0
PATCH 2/8 bitmaps: import for_each_set_bit() macro
In reply to Vignesh RaghavendraImport for_each_set_bit() and associated macros and functions from Linux. This is useful in parsing interrupt registers and take action on each bit that is set.
--- include/linux/bitmap.h | 61 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+)
include/linux/bitmap.h +61 -0
@@ -20,4 +20,65 @@ static inline void bitmap_zero(unsigned long *dst, int nbits) } } +static inline unsigned long +find_next_bit (const unsigned long *addr,unsigned long size, +unsigned long offset) +{ +const unsigned long *p = addr +BIT_WORD (offset); +unsigned long result = offset & ~(BITS_PER_LONG -1 ); +unsigned long tmp; + +if (offset >= size) +return size; + size -= result; + offset %=BITS_PER_LONG ; +if (offset) { + tmp = *(p++); + tmp &= (~0UL << offset); +if (size <BITS_PER_LONG ) + goto found_first; +if (tmp) + goto found_middle; + size -=BITS_PER_LONG ; + result +=BITS_PER_LONG ; + } +while (size & ~(BITS_PER_LONG -1 )) { + tmp = *(p++); +if ((tmp)) + goto found_middle; + result +=BITS_PER_LONG ; + size -=BITS_PER_LONG ; + } +if (!size) +return result; + tmp = *p; + +found_first: + tmp &= (~0UL >> (BITS_PER_LONG - size)); +if (tmp ==0UL )/* Are any bits set? */ +return result + size;/* Nope. */ +found_middle: +return result +__ffs (tmp); +} + +/* +* Find the first set bit in a memory region. +*/ +static inline unsigned long find_first_bit (const unsigned long *addr,unsigned long size) +{ +unsigned long idx; + +for (idx =0 ; idx *BITS_PER_LONG < size; idx++) { +if (addr[idx]) +return min (idx *BITS_PER_LONG +__ffs (addr[idx]), size); + } + +return size; +} + +#define for_each_set_bit (bit, addr, size) \ + for ((bit) = find_first_bit((addr), (size)); \ + (bit) < (size); \ + (bit) = find_next_bit((addr), (size), (bit) + 1)) +#endif /* __LINUX_BITMAP_H */
Signature · 1 line
2.23.0
PATCH 3/8 usb: gadget: Add match_ep() op to usb_gadget_ops
In reply to Vignesh RaghavendraAdd match_ep() op to usb_gadget_ops similar to Linux kernel which is useful in finding a suitable ep match for the function driver. This will avoid adding more gadget_is_xxx() handling code to usb_ep_autoconfig().
Also sync usb_ep_caps struct thats is usually used in the match_ep() callback by the gadget controller driver
--- drivers/usb/gadget/epautoconf.c | 3 +++ include/linux/usb/gadget.h | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+)
drivers/usb/gadget/epautoconf.c +3 -0
@@ -282,6 +282,9 @@ struct usb_ep *usb_ep_autoconfig(return ep; } +if (gadget->ops->match_ep) + ep = gadget->ops->match_ep (gadget, desc,NULL ); +/* Second, look at endpoints until an unclaimed one looks usable */ list_for_each_entry (ep, &gadget->ep_list, ep_list) {if (ep_matches (gadget, ep, desc))
include/linux/usb/gadget.h +23 -0
@@ -129,11 +129,30 @@ struct usb_ep_ops {void (*fifo_flush) (struct usb_ep *ep); }; +/** +* struct usb_ep_caps - endpoint capabilities description +* @type_control:Endpoint supports control type (reserved for ep0). +* @type_iso:Endpoint supports isochronous transfers. +* @type_bulk:Endpoint supports bulk transfers. +* @type_int:Endpoint supports interrupt transfers. +* @dir_in:Endpoint supports IN direction. +* @dir_out:Endpoint supports OUT direction. +*/ +struct usb_ep_caps { +unsigned type_control:1 ; +unsigned type_iso:1 ; +unsigned type_bulk:1 ; +unsigned type_int:1 ; +unsigned dir_in:1 ; +unsigned dir_out:1 ; +}; +/** * struct usb_ep - device side representation of USB endpoint * @name:identifier for the endpoint, such as "ep-a" or "ep9in-bulk" * @ops: Function pointers used to access hardware-specific operations. * @ep_list:the gadget's ep_list holds all of its endpoints +* @caps:The structure describing types and directions supported by endoint. * @maxpacket:The maximum packet size used on this endpoint. The initial * value can sometimes be reduced (hardware allowing), according to * the endpoint descriptor used to configure the endpoint.
@@ -159,6 +178,7 @@ struct usb_ep {const char *name;const struct usb_ep_ops *ops;struct list_head ep_list; +struct usb_ep_caps caps; unsigned maxpacket:16; unsigned maxpacket_limit:16; unsigned max_streams:16;
@@ -447,6 +467,9 @@ struct usb_gadget_ops {int (*udc_start)(struct usb_gadget *,struct usb_gadget_driver *);int (*udc_stop)(struct usb_gadget *); +struct usb_ep *(*match_ep)(struct usb_gadget *, +struct usb_endpoint_descriptor *, +struct usb_ss_ep_comp_descriptor *); };/**
Signature · 1 line
2.23.0
PATCH 4/8 usb: udc: Introduce ->udc_set_speed() method
In reply to Vignesh RaghavendraFrom: Sherry Sun <[email protected]>
This patch was copied from kernel commit: 67fdfda4a99ed.
Sometimes, the gadget driver we want to run has max_speed lower than what the UDC supports. In such situations, UDC might want to make sure we don't try to connect on speeds not supported by the gadget driver because that will just fail.
So here introduce a new optional ->udc_set_speed() method which can be implemented by interested UDC drivers to achieve this purpose.
--- drivers/usb/gadget/udc/udc-core.c | 23 +++++++++++++++++++++++ include/linux/usb/gadget.h | 2 ++ 2 files changed, 25 insertions(+)
drivers/usb/gadget/udc/udc-core.c +23 -0
@@ -267,6 +267,27 @@ EXPORT_SYMBOL_GPL(usb_del_gadget_udc);/* ------------------------------------------------------------------------- */ +/** +* usb_gadget_udc_set_speed - tells usb device controller speed supported by +* current driver +* @udc: The device we want to set maximum speed +* @speed: The maximum speed to allowed to run +* +* This call is issued by the UDC Class driver before calling +* usb_gadget_udc_start() in order to make sure that we don't try to +* connect on speeds the gadget driver doesn't support. +*/ +static inline void usb_gadget_udc_set_speed (struct usb_udc *udc, +enum usb_device_speed speed) +{ +if (udc->gadget->ops->udc_set_speed) { +enum usb_device_speed s; + + s =min (speed, udc->gadget->max_speed); + udc->gadget->ops->udc_set_speed (udc->gadget, s); + } +} +static int udc_bind_to_driver (struct usb_udc *udc,struct usb_gadget_driver *driver) {int ret;
@@ -276,6 +297,8 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri udc->driver = driver; +usb_gadget_udc_set_speed (udc, driver->speed); + ret = driver->bind (udc->gadget);if (ret) goto err1;
include/linux/usb/gadget.h +2 -0
@@ -470,6 +470,8 @@ struct usb_gadget_ops {struct usb_ep *(*match_ep)(struct usb_gadget *,struct usb_endpoint_descriptor *,struct usb_ss_ep_comp_descriptor *); +void (*udc_set_speed)(struct usb_gadget *gadget, +enum usb_device_speed ); };/**
Signature · 1 line
2.23.0
PATCH 5/8 usb: Add Cadence USB3 host and gadget driver
In reply to Vignesh RaghavendraAdd support for USB3 host and gadget driver. This is a direct sync of Linux kernel Cadence USB stack that from v5.4-rc1 release. Driver has been modified so that it compiles without errors against U-Boot code base.
Features not required for U-Boot such as scatter-gather DMA and OTG interrupt handling has been dropped.
--- Makefile | 1 + drivers/usb/Kconfig | 2 + drivers/usb/cdns3/Kconfig | 51 + drivers/usb/cdns3/Makefile | 9 + drivers/usb/cdns3/core.c | 498 ++++++ drivers/usb/cdns3/core.h | 108 ++ drivers/usb/cdns3/debug.h | 162 ++ drivers/usb/cdns3/drd.c | 301 ++++ drivers/usb/cdns3/drd.h | 166 ++ drivers/usb/cdns3/ep0.c | 910 ++++++++++ drivers/usb/cdns3/gadget-export.h | 28 + drivers/usb/cdns3/gadget.c | 2738 +++++++++++++++++++++++++++++ drivers/usb/cdns3/gadget.h | 1338 ++++++++++++++ drivers/usb/cdns3/host-export.h | 28 + drivers/usb/cdns3/host.c | 55 + drivers/usb/cdns3/trace.c | 11 + drivers/usb/cdns3/trace.h | 26 + scripts/Makefile.spl | 1 + 18 files changed, 6433 insertions(+) create mode 100644 drivers/usb/cdns3/Kconfig create mode 100644 drivers/usb/cdns3/Makefile create mode 100644 drivers/usb/cdns3/core.c create mode 100644 drivers/usb/cdns3/core.h create mode 100644 drivers/usb/cdns3/debug.h create mode 100644 drivers/usb/cdns3/drd.c create mode 100644 drivers/usb/cdns3/drd.h create mode 100644 drivers/usb/cdns3/ep0.c create mode 100644 drivers/usb/cdns3/gadget-export.h create mode 100644 drivers/usb/cdns3/gadget.c create mode 100644 drivers/usb/cdns3/gadget.h create mode 100644 drivers/usb/cdns3/host-export.h create mode 100644 drivers/usb/cdns3/host.c create mode 100644 drivers/usb/cdns3/trace.c create mode 100644 drivers/usb/cdns3/trace.h
Makefile +1 -0
@@ -728,6 +728,7 @@ libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/ libs-$(CONFIG_SYS_FSL_MMDC) += drivers/ddr/fsl/ libs-$(CONFIG_$(SPL_)ALTERA_SDRAM) += drivers/ddr/altera/ libs-y += drivers/serial/ +libs-y += drivers/usb/cdns3/ libs-y += drivers/usb/dwc3/ libs-y += drivers/usb/common/ libs-y += drivers/usb/emul/
drivers/usb/Kconfig +2 -0
@@ -68,6 +68,8 @@ config SPL_DM_USB_GADGET source "drivers/usb/host/Kconfig" +source "drivers/usb/cdns3/Kconfig" + source "drivers/usb/dwc3/Kconfig" source "drivers/usb/musb/Kconfig"
drivers/usb/cdns3/Kconfig new file +51 -0
51 lines not on this page · raw message
drivers/usb/cdns3/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0 + +cdns3-y := core.o drd.o + +obj-$(CONFIG_USB_CDNS3) += cdns3.o + +cdns3-$(CONFIG_$(SPL_)USB_CDNS3_GADGET) += gadget.o ep0.o + +cdns3-$(CONFIG_$(SPL_)USB_CDNS3_HOST) += host.o
drivers/usb/cdns3/core.c new file +498 -0
498 lines not on this page · raw message
drivers/usb/cdns3/core.h new file +108 -0
108 lines not on this page · raw message
drivers/usb/cdns3/debug.h new file +162 -0
162 lines not on this page · raw message
drivers/usb/cdns3/drd.c new file +301 -0
301 lines not on this page · raw message
drivers/usb/cdns3/drd.h new file +166 -0
166 lines not on this page · raw message
drivers/usb/cdns3/ep0.c new file +910 -0
910 lines not on this page · raw message
drivers/usb/cdns3/gadget-export.h new file +28 -0
@@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Cadence USBSS DRD Driver - Gadget Export APIs. +* +* Copyright (C) 2017 NXP +* Copyright (C) 2017-2018 NXP +* +* Authors: Peter Chen <[email protected]> +*/ +#ifndef __LINUX_CDNS3_GADGET_EXPORT +#define __LINUX_CDNS3_GADGET_EXPORT + +#ifdef CONFIG_USB_CDNS3_GADGET + +int cdns3_gadget_init (struct cdns3 *cdns); +void cdns3_gadget_exit (struct cdns3 *cdns); +#else + +static inline int cdns3_gadget_init (struct cdns3 *cdns) +{ +return -ENXIO ; +} + +static inline void cdns3_gadget_exit (struct cdns3 *cdns) { } + +#endif + +#endif /* __LINUX_CDNS3_GADGET_EXPORT */
drivers/usb/cdns3/gadget.c new file +2738 -0
752 lines not on this page · raw message
drivers/usb/cdns3/gadget.h new file +1338 -0
1,338 lines not on this page · raw message
drivers/usb/cdns3/host-export.h new file +28 -0
Lines of this file are not shown. View the raw message.
drivers/usb/cdns3/host.c new file +55 -0
55 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.23.0
Part of the diff is not shown here. View the raw message.
PATCH 6/8 usb: cdns3: gadget: Implement udc_set_speed() callback
In reply to Vignesh RaghavendraImplement udc_set_speed() callback to limit Controller's speed to high-speed/full-speed when working with gadgets that are high-speed or full-speed only
--- drivers/usb/cdns3/gadget.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-)
drivers/usb/cdns3/gadget.c +26 -4
@@ -2378,6 +2378,29 @@ static int cdns3_gadget_udc_stop(struct usb_gadget *gadget)return ret; } +static void cdns3_gadget_udc_set_speed (struct usb_gadget *gadget, +enum usb_device_speed speed) +{ +struct cdns3_device *priv_dev =gadget_to_cdns3_device (gadget); + +switch (speed) { +case USB_SPEED_FULL : +writel (USB_CONF_SFORCE_FS , &priv_dev->regs->usb_conf); +writel (USB_CONF_USB3DIS , &priv_dev->regs->usb_conf); +break ; +case USB_SPEED_HIGH : +writel (USB_CONF_USB3DIS , &priv_dev->regs->usb_conf); +break ; +case USB_SPEED_SUPER : +break ; +default : +dev_err (cdns->dev,"invalid speed parameter %d\n" , + speed); + } + + priv_dev->gadget.speed = speed; +} +static const struct usb_gadget_ops cdns3_gadget_ops = { .get_frame = cdns3_gadget_get_frame, .wakeup = cdns3_gadget_wakeup,
@@ -2386,6 +2409,7 @@ static const struct usb_gadget_ops cdns3_gadget_ops = { .udc_start = cdns3_gadget_udc_start, .udc_stop = cdns3_gadget_udc_stop, .match_ep = cdns3_gadget_match_ep, + .udc_set_speed = cdns3_gadget_udc_set_speed, };static void cdns3_free_all_eps (struct cdns3_device *priv_dev)
@@ -2557,11 +2581,9 @@ static int cdns3_gadget_start(struct cdns3 *cdns)/* Check the maximum_speed parameter */ switch (max_speed) {case USB_SPEED_FULL : -writel (USB_CONF_SFORCE_FS , &priv_dev->regs->usb_conf); -break ; +/* fall through */ case USB_SPEED_HIGH : -writel (USB_CONF_USB3DIS , &priv_dev->regs->usb_conf); -break ; +/* fall through */ case USB_SPEED_SUPER :break ;default :
Signature · 1 line
2.23.0
PATCH 7/8 usb: cdns3: Add TI wrapper driver for CDNS USB3 controller
In reply to Vignesh RaghavendraAdd driver to handle TI specific wrapper for Cadence USB3 controller present on J721e SoC. Based on Linux driver for the same.
--- drivers/usb/cdns3/Kconfig | 7 ++ drivers/usb/cdns3/Makefile | 2 + drivers/usb/cdns3/cdns3-ti.c | 193 +++++++++++++++++++++++++++++++++++ 3 files changed, 202 insertions(+) create mode 100644 drivers/usb/cdns3/cdns3-ti.c
drivers/usb/cdns3/Kconfig +7 -0
@@ -48,4 +48,11 @@ config SPL_USB_CDNS3_HOST Host controller is compliant with XHCI so it will use standard XHCI driver. + +config USB_CDNS3_TI + tristate "Cadence USB3 support on TI platforms" + default USB_CDNS3 + help + Say 'Y' here if you are building for Texas Instruments + platforms that contain Cadence USB3 controller core. E.g.: J721e. endif
drivers/usb/cdns3/Makefile +2 -0
@@ -7,3 +7,5 @@ obj-$(CONFIG_USB_CDNS3) += cdns3.o cdns3-$(CONFIG_$(SPL_)USB_CDNS3_GADGET) += gadget.o ep0.o cdns3-$(CONFIG_$(SPL_)USB_CDNS3_HOST) += host.o + +obj-$(CONFIG_USB_CDNS3_TI) += cdns3-ti.o
drivers/usb/cdns3/cdns3-ti.c new file +193 -0
193 lines not on this page · raw message
Signature · 1 line
2.23.0
PATCH 8/8 usb: gadget: Add gadget_is_cdns3() macro
In reply to Vignesh RaghavendraAdd a new bcdDevice entry for Cadence USB gadget controller similar to other controller and add gadget_is_cdns3() macro as well.
--- drivers/usb/gadget/gadget_chips.h | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/usb/gadget/gadget_chips.h +8 -0
@@ -149,6 +149,12 @@#define gadget_is_dwc3 (g) 0#endif +#ifdef CONFIG_USB_CDNS3_GADGET +#define gadget_is_cdns3 (g) (!strcmp("cdns3-gadget", (g)->name)) +#else +#define gadget_is_cdns3 (g) 0 +#endif +/** * usb_gadget_controller_number - support bcdDevice id convention * @gadget: the controller being driven
@@ -208,5 +214,7 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget)return 0x22 ; else if (gadget_is_dwc3(gadget)) return 0x23; + else if (gadget_is_cdns3(gadget)) + return 0x24;return -ENOENT ; }
Signature · 1 line
2.23.0
cover usb: Add support for Cadence USB controller driver
In reply to Vignesh RaghavendraQuoted 54 lines · Vignesh Raghavendra
This series adds support for Cadence USB Host and Gadget controller drivers. This is borrowed directly from Linux kernel v5.4-rc1. Driver as such supports both 3.0 and 2.0 speeds. But USB 3.0 requires a PHY driver which will be added in a separate follow series
Patch 7 adds TI wrapper driver for Cadence USB controller.
Both host and device mode has been tested on TI's J721e SoC. DFU, UMS and fastboot gadgets have been tested.
Complete series (+ DT nodes required for J721e) can be found here:
https://github.com/r-vignesh/u-boot.git branch: usbRegards
VigneshSherry Sun (1):
usb: udc: Introduce ->udc_set_speed() methodVignesh Raghavendra (7):
list: importlist_first_entry_or_null()
bitmaps: importfor_each_set_bit()macro
usb: gadget: Addmatch_ep()op tousb_gadget_ops
usb: Add Cadence USB3 host and gadget driver
usb: cdns3: gadget: Implementudc_set_speed()callback
usb: cdns3: Add TI wrapper driver for CDNS USB3 controller
usb: gadget: Addgadget_is_cdns3()macroMakefile | 1 + drivers/usb/Kconfig | 2 + drivers/usb/cdns3/Kconfig | 58 + drivers/usb/cdns3/Makefile | 11 + drivers/usb/cdns3/cdns3-ti.c | 193 ++ drivers/usb/cdns3/core.c | 498 ++++++ drivers/usb/cdns3/core.h | 108 ++ drivers/usb/cdns3/debug.h | 162 ++ drivers/usb/cdns3/drd.c | 301 ++++ drivers/usb/cdns3/drd.h | 166 ++ drivers/usb/cdns3/ep0.c | 910 ++++++++++ drivers/usb/cdns3/gadget-export.h | 28 + drivers/usb/cdns3/gadget.c | 2760 +++++++++++++++++++++++++++++ drivers/usb/cdns3/gadget.h | 1338 ++++++++++++++ drivers/usb/cdns3/host-export.h | 28 + drivers/usb/cdns3/host.c | 55 + drivers/usb/cdns3/trace.c | 11 + drivers/usb/cdns3/trace.h | 26 + drivers/usb/gadget/epautoconf.c | 3 + drivers/usb/gadget/gadget_chips.h | 8 + drivers/usb/gadget/udc/udc-core.c | 23 + include/linux/bitmap.h | 61 + include/linux/list.h | 14 + include/linux/usb/gadget.h | 25 + scripts/Makefile.spl | 1 + 25 files changed, 6791 insertions(+)
Quoted 16 lines
create mode 100644
drivers/usb/cdns3/Kconfigcreate mode 100644drivers/usb/cdns3/Makefilecreate mode 100644drivers/usb/cdns3/cdns3-ti.ccreate mode 100644drivers/usb/cdns3/core.ccreate mode 100644drivers/usb/cdns3/core.hcreate mode 100644drivers/usb/cdns3/debug.hcreate mode 100644drivers/usb/cdns3/drd.ccreate mode 100644drivers/usb/cdns3/drd.hcreate mode 100644drivers/usb/cdns3/ep0.ccreate mode 100644drivers/usb/cdns3/gadget-export.hcreate mode 100644drivers/usb/cdns3/gadget.ccreate mode 100644drivers/usb/cdns3/gadget.hcreate mode 100644drivers/usb/cdns3/host-export.hcreate mode 100644drivers/usb/cdns3/host.ccreate mode 100644drivers/usb/cdns3/trace.ccreate mode 100644drivers/usb/cdns3/trace.h
I tested the series for Host and device operations on with a J721e-evm.
As expected, USB3 is not yet supported on the J721e because the driver for the USB3 phy is not there yet.