developer | 293afb5 | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 1 | From a01e3dd6b0419aaa70bafc5bcd40030b91f8604d Mon Sep 17 00:00:00 2001 |
| 2 | From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 3 | Date: Mon, 14 Nov 2022 14:21:43 +0800 |
| 4 | Subject: [PATCH] master mt76 makefile for new chip |
| 5 | |
| 6 | Change-Id: I0271373cf1d5f23874aca94360d9a5a253e7c109 |
| 7 | --- |
| 8 | package/kernel/mt76/Makefile | 84 ++++++++++++++++++++++++++++++++++-- |
| 9 | 1 file changed, 81 insertions(+), 3 deletions(-) |
| 10 | |
developer | ef832a5 | 2022-07-13 16:05:35 +0800 | [diff] [blame] | 11 | diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile |
developer | 293afb5 | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 12 | index 4b9a8885..3d71a487 100644 |
developer | ef832a5 | 2022-07-13 16:05:35 +0800 | [diff] [blame] | 13 | --- a/package/kernel/mt76/Makefile |
| 14 | +++ b/package/kernel/mt76/Makefile |
developer | 1ee54d0 | 2022-08-30 13:15:07 +0800 | [diff] [blame] | 15 | @@ -220,7 +220,7 @@ endef |
developer | 6b966f5 | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 16 | |
| 17 | define KernelPackage/mt7915e |
| 18 | $(KernelPackage/mt76-default) |
| 19 | - TITLE:=MediaTek MT7915e wireless driver |
| 20 | + TITLE:=MediaTek MT7915e/MT7986/MT7916 wireless driver |
| 21 | DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT +@KERNEL_RELAY |
| 22 | FILES:= $(PKG_BUILD_DIR)/mt7915/mt7915e.ko |
| 23 | AUTOLOAD:=$(call AutoProbe,mt7915e) |
developer | 293afb5 | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 24 | @@ -234,10 +234,26 @@ endef |
developer | 1ee54d0 | 2022-08-30 13:15:07 +0800 | [diff] [blame] | 25 | |
| 26 | define KernelPackage/mt7986-firmware |
| 27 | $(KernelPackage/mt76-default) |
| 28 | - DEPENDS:=@TARGET_mediatek_filogic |
| 29 | + DEPENDS:=+@TARGET_mediatek_mt7986 |
| 30 | TITLE:=MediaTek MT7986 firmware |
developer | 6b966f5 | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 31 | endef |
| 32 | |
developer | cbf91b3 | 2022-06-23 22:15:56 +0800 | [diff] [blame] | 33 | +define KernelPackage/besra |
developer | 6b966f5 | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 34 | + $(KernelPackage/mt76-default) |
| 35 | + TITLE:=MediaTek MT7902/MT7990 wireless driver |
developer | b237e3a | 2022-06-10 11:48:11 +0800 | [diff] [blame] | 36 | + DEPENDS+=@PCI_SUPPORT +kmod-mt76-core +kmod-mt76-connac +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT +@DRIVER_11BE_SUPPORT |
developer | cbf91b3 | 2022-06-23 22:15:56 +0800 | [diff] [blame] | 37 | + FILES:= $(PKG_BUILD_DIR)/besra/besra.ko |
| 38 | + AUTOLOAD:=$(call AutoProbe,besra) |
developer | 6b966f5 | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 39 | +endef |
| 40 | + |
developer | d693fb5 | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 41 | +define KernelPackage/mt7996e |
| 42 | + $(KernelPackage/mt76-default) |
| 43 | + TITLE:=MediaTek MT7996/MT7995/MT7919 wireless driver |
developer | 5a96bf9 | 2022-11-08 00:25:27 +0800 | [diff] [blame] | 44 | + DEPENDS+=@PCI_SUPPORT +kmod-mt76-core +kmod-mt76-connac +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT +@DRIVER_11BE_SUPPORT |
developer | d693fb5 | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 45 | + FILES:= $(PKG_BUILD_DIR)/mt7996/mt7996e.ko |
| 46 | + AUTOLOAD:=$(call AutoProbe,mt7996e) |
| 47 | +endef |
| 48 | + |
developer | 293afb5 | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 49 | define KernelPackage/mt7921-firmware |
developer | 6b966f5 | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 50 | $(KernelPackage/mt76-default) |
developer | 293afb5 | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 51 | TITLE:=MediaTek MT7921 firmware |
| 52 | @@ -298,6 +314,11 @@ ifdef CONFIG_PACKAGE_MAC80211_MESH |
developer | 6b966f5 | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 53 | NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH |
| 54 | endif |
| 55 | |
| 56 | +ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS |
| 57 | + NOSTDINC_FLAGS += -DCONFIG_MAC80211_DEBUGFS |
| 58 | + PKG_MAKE_FLAGS += CONFIG_MAC80211_DEBUGFS=y |
| 59 | +endif |
| 60 | + |
| 61 | ifdef CONFIG_PACKAGE_CFG80211_TESTMODE |
| 62 | NOSTDINC_FLAGS += -DCONFIG_NL80211_TESTMODE |
| 63 | PKG_MAKE_FLAGS += CONFIG_NL80211_TESTMODE=y |
developer | 293afb5 | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 64 | @@ -360,11 +381,17 @@ ifdef CONFIG_PACKAGE_kmod-mt7663u |
developer | 6b966f5 | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 65 | endif |
| 66 | ifdef CONFIG_PACKAGE_kmod-mt7915e |
| 67 | PKG_MAKE_FLAGS += CONFIG_MT7915E=m |
developer | 1ee54d0 | 2022-08-30 13:15:07 +0800 | [diff] [blame] | 68 | - ifdef CONFIG_TARGET_mediatek_filogic |
| 69 | + ifdef CONFIG_TARGET_mediatek_mt7986 |
| 70 | PKG_MAKE_FLAGS += CONFIG_MT7986_WMAC=y |
| 71 | NOSTDINC_FLAGS += -DCONFIG_MT7986_WMAC |
| 72 | endif |
| 73 | endif |
developer | cbf91b3 | 2022-06-23 22:15:56 +0800 | [diff] [blame] | 74 | +ifdef CONFIG_PACKAGE_kmod-besra |
| 75 | + PKG_MAKE_FLAGS += CONFIG_BESRA=m |
developer | 1ee54d0 | 2022-08-30 13:15:07 +0800 | [diff] [blame] | 76 | +endif |
developer | d693fb5 | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 77 | +ifdef CONFIG_PACKAGE_kmod-mt7996e |
| 78 | + PKG_MAKE_FLAGS += CONFIG_MT7996E=m |
| 79 | +endif |
developer | 6b966f5 | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 80 | ifdef CONFIG_PACKAGE_kmod-mt7921-common |
| 81 | PKG_MAKE_FLAGS += CONFIG_MT7921_COMMON=m |
developer | 1ee54d0 | 2022-08-30 13:15:07 +0800 | [diff] [blame] | 82 | endif |
developer | 293afb5 | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 83 | @@ -468,6 +495,12 @@ define KernelPackage/mt7915e/install |
developer | 6b966f5 | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 84 | $(PKG_BUILD_DIR)/firmware/mt7915_wa.bin \ |
| 85 | $(PKG_BUILD_DIR)/firmware/mt7915_wm.bin \ |
| 86 | $(PKG_BUILD_DIR)/firmware/mt7915_rom_patch.bin \ |
| 87 | + $(PKG_BUILD_DIR)/firmware/mt7916_wa.bin \ |
| 88 | + $(PKG_BUILD_DIR)/firmware/mt7916_wm.bin \ |
| 89 | + $(PKG_BUILD_DIR)/firmware/mt7916_rom_patch.bin \ |
developer | 6b966f5 | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 90 | + $(PKG_BUILD_DIR)/firmware/mt7916_eeprom.bin \ |
| 91 | + $(PKG_BUILD_DIR)/firmware/mt7915_eeprom.bin \ |
| 92 | + $(PKG_BUILD_DIR)/firmware/mt7915_eeprom_dbdc.bin \ |
developer | 1609265 | 2022-03-31 00:34:47 +0800 | [diff] [blame] | 93 | $(1)/lib/firmware/mediatek |
developer | 1ee54d0 | 2022-08-30 13:15:07 +0800 | [diff] [blame] | 94 | endef |
| 95 | |
developer | 293afb5 | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 96 | @@ -490,8 +523,51 @@ define KernelPackage/mt7986-firmware/install |
developer | 1ee54d0 | 2022-08-30 13:15:07 +0800 | [diff] [blame] | 97 | $(PKG_BUILD_DIR)/firmware/mt7986_rom_patch.bin \ |
| 98 | $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7975_dual.bin \ |
| 99 | $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7976_dual.bin \ |
| 100 | + $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7975.bin \ |
developer | 6b966f5 | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 101 | + $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7976.bin \ |
| 102 | + $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7976_dbdc.bin \ |
developer | 293afb5 | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 103 | + $(1)/lib/firmware/mediatek |
developer | 1609265 | 2022-03-31 00:34:47 +0800 | [diff] [blame] | 104 | +ifdef CONFIG_NET_MEDIATEK_SOC_WED |
| 105 | + cp \ |
| 106 | + $(PKG_BUILD_DIR)/firmware/mt7986_wo_0.bin \ |
| 107 | + $(PKG_BUILD_DIR)/firmware/mt7986_wo_1.bin \ |
developer | 293afb5 | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 108 | $(1)/lib/firmware/mediatek |
developer | 049f58d | 2022-04-04 18:16:16 +0800 | [diff] [blame] | 109 | +endif |
developer | 293afb5 | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 110 | +endef |
| 111 | + |
developer | cbf91b3 | 2022-06-23 22:15:56 +0800 | [diff] [blame] | 112 | +ifdef CONFIG_PACKAGE_kmod-besra |
| 113 | +define KernelPackage/besra/install |
developer | 98a8ac8 | 2022-11-08 22:17:56 +0800 | [diff] [blame] | 114 | + $(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7996 |
developer | 1609265 | 2022-03-31 00:34:47 +0800 | [diff] [blame] | 115 | + cp \ |
developer | 98a8ac8 | 2022-11-08 22:17:56 +0800 | [diff] [blame] | 116 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_wa.bin \ |
| 117 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_wm.bin \ |
| 118 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_rom_patch.bin \ |
| 119 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_wf_rom.bin \ |
| 120 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_wf_rom_sram.bin \ |
| 121 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_eeprom.bin \ |
| 122 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_wm_7977.bin \ |
| 123 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_wf_rom_7977.bin \ |
| 124 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_wf_rom_sram_7977.bin \ |
| 125 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_eeprom_7977.bin \ |
| 126 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wa.bin \ |
| 127 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wm.bin \ |
| 128 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_rom_patch.bin \ |
| 129 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_eeprom.bin \ |
| 130 | + $(1)/lib/firmware/mediatek/mt7996 |
developer | d693fb5 | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 131 | +endef |
| 132 | +endif |
| 133 | + |
| 134 | +ifdef CONFIG_PACKAGE_kmod-mt7996e |
| 135 | +define KernelPackage/mt7996e/install |
developer | 98a8ac8 | 2022-11-08 22:17:56 +0800 | [diff] [blame] | 136 | + $(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7996 |
developer | d693fb5 | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 137 | + cp \ |
developer | 98a8ac8 | 2022-11-08 22:17:56 +0800 | [diff] [blame] | 138 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wa.bin \ |
| 139 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wm.bin \ |
| 140 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_rom_patch.bin \ |
| 141 | + $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_eeprom.bin \ |
| 142 | + $(1)/lib/firmware/mediatek/mt7996 |
developer | 293afb5 | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 143 | endef |
developer | 6b966f5 | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 144 | +endif |
developer | 293afb5 | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 145 | |
| 146 | define KernelPackage/mt7921-firmware/install |
developer | 6b966f5 | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 147 | $(INSTALL_DIR) $(1)/lib/firmware/mediatek |
developer | 293afb5 | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 148 | @@ -535,5 +611,7 @@ $(eval $(call KernelPackage,mt7921-common)) |
developer | 1609265 | 2022-03-31 00:34:47 +0800 | [diff] [blame] | 149 | $(eval $(call KernelPackage,mt7921u)) |
| 150 | $(eval $(call KernelPackage,mt7921s)) |
| 151 | $(eval $(call KernelPackage,mt7921e)) |
developer | d693fb5 | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 152 | +$(eval $(call KernelPackage,mt7996e)) |
developer | cbf91b3 | 2022-06-23 22:15:56 +0800 | [diff] [blame] | 153 | +$(eval $(call KernelPackage,besra)) |
developer | 1609265 | 2022-03-31 00:34:47 +0800 | [diff] [blame] | 154 | $(eval $(call KernelPackage,mt76)) |
| 155 | $(eval $(call BuildPackage,mt76-test)) |
developer | 6b966f5 | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 156 | -- |
developer | 293afb5 | 2022-11-14 10:25:04 +0800 | [diff] [blame] | 157 | 2.18.0 |
developer | 6b966f5 | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 158 | |