mt76: add stand-alone MT7915 firmware package

The mt7915e driver supports MT7915, MT7916 and MT7986 chips. And Only
MT7915 series chips need the MT7915 firmware. To save storage, extract
them from the common code package and create a new package to provide
the firmware.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
This commit is contained in:
Shiji Yang 2022-12-17 12:50:52 +00:00 committed by AmadeusGhost
parent 5452b45dd6
commit 467b9218e6
3 changed files with 23 additions and 16 deletions

View File

@ -218,6 +218,12 @@ define KernelPackage/mt7663u
AUTOLOAD:=$(call AutoProbe,mt7663u) AUTOLOAD:=$(call AutoProbe,mt7663u)
endef endef
define KernelPackage/mt7915-firmware
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7915 firmware
DEPENDS+=+kmod-mt7915e
endef
define KernelPackage/mt7915e define KernelPackage/mt7915e
$(KernelPackage/mt76-default) $(KernelPackage/mt76-default)
TITLE:=MediaTek MT7915e wireless driver TITLE:=MediaTek MT7915e wireless driver
@ -467,7 +473,7 @@ define KernelPackage/mt7663-firmware-sta/install
$(1)/lib/firmware/mediatek $(1)/lib/firmware/mediatek
endef endef
define KernelPackage/mt7915e/install define KernelPackage/mt7915-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/mediatek $(INSTALL_DIR) $(1)/lib/firmware/mediatek
cp \ cp \
$(PKG_BUILD_DIR)/firmware/mt7915_wa.bin \ $(PKG_BUILD_DIR)/firmware/mt7915_wa.bin \
@ -540,6 +546,7 @@ $(eval $(call KernelPackage,mt7663-firmware-sta))
$(eval $(call KernelPackage,mt7663-usb-sdio)) $(eval $(call KernelPackage,mt7663-usb-sdio))
$(eval $(call KernelPackage,mt7663u)) $(eval $(call KernelPackage,mt7663u))
$(eval $(call KernelPackage,mt7663s)) $(eval $(call KernelPackage,mt7663s))
$(eval $(call KernelPackage,mt7915-firmware))
$(eval $(call KernelPackage,mt7915e)) $(eval $(call KernelPackage,mt7915e))
$(eval $(call KernelPackage,mt7916-firmware)) $(eval $(call KernelPackage,mt7916-firmware))
$(eval $(call KernelPackage,mt7986-firmware)) $(eval $(call KernelPackage,mt7986-firmware))

View File

@ -158,7 +158,7 @@ define Device/elecom_wrc-x3200gst3
elecom-wrc-gs-factory WRC-X3200GST3 0.00 -N | \ elecom-wrc-gs-factory WRC-X3200GST3 0.00 -N | \
append-string MT7622_ELECOM_WRC-X3200GST3 append-string MT7622_ELECOM_WRC-X3200GST3
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
endef endef
TARGET_DEVICES += elecom_wrc-x3200gst3 TARGET_DEVICES += elecom_wrc-x3200gst3
@ -169,7 +169,7 @@ define Device/linksys_e8450
DEVICE_ALT0_MODEL := RT3200 DEVICE_ALT0_MODEL := RT3200
DEVICE_DTS := mt7622-linksys-e8450 DEVICE_DTS := mt7622-linksys-e8450
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e kmod-usb3 DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3
endef endef
TARGET_DEVICES += linksys_e8450 TARGET_DEVICES += linksys_e8450
@ -182,7 +182,7 @@ define Device/linksys_e8450-ubi
DEVICE_ALT0_VARIANT := UBI DEVICE_ALT0_VARIANT := UBI
DEVICE_DTS := mt7622-linksys-e8450-ubi DEVICE_DTS := mt7622-linksys-e8450-ubi
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e kmod-usb3 DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3
UBINIZE_OPTS := -E 5 UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k BLOCKSIZE := 128k
PAGESIZE := 2048 PAGESIZE := 2048
@ -233,7 +233,7 @@ define Device/ruijie_rg-ew3200gx-pro
DEVICE_MODEL := RG-EW3200GX PRO DEVICE_MODEL := RG-EW3200GX PRO
DEVICE_DTS := mt7622-ruijie-rg-ew3200gx-pro DEVICE_DTS := mt7622-ruijie-rg-ew3200gx-pro
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
endef endef
TARGET_DEVICES += ruijie_rg-ew3200gx-pro TARGET_DEVICES += ruijie_rg-ew3200gx-pro
@ -254,7 +254,7 @@ define Device/ubnt_unifi-6-lr-v1
DEVICE_DTS_CONFIG := config@1 DEVICE_DTS_CONFIG := config@1
DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v1 DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v1
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e kmod-leds-ubnt-ledbar DEVICE_PACKAGES := kmod-mt7915-firmware kmod-leds-ubnt-ledbar
SUPPORTED_DEVICES += ubnt,unifi-6-lr SUPPORTED_DEVICES += ubnt,unifi-6-lr
endef endef
TARGET_DEVICES += ubnt_unifi-6-lr-v1 TARGET_DEVICES += ubnt_unifi-6-lr-v1
@ -265,7 +265,7 @@ define Device/ubnt_unifi-6-lr-v1-ubootmod
DEVICE_VARIANT := v1 U-Boot mod DEVICE_VARIANT := v1 U-Boot mod
DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v1-ubootmod DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v1-ubootmod
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e kmod-leds-ubnt-ledbar DEVICE_PACKAGES := kmod-mt7915-firmware kmod-leds-ubnt-ledbar
KERNEL := kernel-bin | lzma KERNEL := kernel-bin | lzma
KERNEL_INITRAMFS_SUFFIX := -recovery.itb KERNEL_INITRAMFS_SUFFIX := -recovery.itb
KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
@ -285,7 +285,7 @@ define Device/ubnt_unifi-6-lr-v2
DEVICE_DTS_CONFIG := config@1 DEVICE_DTS_CONFIG := config@1
DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v2 DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v2
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
endef endef
TARGET_DEVICES += ubnt_unifi-6-lr-v2 TARGET_DEVICES += ubnt_unifi-6-lr-v2
@ -295,7 +295,7 @@ define Device/ubnt_unifi-6-lr-v2-ubootmod
DEVICE_VARIANT := v2 U-Boot mod DEVICE_VARIANT := v2 U-Boot mod
DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v2-ubootmod DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v2-ubootmod
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
KERNEL := kernel-bin | lzma KERNEL := kernel-bin | lzma
KERNEL_INITRAMFS_SUFFIX := -recovery.itb KERNEL_INITRAMFS_SUFFIX := -recovery.itb
KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
@ -315,7 +315,7 @@ define Device/xiaomi_redmi-router-ax6s
DEVICE_DTS := mt7622-xiaomi-redmi-router-ax6s DEVICE_DTS := mt7622-xiaomi-redmi-router-ax6s
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
BOARD_NAME := xiaomi,redmi-router-ax6s BOARD_NAME := xiaomi,redmi-router-ax6s
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
UBINIZE_OPTS := -E 5 UBINIZE_OPTS := -E 5
IMAGES += factory.bin IMAGES += factory.bin
BLOCKSIZE := 128k BLOCKSIZE := 128k

View File

@ -392,7 +392,7 @@ define Device/c-life_xg1
check-size check-size
DEVICE_VENDOR := C-Life DEVICE_VENDOR := C-Life
DEVICE_MODEL := XG1 DEVICE_MODEL := XG1
DEVICE_PACKAGES := kmod-mt7915e uboot-envtools kmod-usb3 DEVICE_PACKAGES := kmod-mt7915-firmware uboot-envtools kmod-usb3
endef endef
TARGET_DEVICES += c-life_xg1 TARGET_DEVICES += c-life_xg1
@ -952,7 +952,7 @@ define Device/jcg_q20
check-size check-size
DEVICE_VENDOR := JCG DEVICE_VENDOR := JCG
DEVICE_MODEL := Q20 DEVICE_MODEL := Q20
DEVICE_PACKAGES := kmod-mt7915e uboot-envtools DEVICE_PACKAGES := kmod-mt7915-firmware uboot-envtools
endef endef
TARGET_DEVICES += jcg_q20 TARGET_DEVICES += jcg_q20
@ -1446,7 +1446,7 @@ define Device/tenbay_t-mb5eu-v01
DEVICE_VENDOR := Tenbay DEVICE_VENDOR := Tenbay
DEVICE_MODEL := T-MB5EU-V01 DEVICE_MODEL := T-MB5EU-V01
DEVICE_DTS_CONFIG := config@1 DEVICE_DTS_CONFIG := config@1
DEVICE_PACKAGES += kmod-mt7915e kmod-usb3 DEVICE_PACKAGES += kmod-mt7915-firmware kmod-usb3
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
IMAGE_SIZE := 15808k IMAGE_SIZE := 15808k
SUPPORTED_DEVICES += mt7621-dm2-t-mb5eu-v01-nor SUPPORTED_DEVICES += mt7621-dm2-t-mb5eu-v01-nor
@ -1480,7 +1480,7 @@ define Device/totolink_x5000r
UIMAGE_NAME := C8343R-9999 UIMAGE_NAME := C8343R-9999
DEVICE_VENDOR := TOTOLINK DEVICE_VENDOR := TOTOLINK
DEVICE_MODEL := X5000R DEVICE_MODEL := X5000R
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
endef endef
TARGET_DEVICES += totolink_x5000r TARGET_DEVICES += totolink_x5000r
@ -1604,7 +1604,7 @@ define Device/ubnt_unifi-6-lite
DEVICE_VENDOR := Ubiquiti DEVICE_VENDOR := Ubiquiti
DEVICE_MODEL := UniFi 6 Lite DEVICE_MODEL := UniFi 6 Lite
DEVICE_DTS_CONFIG := config@1 DEVICE_DTS_CONFIG := config@1
DEVICE_PACKAGES += kmod-mt7603 kmod-mt7915e DEVICE_PACKAGES += kmod-mt7603 kmod-mt7915-firmware
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
IMAGE_SIZE := 15424k IMAGE_SIZE := 15424k
endef endef
@ -1802,7 +1802,7 @@ define Device/xiaomi_mi-router-cr660x
check-size check-size
DEVICE_VENDOR := Xiaomi DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := Mi Router CR660x DEVICE_MODEL := Mi Router CR660x
DEVICE_PACKAGES += kmod-mt7915e wpad-openssl uboot-envtools DEVICE_PACKAGES += kmod-mt7915-firmware wpad-openssl uboot-envtools
SUPPORTED_DEVICES += xiaomi,mi-router-cr6606 SUPPORTED_DEVICES += xiaomi,mi-router-cr6606
endef endef
TARGET_DEVICES += xiaomi_mi-router-cr660x TARGET_DEVICES += xiaomi_mi-router-cr660x