mt76: add firmware package for mt7916
authorAndrew Powers-Holmes <aholmes@omnom.net>
Tue, 1 Nov 2022 06:06:32 +0000 (17:06 +1100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 27 Nov 2022 14:43:08 +0000 (15:43 +0100)
Add kernel package 'mt7916-firmware' with firmware files for MT7916E devices.

These share the same driver as the MT7915 chipset, but use their own firmware.

Tested using a pair of AsiaRF AW7916-NPD cards.

Signed-off-by: Andrew Powers-Holmes <aholmes@omnom.net>
(cherry picked from commit 94d0cb9d2ec23fb15acd1fc17a351983f8771d13)

package/kernel/mt76/Makefile

index a18cca73a973d363b9b24d775f6698d70a310238..d135bb8077705d51a049d7d72f138aca5bc59f10 100644 (file)
@@ -226,6 +226,12 @@ define KernelPackage/mt7915e
   AUTOLOAD:=$(call AutoProbe,mt7915e)
 endef
 
+define KernelPackage/mt7916-firmware
+  $(KernelPackage/mt76-default)
+  DEPENDS+=+kmod-mt7915e
+  TITLE:=MediaTek MT7916 firmware
+endef
+
 define KernelPackage/mt7921-common
   $(KernelPackage/mt76-default)
   TITLE:=MediaTek MT7615 wireless driver common code
@@ -450,6 +456,15 @@ define KernelPackage/mt7915e/install
                $(1)/lib/firmware/mediatek
 endef
 
+define KernelPackage/mt7916-firmware/install
+       $(INSTALL_DIR) $(1)/lib/firmware/mediatek
+       cp \
+               $(PKG_BUILD_DIR)/firmware/mt7916_wa.bin \
+               $(PKG_BUILD_DIR)/firmware/mt7916_wm.bin \
+               $(PKG_BUILD_DIR)/firmware/mt7916_rom_patch.bin \
+               $(1)/lib/firmware/mediatek
+endef
+
 define KernelPackage/mt7921e/install
        $(INSTALL_DIR) $(1)/lib/firmware/mediatek
        cp \
@@ -485,6 +500,7 @@ $(eval $(call KernelPackage,mt7663-usb-sdio))
 $(eval $(call KernelPackage,mt7663u))
 $(eval $(call KernelPackage,mt7663s))
 $(eval $(call KernelPackage,mt7915e))
+$(eval $(call KernelPackage,mt7916-firmware))
 $(eval $(call KernelPackage,mt7921-common))
 $(eval $(call KernelPackage,mt7921u))
 $(eval $(call KernelPackage,mt7921s))