Skip to content

Commit

Permalink
mt76: add stand-alone MT7622 firmware package
Browse files Browse the repository at this point in the history
Add a separate firmware package to avoid installing the MT7615 firmware
on all MT7622 target devices by default. Now we only add MT7615 firmware
packages for devices that use MT7615E. This commit also removes the
explicit dependency on kmod-mt7615e to refine the package dependency.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
  • Loading branch information
DragonBluep authored and hauke committed Jan 7, 2023
1 parent fc9dd3f commit 9a07895
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 69 deletions.
20 changes: 16 additions & 4 deletions package/kernel/mt76/Makefile
Expand Up @@ -171,7 +171,7 @@ endef
define KernelPackage/mt7615-firmware
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7615e firmware
DEFAULT:=PACKAGE_kmod-mt7615e
DEPENDS+=+kmod-mt7615e
endef

define KernelPackage/mt7615e
Expand All @@ -182,6 +182,12 @@ define KernelPackage/mt7615e
AUTOLOAD:=$(call AutoProbe,mt7615e)
endef

define KernelPackage/mt7622-firmware
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7622 firmware
DEPENDS+=+kmod-mt7615e
endef

define KernelPackage/mt7663-firmware-ap
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7663e firmware (optimized for AP)
Expand Down Expand Up @@ -445,9 +451,14 @@ define KernelPackage/mt7615-firmware/install
$(PKG_BUILD_DIR)/firmware/mt7615_cr4.bin \
$(PKG_BUILD_DIR)/firmware/mt7615_n9.bin \
$(PKG_BUILD_DIR)/firmware/mt7615_rom_patch.bin \
$(if $(CONFIG_TARGET_mediatek_mt7622), \
$(PKG_BUILD_DIR)/firmware/mt7622_n9.bin \
$(PKG_BUILD_DIR)/firmware/mt7622_rom_patch.bin) \
$(1)/lib/firmware/mediatek
endef

define KernelPackage/mt7622-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/mediatek
cp \
$(PKG_BUILD_DIR)/firmware/mt7622_n9.bin \
$(PKG_BUILD_DIR)/firmware/mt7622_rom_patch.bin \
$(1)/lib/firmware/mediatek
endef

Expand Down Expand Up @@ -526,6 +537,7 @@ $(eval $(call KernelPackage,mt76-connac))
$(eval $(call KernelPackage,mt76-sdio))
$(eval $(call KernelPackage,mt7615-common))
$(eval $(call KernelPackage,mt7615-firmware))
$(eval $(call KernelPackage,mt7622-firmware))
$(eval $(call KernelPackage,mt7615e))
$(eval $(call KernelPackage,mt7663-firmware-ap))
$(eval $(call KernelPackage,mt7663-firmware-sta))
Expand Down
6 changes: 3 additions & 3 deletions target/linux/mediatek/image/mt7622.mk
Expand Up @@ -129,7 +129,7 @@ define Device/buffalo_wsr-2533dhp2
IMAGE/sysupgrade.bin := append-kernel | \
buffalo-kernel-trx 0x32504844 $(KDIR)/tmp/$$(DEVICE_NAME).null | \
sysupgrade-tar kernel=$$$$@ | append-metadata
DEVICE_PACKAGES := swconfig
DEVICE_PACKAGES := kmod-mt7615-firmware swconfig
endef
TARGET_DEVICES += buffalo_wsr-2533dhp2

Expand All @@ -138,7 +138,7 @@ define Device/elecom_wrc-2533gent
DEVICE_MODEL := WRC-2533GENT
DEVICE_DTS := mt7622-elecom-wrc-2533gent
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-btmtkuart kmod-usb3 swconfig
DEVICE_PACKAGES := kmod-btmtkuart kmod-mt7615-firmware kmod-usb3 swconfig
endef
TARGET_DEVICES += elecom_wrc-2533gent

Expand Down Expand Up @@ -251,7 +251,7 @@ define Device/totolink_a8000ru
DEVICE_MODEL := A8000RU
DEVICE_DTS := mt7622-totolink-a8000ru
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := swconfig
DEVICE_PACKAGES := kmod-mt7615-firmware swconfig
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += totolink_a8000ru
Expand Down
2 changes: 1 addition & 1 deletion target/linux/mediatek/mt7622/target.mk
Expand Up @@ -2,7 +2,7 @@ ARCH:=aarch64
SUBTARGET:=mt7622
BOARDNAME:=MT7622
CPU_TYPE:=cortex-a53
DEFAULT_PACKAGES += kmod-mt7615e kmod-mt7615-firmware wpad-basic-wolfssl uboot-envtools
DEFAULT_PACKAGES += kmod-mt7622-firmware wpad-basic-wolfssl uboot-envtools
KERNELNAME:=Image dtbs

define Target/Description
Expand Down

0 comments on commit 9a07895

Please sign in to comment.