jh71x0: package USB support
authorZoltan HERPAI <wigyori@uid0.hu>
Wed, 23 Aug 2023 16:57:06 +0000 (16:57 +0000)
committerZoltan HERPAI <wigyori@uid0.hu>
Wed, 23 Aug 2023 17:00:34 +0000 (19:00 +0200)
The JH7110 needs to initialize USB after PCIe init, so we'll add
it as a module. Package CDNS3 support and the StarFive platform driver.
Currently only the jh71x0 uses the CDNS3 IP.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
package/kernel/linux/modules/usb.mk
target/linux/jh71x0/modules.mk

index 45efd7449f8db8ad04114e36190cf2513edb6237..40cf328c27124d96fc1142acef6618a7a8fe56e0 100644 (file)
@@ -459,6 +459,43 @@ endef
 $(eval $(call KernelPackage,usb-dwc2-pci))
 
 
+define KernelPackage/usb-cdns
+  TITLE:=Cadence USB USB controller driver
+  KCONFIG:= \
+       CONFIG_USB_CDNS_SUPPORT
+  FILES:= $(LINUX_DIR)/drivers/usb/cdns3/cdns-usb-common.ko
+  AUTOLOAD:=$(call AutoLoad,50,cdns-usb-common,1)
+  $(call AddDepends/usb)
+endef
+
+define KernelPackage/usb-cdns/description
+ This driver provides USB Device Controller support for the
+ Cadence USB Core
+endef
+
+$(eval $(call KernelPackage,usb-cdns))
+
+
+define KernelPackage/usb-cdns3
+  TITLE:=Cadence USB3 USB controller driver
+  DEPENDS:=+kmod-usb-cdns
+  KCONFIG:= \
+       CONFIG_USB_CDNS3 \
+       CONFIG_USB_CDNS3_GADGET=y \
+       CONFIG_USB_CDNS3_HOST=y
+  FILES:= $(LINUX_DIR)/drivers/usb/cdns3/cdns3.ko
+  AUTOLOAD:=$(call AutoLoad,54,cdns3,1)
+  $(call AddDepends/usb)
+endef
+
+define KernelPackage/usb-cdns3/description
+ This driver provides support for the Dual Role SuperSpeed
+ USB Controller based on the Cadence USB3 IP Core
+endef
+
+$(eval $(call KernelPackage,usb-cdns3))
+
+
 define KernelPackage/usb-dwc3
   TITLE:=DWC3 USB controller driver
   KCONFIG:= \
index 1aa932891ce24dad07079442bea18dcda0a99e2e..34bb6e2b8fdcc9ae87bbd7a28435c42289f65193 100644 (file)
@@ -1,4 +1,5 @@
 define KernelPackage/pcie-starfive
+  SUBMENU:=$(OTHER_MENU)
   TITLE:=JH7110 PCIe controller support
   DEPENDS:=@TARGET_jh71x0
   KCONFIG:=CONFIG_PCIE_STARFIVE
@@ -11,3 +12,20 @@ define KernelPackage/pcie-starfive/description
 endef
 
 $(eval $(call KernelPackage,pcie-starfive))
+
+
+define KernelPackage/usb-cdns3-starfive
+  TITLE:=Cadence USB3 StarFive USB driver
+  DEPENDS:=@TARGET_jh71x0 +kmod-usb-cdns3
+  KCONFIG:= CONFIG_USB_CDNS3_STARFIVE
+  FILES:= $(LINUX_DIR)/drivers/usb/cdns3/cdns3-starfive.ko
+  AUTOLOAD:=$(call AutoLoad,53,cdns3-starfive,1)
+  $(call AddDepends/usb)
+endef
+
+define KernelPackage/usb-cdns3-starfive/description
+ Add support for the Cadence USB3 controller found in StarFive SoCs.
+endef
+
+
+$(eval $(call KernelPackage,usb-cdns3-starfive))