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