#
# USB Host Controller Drivers
#
comment "USB Host Controller Drivers"

config USB_HOST
	bool

config USB_XHCI_HCD
	bool "xHCI HCD (USB 3.0) support"
	select USB_HOST
	---help---
	  The eXtensible Host Controller Interface (xHCI) is standard for USB 3.0
	  "SuperSpeed" host controller hardware.

if USB_XHCI_HCD

config USB_XHCI_DWC3
	bool "DesignWare USB3 DRD Core Support"
	help
	  Say Y or if your system has a Dual Role SuperSpeed
	  USB controller based on the DesignWare USB3 IP Core.

config USB_XHCI_MVEBU
	bool "MVEBU USB 3.0 support"
	default y
	depends on ARCH_MVEBU
	select DM_REGULATOR
	help
	  Choose this option to add support for USB 3.0 driver on mvebu
	  SoCs, which includes Armada8K, Armada3700 and other Armada
	  family SoCs.

config USB_XHCI_ROCKCHIP
	bool "Support for Rockchip on-chip xHCI USB controller"
	depends on ARCH_ROCKCHIP
	default y
	help
	  Enables support for the on-chip xHCI controller on Rockchip SoCs.

config USB_XHCI_ZYNQMP
	bool "Support for Xilinx ZynqMP on-chip xHCI USB controller"
	depends on ARCH_ZYNQMP
	help
	  Enables support for the on-chip xHCI controller on Xilinx ZynqMP SoCs.

config USB_XHCI_DRA7XX_INDEX
	int "DRA7XX xHCI USB index"
	range 0 1
	default 0
	depends on DRA7XX
	help
	  Select the DRA7XX xHCI USB index.
	  Current supported values: 0, 1.

endif # USB_XHCI_HCD

config USB_EHCI_HCD
	bool "EHCI HCD (USB 2.0) support"
	default y if ARCH_MX5 || ARCH_MX6
	select USB_HOST
	---help---
	  The Enhanced Host Controller Interface (EHCI) is standard for USB 2.0
	  "high speed" (480 Mbit/sec, 60 Mbyte/sec) host controller hardware.
	  If your USB host controller supports USB 2.0, you will likely want to
	  configure this Host Controller Driver.

	  EHCI controllers are packaged with "companion" host controllers (OHCI
	  or UHCI) to handle USB 1.1 devices connected to root hub ports.  Ports
	  will connect to EHCI if the device is high speed, otherwise they
	  connect to a companion controller.  If you configure EHCI, you should
	  probably configure the OHCI (for NEC and some other vendors) USB Host
	  Controller Driver or UHCI (for Via motherboards) Host Controller
	  Driver too.

	  You may want to read <file:Documentation/usb/ehci.txt>.

if USB_EHCI_HCD

config USB_EHCI_ATMEL
	bool  "Support for Atmel on-chip EHCI USB controller"
	depends on ARCH_AT91
	default y
	---help---
	  Enables support for the on-chip EHCI controller on Atmel chips.

config USB_EHCI_MARVELL
	bool "Support for Marvell on-chip EHCI USB controller"
	depends on ARCH_MVEBU || KIRKWOOD || ORION5X
	default y
	---help---
	  Enables support for the on-chip EHCI controller on MVEBU SoCs.

config USB_EHCI_MX6
	bool "Support for i.MX6 on-chip EHCI USB controller"
	depends on ARCH_MX6
	default y
	---help---
	  Enables support for the on-chip EHCI controller on i.MX6 SoCs.

config USB_EHCI_MX7
	bool "Support for i.MX7 on-chip EHCI USB controller"
	depends on ARCH_MX7
	default y
	---help---
	  Enables support for the on-chip EHCI controller on i.MX7 SoCs.

config USB_EHCI_OMAP
	bool "Support for OMAP3+ on-chip EHCI USB controller"
	depends on ARCH_OMAP2PLUS
	default y
	---help---
	  Enables support for the on-chip EHCI controller on OMAP3 and later
	  SoCs.

if USB_EHCI_MX7

config MXC_USB_OTG_HACTIVE
	bool "USB Power pin high active"
	---help---
	  Set the USB Power pin polarity to be high active (PWR_POL)

endif

config USB_EHCI_MSM
	bool "Support for Qualcomm on-chip EHCI USB controller"
	depends on DM_USB
	select USB_ULPI_VIEWPORT
	default n
	---help---
	  Enables support for the on-chip EHCI controller on Qualcomm
	  Snapdragon SoCs.
	  This driver supports combination of Chipidea USB controller
	  and Synapsys USB PHY in host mode only.

config USB_EHCI_RCAR_GEN3
	bool "Support for Renesas RCar M3/H3 EHCI USB controller"
	depends on RCAR_GEN3
	default y
	---help---
	  Enables support for the on-chip EHCI controller on Renesas
	  R8A7795 and R8A7796 SoCs.

config USB_EHCI_ZYNQ
	bool "Support for Xilinx Zynq on-chip EHCI USB controller"
	depends on ARCH_ZYNQ
	default y
	---help---
	  Enable support for Zynq on-chip EHCI USB controller

config USB_EHCI_GENERIC
	bool "Support for generic EHCI USB controller"
	depends on OF_CONTROL
	depends on DM_USB
	default n
	---help---
	  Enables support for generic EHCI controller.

endif # USB_EHCI_HCD

config USB_OHCI_HCD
	bool "OHCI HCD (USB 1.1) support"
	---help---
	  The Open Host Controller Interface (OHCI) is a standard for accessing
	  USB 1.1 host controller hardware.  It does more in hardware than Intel's
	  UHCI specification.  If your USB host controller follows the OHCI spec,
	  say Y.  On most non-x86 systems, and on x86 hardware that's not using a
	  USB controller from Intel or VIA, this is appropriate.  If your host
	  controller doesn't use PCI, this is probably appropriate.  For a PCI
	  based system where you're not sure, the "lspci -v" entry will list the
	  right "prog-if" for your USB controller(s):  EHCI, OHCI, or UHCI.

if USB_OHCI_HCD

config USB_OHCI_GENERIC
	bool "Support for generic OHCI USB controller"
	depends on OF_CONTROL
	depends on DM_USB
	select USB_HOST
	---help---
	  Enables support for generic OHCI controller.

endif # USB_OHCI_HCD

config USB_UHCI_HCD
	bool "UHCI HCD (most Intel and VIA) support"
	select USB_HOST
	---help---
	  The Universal Host Controller Interface is a standard by Intel for
	  accessing the USB hardware in the PC (which is also called the USB
	  host controller). If your USB host controller conforms to this
	  standard, you may want to say Y, but see below. All recent boards
	  with Intel PCI chipsets (like intel 430TX, 440FX, 440LX, 440BX,
	  i810, i820) conform to this standard. Also all VIA PCI chipsets
	  (like VIA VP2, VP3, MVP3, Apollo Pro, Apollo Pro II or Apollo Pro
	  133) and LEON/GRLIB SoCs with the GRUSBHC controller.
	  If unsure, say Y.

if USB_UHCI_HCD

endif # USB_UHCI_HCD
