1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0 2*4882a593Smuzhiyun 3*4882a593Smuzhiyunconfig USB_DWC2 4*4882a593Smuzhiyun tristate "DesignWare USB2 DRD Core Support" 5*4882a593Smuzhiyun depends on HAS_DMA 6*4882a593Smuzhiyun depends on USB || USB_GADGET 7*4882a593Smuzhiyun depends on HAS_IOMEM 8*4882a593Smuzhiyun select USB_ROLE_SWITCH 9*4882a593Smuzhiyun help 10*4882a593Smuzhiyun Say Y here if your system has a Dual Role Hi-Speed USB 11*4882a593Smuzhiyun controller based on the DesignWare HSOTG IP Core. 12*4882a593Smuzhiyun 13*4882a593Smuzhiyun For host mode, if you choose to build the driver as dynamically 14*4882a593Smuzhiyun linked modules, the core module will be called dwc2.ko, the PCI 15*4882a593Smuzhiyun bus interface module (if you have a PCI bus system) will be 16*4882a593Smuzhiyun called dwc2_pci.ko, and the platform interface module (for 17*4882a593Smuzhiyun controllers directly connected to the CPU) will be called 18*4882a593Smuzhiyun dwc2_platform.ko. For all modes(host, gadget and dual-role), there 19*4882a593Smuzhiyun will be an additional module named dwc2.ko. 20*4882a593Smuzhiyun 21*4882a593Smuzhiyunif USB_DWC2 22*4882a593Smuzhiyun 23*4882a593Smuzhiyunchoice 24*4882a593Smuzhiyun bool "DWC2 Mode Selection" 25*4882a593Smuzhiyun default USB_DWC2_DUAL_ROLE if (USB && USB_GADGET) 26*4882a593Smuzhiyun default USB_DWC2_HOST if (USB && !USB_GADGET) 27*4882a593Smuzhiyun default USB_DWC2_PERIPHERAL if (!USB && USB_GADGET) 28*4882a593Smuzhiyun 29*4882a593Smuzhiyunconfig USB_DWC2_HOST 30*4882a593Smuzhiyun bool "Host only mode" 31*4882a593Smuzhiyun depends on USB=y || (USB_DWC2=m && USB) 32*4882a593Smuzhiyun help 33*4882a593Smuzhiyun The Designware USB2.0 high-speed host controller 34*4882a593Smuzhiyun integrated into many SoCs. Select this option if you want the 35*4882a593Smuzhiyun driver to operate in Host-only mode. 36*4882a593Smuzhiyun 37*4882a593Smuzhiyuncomment "Gadget/Dual-role mode requires USB Gadget support to be enabled" 38*4882a593Smuzhiyun 39*4882a593Smuzhiyunconfig USB_DWC2_PERIPHERAL 40*4882a593Smuzhiyun bool "Gadget only mode" 41*4882a593Smuzhiyun depends on USB_GADGET=y || USB_GADGET=USB_DWC2 42*4882a593Smuzhiyun help 43*4882a593Smuzhiyun The Designware USB2.0 high-speed gadget controller 44*4882a593Smuzhiyun integrated into many SoCs. Select this option if you want the 45*4882a593Smuzhiyun driver to operate in Peripheral-only mode. This option requires 46*4882a593Smuzhiyun USB_GADGET to be enabled. 47*4882a593Smuzhiyun 48*4882a593Smuzhiyunconfig USB_DWC2_DUAL_ROLE 49*4882a593Smuzhiyun bool "Dual Role mode" 50*4882a593Smuzhiyun depends on (USB=y && USB_GADGET=y) || (USB_DWC2=m && USB && USB_GADGET) 51*4882a593Smuzhiyun help 52*4882a593Smuzhiyun Select this option if you want the driver to work in a dual-role 53*4882a593Smuzhiyun mode. In this mode both host and gadget features are enabled, and 54*4882a593Smuzhiyun the role will be determined by the cable that gets plugged-in. This 55*4882a593Smuzhiyun option requires USB_GADGET to be enabled. 56*4882a593Smuzhiyunendchoice 57*4882a593Smuzhiyun 58*4882a593Smuzhiyunconfig USB_DWC2_PCI 59*4882a593Smuzhiyun tristate "DWC2 PCI" 60*4882a593Smuzhiyun depends on USB_PCI 61*4882a593Smuzhiyun depends on USB_GADGET || !USB_GADGET 62*4882a593Smuzhiyun select NOP_USB_XCEIV 63*4882a593Smuzhiyun help 64*4882a593Smuzhiyun The Designware USB2.0 PCI interface module for controllers 65*4882a593Smuzhiyun connected to a PCI bus. 66*4882a593Smuzhiyun 67*4882a593Smuzhiyunconfig USB_DWC2_DEBUG 68*4882a593Smuzhiyun bool "Enable Debugging Messages" 69*4882a593Smuzhiyun help 70*4882a593Smuzhiyun Say Y here to enable debugging messages in the DWC2 Driver. 71*4882a593Smuzhiyun 72*4882a593Smuzhiyunconfig USB_DWC2_VERBOSE 73*4882a593Smuzhiyun bool "Enable Verbose Debugging Messages" 74*4882a593Smuzhiyun depends on USB_DWC2_DEBUG 75*4882a593Smuzhiyun help 76*4882a593Smuzhiyun Say Y here to enable verbose debugging messages in the DWC2 Driver. 77*4882a593Smuzhiyun WARNING: Enabling this will quickly fill your message log. 78*4882a593Smuzhiyun If in doubt, say N. 79*4882a593Smuzhiyun 80*4882a593Smuzhiyunconfig USB_DWC2_TRACK_MISSED_SOFS 81*4882a593Smuzhiyun bool "Enable Missed SOF Tracking" 82*4882a593Smuzhiyun help 83*4882a593Smuzhiyun Say Y here to enable logging of missed SOF events to the dmesg log. 84*4882a593Smuzhiyun WARNING: This feature is still experimental. 85*4882a593Smuzhiyun If in doubt, say N. 86*4882a593Smuzhiyun 87*4882a593Smuzhiyunconfig USB_DWC2_DEBUG_PERIODIC 88*4882a593Smuzhiyun bool "Enable Debugging Messages For Periodic Transfers" 89*4882a593Smuzhiyun depends on USB_DWC2_DEBUG || USB_DWC2_VERBOSE 90*4882a593Smuzhiyun default y 91*4882a593Smuzhiyun help 92*4882a593Smuzhiyun Say N here to disable (verbose) debugging messages to be 93*4882a593Smuzhiyun logged for periodic transfers. This allows better debugging of 94*4882a593Smuzhiyun non-periodic transfers, but of course the debug logs will be 95*4882a593Smuzhiyun incomplete. Note that this also disables some debug messages 96*4882a593Smuzhiyun for which the transfer type cannot be deduced. 97*4882a593Smuzhiyunendif 98