mt76: update to the latest version, adds preliminary mt7615 support
[openwrt/staging/wigyori.git] / package / kernel / mt76 / Makefile
index ed9a986933d41c62f3639afc948093546b6005fe..89dcddc164ca4de552a6b7a56af5f5835264aaef 100644 (file)
@@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
 
 PKG_SOURCE_URL:=https://github.com/openwrt/mt76
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2018-11-21
-PKG_SOURCE_VERSION:=da666a74a605a44c8cc649fb1e8b8e59e86c9acf
-PKG_MIRROR_HASH:=b72510bc324ef28475951bda788af87a2a6902a40d779c861e8607e0e5e3f909
+PKG_SOURCE_DATE:=2019-06-25
+PKG_SOURCE_VERSION:=d680ab01cddd4aea1849363e0ef84df45d538fd5
+PKG_MIRROR_HASH:=be9deb1ed96cabf41010723caee9babf51ed3f70b31c48c63d649c85b07ab64e
 
 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
 PKG_BUILD_PARALLEL:=1
@@ -33,7 +33,7 @@ include $(INCLUDE_DIR)/package.mk
 define KernelPackage/mt76-default
   SUBMENU:=Wireless Drivers
   DEPENDS:= \
-       +kmod-mac80211 @!LINUX_3_18 \
+       +kmod-mac80211 \
        +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT
 endef
 
@@ -80,7 +80,7 @@ endef
 define KernelPackage/mt76x0-common
   $(KernelPackage/mt76-default)
   TITLE:=MediaTek MT76x0 wireless driver common code
-  DEPENDS+=+kmod-mt76x02-common +kmod-mt76x02-usb
+  DEPENDS+=+kmod-mt76x02-common
   HIDDEN:=1
   FILES:=$(PKG_BUILD_DIR)/mt76x0/mt76x0-common.ko
 endef
@@ -138,6 +138,15 @@ define KernelPackage/mt7603
   AUTOLOAD:=$(call AutoProbe,mt7603e)
 endef
 
+define KernelPackage/mt7615e
+  $(KernelPackage/mt76-default)
+  TITLE:=MediaTek MT7615 wireless driver
+  DEPENDS+=@PCI_SUPPORT +kmod-mt76-core
+  FILES:=\
+       $(PKG_BUILD_DIR)/mt7615/mt7615e.ko
+  AUTOLOAD:=$(call AutoProbe,mt7615e)
+endef
+
 NOSTDINC_FLAGS = \
        -I$(PKG_BUILD_DIR) \
        -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
@@ -181,6 +190,9 @@ endif
 ifdef CONFIG_PACKAGE_kmod-mt7603
   PKG_MAKE_FLAGS += CONFIG_MT7603E=m
 endif
+ifdef CONFIG_PACKAGE_kmod-mt7615e
+  PKG_MAKE_FLAGS += CONFIG_MT7615E=m
+endif
 
 define Build/Compile
        +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
@@ -233,6 +245,15 @@ define KernelPackage/mt7603/install
                $(1)/lib/firmware
 endef
 
+define KernelPackage/mt7615e/install
+       $(INSTALL_DIR) $(1)/lib/firmware
+       cp \
+               $(PKG_BUILD_DIR)/firmware/mt7615_cr4.bin \
+               $(PKG_BUILD_DIR)/firmware/mt7615_n9.bin \
+               $(PKG_BUILD_DIR)/firmware/mt7615_rom_patch.bin \
+               $(1)/lib/firmware
+endef
+
 $(eval $(call KernelPackage,mt76-core))
 $(eval $(call KernelPackage,mt76-usb))
 $(eval $(call KernelPackage,mt76x02-usb))
@@ -244,4 +265,5 @@ $(eval $(call KernelPackage,mt76x2-common))
 $(eval $(call KernelPackage,mt76x2u))
 $(eval $(call KernelPackage,mt76x2))
 $(eval $(call KernelPackage,mt7603))
+$(eval $(call KernelPackage,mt7615e))
 $(eval $(call KernelPackage,mt76))