package: kernel: Enable support for DWC2 USB on SoCFPGA
[openwrt.git] / package / kernel / linux / modules / usb.mk
index 27f531d..22b7f64 100644 (file)
@@ -18,8 +18,7 @@ define KernelPackage/usb-core
   KCONFIG:=CONFIG_USB CONFIG_XPS_USB_HCD_XILINX=n CONFIG_USB_FHCI_HCD=n
   FILES:= \
        $(LINUX_DIR)/drivers/usb/core/usbcore.ko \
-       $(LINUX_DIR)/drivers/usb/usb-common.ko@lt3.16 \
-       $(LINUX_DIR)/drivers/usb/common/usb-common.ko@ge3.16
+       $(LINUX_DIR)/drivers/usb/common/usb-common.ko
   AUTOLOAD:=$(call AutoLoad,20,usb-common usbcore,1)
   $(call AddDepends/nls)
 endef
@@ -104,18 +103,8 @@ define KernelPackage/usb-phy-nop
   TITLE:=Support for USB NOP transceiver
   KCONFIG:=CONFIG_NOP_USB_XCEIV
   HIDDEN:=1
-ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/phy/phy-generic.ko),)
   FILES:=$(LINUX_DIR)/drivers/usb/phy/phy-generic.ko
   AUTOLOAD:=$(call AutoLoad,43,phy-generic)
-else
-ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/phy/phy-nop.ko),)
-  FILES:=$(LINUX_DIR)/drivers/usb/phy/phy-nop.ko
-  AUTOLOAD:=$(call AutoLoad,43,phy-nop)
-else
-  FILES:=$(LINUX_DIR)/drivers/usb/otg/nop-usb-xceiv.ko
-  AUTOLOAD:=$(call AutoLoad,43,nop-usb-xceiv)
-endif
-endif
   $(call AddDepends/usb)
 endef
 
@@ -290,6 +279,41 @@ endef
 
 $(eval $(call KernelPackage,usb-serial-gadget))
 
+define KernelPackage/usb-mass-storage-gadget
+  TITLE:=USB Mass Storage support
+  KCONFIG:=CONFIG_USB_MASS_STORAGE
+  DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite
+  FILES:= \
+       $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_mass_storage.ko \
+       $(LINUX_DIR)/drivers/usb/gadget/legacy/g_mass_storage.ko
+  AUTOLOAD:=$(call AutoLoad,52,usb_f_mass_storage g_mass_storage)
+  $(call AddDepends/usb)
+endef
+
+define KernelPackage/usb-mass-storage-gadget/description
+  Kernel support for USB Gadget Mass Storage
+endef
+
+$(eval $(call KernelPackage,usb-mass-storage-gadget))
+
+
+define KernelPackage/usb-storage-gadget
+  TITLE:=USB Mass Storage Gadget support
+  KCONFIG:=CONFIG_USB_F_MASS_STORAGE
+  DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite
+  FILES:= \
+       $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_mass_storage.ko \
+       $(LINUX_DIR)/drivers/usb/gadget/legacy/g_storage.ko
+  AUTOLOAD:=$(call AutoLoad,52,usb_f_mass_storage g_storage)
+  $(call AddDepends/usb)
+endef
+
+define KernelPackage/usb-storage-gadget/description
+  Kernel support for USB Mass Storage Gadget.
+endef
+
+$(eval $(call KernelPackage,usb-storage-gadget))
+
 
 define KernelPackage/usb-uhci
   TITLE:=Support for UHCI controllers
@@ -311,6 +335,7 @@ $(eval $(call KernelPackage,usb-uhci,1))
 define KernelPackage/usb-ohci
   TITLE:=Support for OHCI controllers
   DEPENDS:= \
+       +TARGET_bcm53xx:kmod-usb-bcma \
        +TARGET_brcm47xx:kmod-usb-bcma \
        +TARGET_brcm47xx:kmod-usb-ssb
   KCONFIG:= \
@@ -325,7 +350,10 @@ define KernelPackage/usb-ohci
   FILES:= \
        $(LINUX_DIR)/drivers/usb/host/ohci-hcd.ko \
        $(LINUX_DIR)/drivers/usb/host/ohci-platform.ko
-  AUTOLOAD:=$(call AutoLoad,50,ohci-hcd ohci-platform,1)
+  ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/ohci-at91.ko),)
+    FILES+=$(LINUX_DIR)/drivers/usb/host/ohci-at91.ko
+  endif
+  AUTOLOAD:=$(call AutoLoad,50,ohci-hcd ohci-platform ohci-at91,1)
   $(call AddDepends/usb)
 endef
 
@@ -345,7 +373,7 @@ define KernelPackage/usb-ohci-pci
   $(call AddDepends/usb)
 endef
 
-define KernelPackage/usb2-pci/description
+define KernelPackage/usb-ohci-pci/description
  Kernel support for PCI OHCI controllers
 endef
 
@@ -355,9 +383,8 @@ $(eval $(call KernelPackage,usb-ohci-pci))
 define KernelPackage/usb2-fsl
   TITLE:=Support for Freescale USB2 controllers
   DEPENDS:=@TARGET_mpc85xx
-  KCONFIG:=\
-       CONFIG_USB_FSL_MPH_DR_OF \
-       CONFIG_USB_EHCI_FSL=y
+  HIDDEN:=1
+  KCONFIG:=CONFIG_USB_FSL_MPH_DR_OF
   FILES:=$(LINUX_DIR)/drivers/usb/host/fsl-mph-dr-of.ko
   AUTOLOAD:=$(call AutoLoad,39,fsl-mph-dr-of,1)
   $(call AddDepends/usb)
@@ -426,14 +453,22 @@ define KernelPackage/usb2
        CONFIG_USB_EHCI_MXC=y \
        CONFIG_USB_OCTEON_EHCI=y \
        CONFIG_USB_EHCI_HCD_ORION=y \
-       CONFIG_USB_EHCI_HCD_PLATFORM=y
+       CONFIG_USB_EHCI_HCD_PLATFORM=y \
+       CONFIG_USB_EHCI_HCD_AT91=y \
+       CONFIG_USB_EHCI_FSL
   FILES:= \
        $(LINUX_DIR)/drivers/usb/host/ehci-hcd.ko \
        $(LINUX_DIR)/drivers/usb/host/ehci-platform.ko
   ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/ehci-orion.ko),)
     FILES+=$(LINUX_DIR)/drivers/usb/host/ehci-orion.ko
   endif
-  AUTOLOAD:=$(call AutoLoad,40,ehci-hcd ehci-platform ehci-orion,1)
+  ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/ehci-atmel.ko),)
+    FILES+=$(LINUX_DIR)/drivers/usb/host/ehci-atmel.ko
+  endif
+  ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/host/ehci-fsl.ko),)
+    FILES+=$(LINUX_DIR)/drivers/usb/host/ehci-fsl.ko
+  endif
+  AUTOLOAD:=$(call AutoLoad,40,ehci-hcd ehci-platform ehci-orion ehci-atmel ehci-fsl,1)
   $(call AddDepends/usb)
 endef
 
@@ -462,18 +497,20 @@ $(eval $(call KernelPackage,usb2-pci))
 
 define KernelPackage/usb-dwc2
   TITLE:=DWC2 USB controller driver
-  DEPENDS:=+(TARGET_brcm2708||TARGET_at91||TARGET_brcm63xx||TARGET_mxs||TARGET_imx6):kmod-usb-gadget
+  DEPENDS:=+(TARGET_brcm2708||TARGET_at91||TARGET_brcm63xx||TARGET_mxs||TARGET_imx6||TARGET_omap||TARGET_socfpga):kmod-usb-gadget
   KCONFIG:= \
        CONFIG_USB_DWC2 \
        CONFIG_USB_DWC2_PCI \
        CONFIG_USB_DWC2_PLATFORM \
        CONFIG_USB_DWC2_DEBUG=n \
        CONFIG_USB_DWC2_VERBOSE=n \
-       CONFIG_USB_DWC2_TRACK_MISSED_SOFS=n
+       CONFIG_USB_DWC2_TRACK_MISSED_SOFS=n \
+       CONFIG_USB_DWC2_DEBUG_PERIODIC=n
+       CONFIG_USB_DWC2_DUAL_ROLE=y
   FILES:= \
        $(LINUX_DIR)/drivers/usb/dwc2/dwc2.ko \
-       $(LINUX_DIR)/drivers/usb/dwc2/dwc2_platform.ko
-  AUTOLOAD:=$(call AutoLoad,54,dwc2 dwc2_platform,1)
+       $(LINUX_DIR)/drivers/usb/dwc2/dwc2_platform.ko@lt4.3
+  AUTOLOAD:=$(call AutoLoad,54,dwc2 dwc2_platform@lt4.3,1)
   $(call AddDepends/usb)
 endef
 
@@ -559,21 +596,14 @@ define KernelPackage/usb-audio
   TITLE:=Support for USB audio devices
   KCONFIG:= \
        CONFIG_USB_AUDIO \
+       CONFIG_SND_USB=y \
        CONFIG_SND_USB_AUDIO
   $(call AddDepends/usb)
   $(call AddDepends/sound)
-# For Linux 2.6.35+
-ifneq ($(wildcard $(LINUX_DIR)/sound/usb/snd-usbmidi-lib.ko),)
   FILES:= \
        $(LINUX_DIR)/sound/usb/snd-usbmidi-lib.ko \
        $(LINUX_DIR)/sound/usb/snd-usb-audio.ko
   AUTOLOAD:=$(call AutoProbe,snd-usbmidi-lib snd-usb-audio)
-else
-  FILES:= \
-       $(LINUX_DIR)/sound/usb/snd-usb-lib.ko \
-       $(LINUX_DIR)/sound/usb/snd-usb-audio.ko
-  AUTOLOAD:=$(call AutoProbe,snd-usb-lib snd-usb-audio)
-endif
 endef
 
 define KernelPackage/usb-audio/description
@@ -1278,6 +1308,51 @@ endef
 $(eval $(call KernelPackage,usb-net-qmi-wwan))
 
 
+define KernelPackage/usb-net-rtl8150
+  TITLE:=Kernel module for USB-to-Ethernet Realtek convertors
+  KCONFIG:=CONFIG_USB_RTL8150
+  FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/rtl8150.ko
+  AUTOLOAD:=$(call AutoProbe,rtl8150)
+  $(call AddDepends/usb-net)
+endef
+
+define KernelPackage/usb-net-rtl8150/description
+ Kernel module for USB-to-Ethernet Realtek 8150 convertors
+endef
+
+$(eval $(call KernelPackage,usb-net-rtl8150))
+
+
+define KernelPackage/usb-net-rtl8152
+  TITLE:=Kernel module for USB-to-Ethernet Realtek convertors
+  KCONFIG:=CONFIG_USB_RTL8152
+  FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/r8152.ko
+  AUTOLOAD:=$(call AutoProbe,r8152)
+  $(call AddDepends/usb-net)
+endef
+
+define KernelPackage/usb-net-rtl8152/description
+ Kernel module for USB-to-Ethernet Realtek 8152 USB2.0/3.0 convertors
+endef
+
+$(eval $(call KernelPackage,usb-net-rtl8152))
+
+
+define KernelPackage/usb-net-sr9700
+  TITLE:=Support for CoreChip SR9700 ethernet devices
+  KCONFIG:=CONFIG_USB_NET_SR9700
+  FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/sr9700.ko
+  AUTOLOAD:=$(call AutoProbe,sr9700)
+  $(call AddDepends/usb-net)
+endef
+
+define KernelPackage/usb-net-sr9700/description
+ Kernel module for CoreChip-sz SR9700 based USB 1.1 10/100 ethernet devices
+endef
+
+$(eval $(call KernelPackage,usb-net-sr9700))
+
+
 define KernelPackage/usb-net-rndis
   TITLE:=Support for RNDIS connections
   KCONFIG:=CONFIG_USB_NET_RNDIS_HOST
@@ -1453,9 +1528,7 @@ define KernelPackage/usbip
   KCONFIG:= \
        CONFIG_USBIP_CORE \
        CONFIG_USBIP_DEBUG=n
-  FILES:= \
-       $(LINUX_DIR)/drivers/staging/usbip/usbip-core.ko@lt3.17 \
-       $(LINUX_DIR)/drivers/usb/usbip/usbip-core.ko@ge3.17
+  FILES:=$(LINUX_DIR)/drivers/usb/usbip/usbip-core.ko
   AUTOLOAD:=$(call AutoProbe,usbip-core)
   $(call AddDepends/usb)
 endef
@@ -1467,9 +1540,7 @@ define KernelPackage/usbip-client
   TITLE := USB-over-IP client driver
   DEPENDS := +kmod-usbip
   KCONFIG := CONFIG_USBIP_VHCI_HCD
-  FILES := \
-       $(LINUX_DIR)/drivers/staging/usbip/vhci-hcd.ko@lt3.17 \
-       $(LINUX_DIR)/drivers/usb/usbip/vhci-hcd.ko@ge3.17
+  FILES :=$(LINUX_DIR)/drivers/usb/usbip/vhci-hcd.ko
   AUTOLOAD := $(call AutoProbe,vhci-hcd)
   $(call AddDepends/usb)
 endef
@@ -1482,9 +1553,7 @@ $(call KernelPackage/usbip/Default)
   TITLE := USB-over-IP host driver
   DEPENDS := +kmod-usbip
   KCONFIG := CONFIG_USBIP_HOST
-  FILES := \
-       $(LINUX_DIR)/drivers/staging/usbip/usbip-host.ko@lt3.17 \
-       $(LINUX_DIR)/drivers/usb/usbip/usbip-host.ko@ge3.17
+  FILES :=$(LINUX_DIR)/drivers/usb/usbip/usbip-host.ko
   AUTOLOAD := $(call AutoProbe,usbip-host)
   $(call AddDepends/usb)
 endef
@@ -1546,17 +1615,24 @@ endef
 
 $(eval $(call KernelPackage,usbmon))
 
-XHCI_FILES := $(wildcard $(patsubst %,$(LINUX_DIR)/drivers/usb/host/%.ko,xhci-hcd xhci-pci xhci-plat-hcd))
+XHCI_MODULES := xhci-hcd xhci-pci xhci-plat-hcd
+ifdef CONFIG_TARGET_ramips_mt7621
+  XHCI_MODULES += xhci-mtk
+endif
+XHCI_FILES := $(wildcard $(patsubst %,$(LINUX_DIR)/drivers/usb/host/%.ko,$(XHCI_MODULES)))
 XHCI_AUTOLOAD := $(patsubst $(LINUX_DIR)/drivers/usb/host/%.ko,%,$(XHCI_FILES))
 
 define KernelPackage/usb3
   TITLE:=Support for USB3 controllers
-  DEPENDS:=+TARGET_omap:kmod-usb-phy-omap-usb3
+  DEPENDS:= \
+       +TARGET_bcm53xx:kmod-usb-bcma \
+       +TARGET_omap:kmod-usb-phy-omap-usb3
   KCONFIG:= \
        CONFIG_USB_XHCI_HCD \
        CONFIG_USB_XHCI_PCI \
        CONFIG_USB_XHCI_PLATFORM \
        CONFIG_USB_XHCI_MVEBU=y \
+       CONFIG_USB_XHCI_MTK \
        CONFIG_USB_XHCI_HCD_DEBUGGING=n
   FILES:= \
        $(XHCI_FILES)