blob: ec673f07bc4ca0940175a0a62bab689348261146 [file] [log] [blame]
developerceb40012022-07-07 17:30:32 +08001From a30647e3152b03eeb65ce60b60cb52a2c0840d28 Mon Sep 17 00:00:00 2001
2From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
3Date: Thu, 7 Jul 2022 17:09:31 +0800
4Subject: [PATCH] mt76: add MT7986/MT7916/Besra & bin file mode support in
5 makefile
developer2cf5f9a2022-03-25 02:46:17 +08006
developerceb40012022-07-07 17:30:32 +08007Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
developer2cf5f9a2022-03-25 02:46:17 +08008---
developerceb40012022-07-07 17:30:32 +08009 Makefile | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
10 1 file changed, 76 insertions(+), 1 deletion(-)
developer2cf5f9a2022-03-25 02:46:17 +080011
developer1bfe18b2022-07-13 16:05:35 +080012diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
developerceb40012022-07-07 17:30:32 +080013index 354449b..758546f 100644
developer1bfe18b2022-07-13 16:05:35 +080014--- a/package/kernel/mt76/Makefile
15+++ b/package/kernel/mt76/Makefile
developer2cf5f9a2022-03-25 02:46:17 +080016@@ -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
developer7800b8d2022-06-23 22:15:56 +080027+define KernelPackage/besra
developer2cf5f9a2022-03-25 02:46:17 +080028+ $(KernelPackage/mt76-default)
29+ TITLE:=MediaTek MT7902/MT7990 wireless driver
developer3ef23332022-06-10 11:48:11 +080030+ DEPENDS+=@PCI_SUPPORT +kmod-mt76-core +kmod-mt76-connac +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT +@DRIVER_11BE_SUPPORT
developer7800b8d2022-06-23 22:15:56 +080031+ FILES:= $(PKG_BUILD_DIR)/besra/besra.ko
32+ AUTOLOAD:=$(call AutoProbe,besra)
developer2cf5f9a2022-03-25 02:46:17 +080033+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
developer7800b8d2022-06-23 22:15:56 +080059+ifdef CONFIG_PACKAGE_kmod-besra
60+ PKG_MAKE_FLAGS += CONFIG_BESRA=m
developer2cf5f9a2022-03-25 02:46:17 +080061 endif
62 ifdef CONFIG_PACKAGE_kmod-mt7921-common
63 PKG_MAKE_FLAGS += CONFIG_MT7921_COMMON=m
developerceb40012022-07-07 17:30:32 +080064@@ -447,9 +467,63 @@ define KernelPackage/mt7915e/install
developer2cf5f9a2022-03-25 02:46:17 +080065 $(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 \
developerb11a5392022-03-31 00:34:47 +080079+ $(1)/lib/firmware/mediatek
developer2cf5f9a2022-03-25 02:46:17 +080080+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 \
developerceb40012022-07-07 17:30:32 +080085+ $(PKG_BUILD_DIR)/firmware/mt7916_binfile.bin \
86+ $(PKG_BUILD_DIR)/firmware/mt7915_binfile.bin \
87+ $(PKG_BUILD_DIR)/firmware/mt7915_binfile_dbdc.bin \
developerb11a5392022-03-31 00:34:47 +080088 $(1)/lib/firmware/mediatek
developer2cf5f9a2022-03-25 02:46:17 +080089+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 \
developerceb40012022-07-07 17:30:32 +080096+ $(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 \
developer2cf5f9a2022-03-25 02:46:17 +0800101+ $(1)/lib/firmware/mediatek
developerb11a5392022-03-31 00:34:47 +0800102+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
developere7861102022-04-04 18:16:16 +0800108+endif
developerb11a5392022-03-31 00:34:47 +0800109 endef
110
developer7800b8d2022-06-23 22:15:56 +0800111+ifdef CONFIG_PACKAGE_kmod-besra
112+define KernelPackage/besra/install
developerb11a5392022-03-31 00:34:47 +0800113+ $(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
developer2cf5f9a2022-03-25 02:46:17 +0800123+endif
developerb11a5392022-03-31 00:34:47 +0800124+
developer2cf5f9a2022-03-25 02:46:17 +0800125 define KernelPackage/mt7921e/install
126 $(INSTALL_DIR) $(1)/lib/firmware/mediatek
developerb11a5392022-03-31 00:34:47 +0800127 cp \
developerceb40012022-07-07 17:30:32 +0800128@@ -489,5 +563,6 @@ $(eval $(call KernelPackage,mt7921-common))
developerb11a5392022-03-31 00:34:47 +0800129 $(eval $(call KernelPackage,mt7921u))
130 $(eval $(call KernelPackage,mt7921s))
131 $(eval $(call KernelPackage,mt7921e))
developer7800b8d2022-06-23 22:15:56 +0800132+$(eval $(call KernelPackage,besra))
developerb11a5392022-03-31 00:34:47 +0800133 $(eval $(call KernelPackage,mt76))
134 $(eval $(call BuildPackage,mt76-test))
developer2cf5f9a2022-03-25 02:46:17 +0800135--
developerceb40012022-07-07 17:30:32 +08001362.18.0
developer2cf5f9a2022-03-25 02:46:17 +0800137