developer | ceb4001 | 2022-07-07 17:30:32 +0800 | [diff] [blame] | 1 | From a30647e3152b03eeb65ce60b60cb52a2c0840d28 Mon Sep 17 00:00:00 2001 |
| 2 | From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 3 | Date: Thu, 7 Jul 2022 17:09:31 +0800 |
| 4 | Subject: [PATCH] mt76: add MT7986/MT7916/Besra & bin file mode support in |
| 5 | makefile |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 6 | |
developer | ceb4001 | 2022-07-07 17:30:32 +0800 | [diff] [blame] | 7 | Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 8 | --- |
developer | ceb4001 | 2022-07-07 17:30:32 +0800 | [diff] [blame] | 9 | Makefile | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- |
| 10 | 1 file changed, 76 insertions(+), 1 deletion(-) |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 11 | |
developer | 1bfe18b | 2022-07-13 16:05:35 +0800 | [diff] [blame] | 12 | diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile |
developer | ceb4001 | 2022-07-07 17:30:32 +0800 | [diff] [blame] | 13 | index 354449b..758546f 100644 |
developer | 1bfe18b | 2022-07-13 16:05:35 +0800 | [diff] [blame] | 14 | --- a/package/kernel/mt76/Makefile |
| 15 | +++ b/package/kernel/mt76/Makefile |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 16 | @@ -220,12 +220,20 @@ endef |
| 17 | |
| 18 | define KernelPackage/mt7915e |
| 19 | $(KernelPackage/mt76-default) |
| 20 | - TITLE:=MediaTek MT7915e wireless driver |
| 21 | + TITLE:=MediaTek MT7915e/MT7986/MT7916 wireless driver |
| 22 | DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT +@KERNEL_RELAY |
| 23 | FILES:= $(PKG_BUILD_DIR)/mt7915/mt7915e.ko |
| 24 | AUTOLOAD:=$(call AutoProbe,mt7915e) |
| 25 | endef |
| 26 | |
developer | 7800b8d | 2022-06-23 22:15:56 +0800 | [diff] [blame] | 27 | +define KernelPackage/besra |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 28 | + $(KernelPackage/mt76-default) |
| 29 | + TITLE:=MediaTek MT7902/MT7990 wireless driver |
developer | 3ef2333 | 2022-06-10 11:48:11 +0800 | [diff] [blame] | 30 | + DEPENDS+=@PCI_SUPPORT +kmod-mt76-core +kmod-mt76-connac +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT +@DRIVER_11BE_SUPPORT |
developer | 7800b8d | 2022-06-23 22:15:56 +0800 | [diff] [blame] | 31 | + FILES:= $(PKG_BUILD_DIR)/besra/besra.ko |
| 32 | + AUTOLOAD:=$(call AutoProbe,besra) |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 33 | +endef |
| 34 | + |
| 35 | define KernelPackage/mt7921-common |
| 36 | $(KernelPackage/mt76-default) |
| 37 | TITLE:=MediaTek MT7615 wireless driver common code |
| 38 | @@ -281,6 +289,11 @@ ifdef CONFIG_PACKAGE_MAC80211_MESH |
| 39 | NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH |
| 40 | endif |
| 41 | |
| 42 | +ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS |
| 43 | + NOSTDINC_FLAGS += -DCONFIG_MAC80211_DEBUGFS |
| 44 | + PKG_MAKE_FLAGS += CONFIG_MAC80211_DEBUGFS=y |
| 45 | +endif |
| 46 | + |
| 47 | ifdef CONFIG_PACKAGE_CFG80211_TESTMODE |
| 48 | NOSTDINC_FLAGS += -DCONFIG_NL80211_TESTMODE |
| 49 | PKG_MAKE_FLAGS += CONFIG_NL80211_TESTMODE=y |
| 50 | @@ -343,6 +356,13 @@ ifdef CONFIG_PACKAGE_kmod-mt7663u |
| 51 | endif |
| 52 | ifdef CONFIG_PACKAGE_kmod-mt7915e |
| 53 | PKG_MAKE_FLAGS += CONFIG_MT7915E=m |
| 54 | +ifdef CONFIG_TARGET_mediatek_mt7986 |
| 55 | + PKG_MAKE_FLAGS += CONFIG_MT7986_WMAC=y |
| 56 | + NOSTDINC_FLAGS += -DCONFIG_MT7986_WMAC |
| 57 | +endif |
| 58 | +endif |
developer | 7800b8d | 2022-06-23 22:15:56 +0800 | [diff] [blame] | 59 | +ifdef CONFIG_PACKAGE_kmod-besra |
| 60 | + PKG_MAKE_FLAGS += CONFIG_BESRA=m |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 61 | endif |
| 62 | ifdef CONFIG_PACKAGE_kmod-mt7921-common |
| 63 | PKG_MAKE_FLAGS += CONFIG_MT7921_COMMON=m |
developer | ceb4001 | 2022-07-07 17:30:32 +0800 | [diff] [blame] | 64 | @@ -447,9 +467,63 @@ define KernelPackage/mt7915e/install |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 65 | $(PKG_BUILD_DIR)/firmware/mt7915_wa.bin \ |
| 66 | $(PKG_BUILD_DIR)/firmware/mt7915_wm.bin \ |
| 67 | $(PKG_BUILD_DIR)/firmware/mt7915_rom_patch.bin \ |
| 68 | + $(PKG_BUILD_DIR)/firmware/mt7916_wa.bin \ |
| 69 | + $(PKG_BUILD_DIR)/firmware/mt7916_wm.bin \ |
| 70 | + $(PKG_BUILD_DIR)/firmware/mt7916_rom_patch.bin \ |
| 71 | + $(1)/lib/firmware/mediatek |
| 72 | +ifdef CONFIG_TARGET_mediatek_mt7986 |
| 73 | + cp \ |
| 74 | + $(PKG_BUILD_DIR)/firmware/mt7986_wa.bin \ |
| 75 | + $(PKG_BUILD_DIR)/firmware/mt7986_wm.bin \ |
| 76 | + $(PKG_BUILD_DIR)/firmware/mt7986_wm_mt7975.bin \ |
| 77 | + $(PKG_BUILD_DIR)/firmware/mt7986_rom_patch.bin \ |
| 78 | + $(PKG_BUILD_DIR)/firmware/mt7986_rom_patch_mt7975.bin \ |
developer | b11a539 | 2022-03-31 00:34:47 +0800 | [diff] [blame] | 79 | + $(1)/lib/firmware/mediatek |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 80 | +endif |
| 81 | + cp \ |
| 82 | + $(PKG_BUILD_DIR)/firmware/mt7916_eeprom.bin \ |
| 83 | + $(PKG_BUILD_DIR)/firmware/mt7915_eeprom.bin \ |
| 84 | + $(PKG_BUILD_DIR)/firmware/mt7915_eeprom_dbdc.bin \ |
developer | ceb4001 | 2022-07-07 17:30:32 +0800 | [diff] [blame] | 85 | + $(PKG_BUILD_DIR)/firmware/mt7916_binfile.bin \ |
| 86 | + $(PKG_BUILD_DIR)/firmware/mt7915_binfile.bin \ |
| 87 | + $(PKG_BUILD_DIR)/firmware/mt7915_binfile_dbdc.bin \ |
developer | b11a539 | 2022-03-31 00:34:47 +0800 | [diff] [blame] | 88 | $(1)/lib/firmware/mediatek |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 89 | +ifdef CONFIG_TARGET_mediatek_mt7986 |
| 90 | + cp \ |
| 91 | + $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7976_dual.bin \ |
| 92 | + $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7976.bin \ |
| 93 | + $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7976_dbdc.bin \ |
| 94 | + $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7975_dual.bin \ |
| 95 | + $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7975.bin \ |
developer | ceb4001 | 2022-07-07 17:30:32 +0800 | [diff] [blame] | 96 | + $(PKG_BUILD_DIR)/firmware/mt7986_binfile_mt7976_dual.bin \ |
| 97 | + $(PKG_BUILD_DIR)/firmware/mt7986_binfile_mt7976.bin \ |
| 98 | + $(PKG_BUILD_DIR)/firmware/mt7986_binfile_mt7976_dbdc.bin \ |
| 99 | + $(PKG_BUILD_DIR)/firmware/mt7986_binfile_mt7975_dual.bin \ |
| 100 | + $(PKG_BUILD_DIR)/firmware/mt7986_binfile_mt7975.bin \ |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 101 | + $(1)/lib/firmware/mediatek |
developer | b11a539 | 2022-03-31 00:34:47 +0800 | [diff] [blame] | 102 | +ifdef CONFIG_NET_MEDIATEK_SOC_WED |
| 103 | + cp \ |
| 104 | + $(PKG_BUILD_DIR)/firmware/mt7986_wo_0.bin \ |
| 105 | + $(PKG_BUILD_DIR)/firmware/mt7986_wo_1.bin \ |
| 106 | + $(1)/lib/firmware/mediatek |
| 107 | +endif |
developer | e786110 | 2022-04-04 18:16:16 +0800 | [diff] [blame] | 108 | +endif |
developer | b11a539 | 2022-03-31 00:34:47 +0800 | [diff] [blame] | 109 | endef |
| 110 | |
developer | 7800b8d | 2022-06-23 22:15:56 +0800 | [diff] [blame] | 111 | +ifdef CONFIG_PACKAGE_kmod-besra |
| 112 | +define KernelPackage/besra/install |
developer | b11a539 | 2022-03-31 00:34:47 +0800 | [diff] [blame] | 113 | + $(INSTALL_DIR) $(1)/lib/firmware/mediatek |
| 114 | + cp \ |
| 115 | + $(PKG_BUILD_DIR)/firmware/mt7902_wa.bin \ |
| 116 | + $(PKG_BUILD_DIR)/firmware/mt7902_wm.bin \ |
| 117 | + $(PKG_BUILD_DIR)/firmware/mt7902_rom_patch.bin \ |
| 118 | + $(PKG_BUILD_DIR)/firmware/mt7902_wf_rom.bin \ |
| 119 | + $(PKG_BUILD_DIR)/firmware/mt7902_wf_rom_sram.bin \ |
| 120 | + $(PKG_BUILD_DIR)/firmware/mt7902_eeprom.bin \ |
| 121 | + $(1)/lib/firmware/mediatek |
| 122 | +endef |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 123 | +endif |
developer | b11a539 | 2022-03-31 00:34:47 +0800 | [diff] [blame] | 124 | + |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 125 | define KernelPackage/mt7921e/install |
| 126 | $(INSTALL_DIR) $(1)/lib/firmware/mediatek |
developer | b11a539 | 2022-03-31 00:34:47 +0800 | [diff] [blame] | 127 | cp \ |
developer | ceb4001 | 2022-07-07 17:30:32 +0800 | [diff] [blame] | 128 | @@ -489,5 +563,6 @@ $(eval $(call KernelPackage,mt7921-common)) |
developer | b11a539 | 2022-03-31 00:34:47 +0800 | [diff] [blame] | 129 | $(eval $(call KernelPackage,mt7921u)) |
| 130 | $(eval $(call KernelPackage,mt7921s)) |
| 131 | $(eval $(call KernelPackage,mt7921e)) |
developer | 7800b8d | 2022-06-23 22:15:56 +0800 | [diff] [blame] | 132 | +$(eval $(call KernelPackage,besra)) |
developer | b11a539 | 2022-03-31 00:34:47 +0800 | [diff] [blame] | 133 | $(eval $(call KernelPackage,mt76)) |
| 134 | $(eval $(call BuildPackage,mt76-test)) |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 135 | -- |
developer | ceb4001 | 2022-07-07 17:30:32 +0800 | [diff] [blame] | 136 | 2.18.0 |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 137 | |