blob: 9166c81bc01a518f3c4c5286e20b8f863e80b998 [file] [log] [blame]
developere7861102022-04-04 18:16:16 +08001From bd0dae19286bf13e74698d753a98e46b155a5882 Mon Sep 17 00:00:00 2001
developer2cf5f9a2022-03-25 02:46:17 +08002From: Evelyn Tsai <evelyn.tsai@mediatek.com>
developerb11a5392022-03-31 00:34:47 +08003Date: Wed, 30 Mar 2022 10:38:24 +0800
developer7800b8d2022-06-23 22:15:56 +08004Subject: [PATCH] mt76: add MT7986/MT7916/Besra support in makefile
developer2cf5f9a2022-03-25 02:46:17 +08005
6---
developere7861102022-04-04 18:16:16 +08007 kernel/mt76/Makefile | 69 +++++++++++++++++++++++++++++++++++++++++++-
developerb11a5392022-03-31 00:34:47 +08008 1 file changed, 68 insertions(+), 1 deletion(-)
developer2cf5f9a2022-03-25 02:46:17 +08009
10diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
developere7861102022-04-04 18:16:16 +080011index 0ccf067..75e65f7 100644
developer2cf5f9a2022-03-25 02:46:17 +080012--- a/package/kernel/mt76/Makefile
13+++ b/package/kernel/mt76/Makefile
14@@ -220,12 +220,20 @@ endef
15
16 define KernelPackage/mt7915e
17 $(KernelPackage/mt76-default)
18- TITLE:=MediaTek MT7915e wireless driver
19+ TITLE:=MediaTek MT7915e/MT7986/MT7916 wireless driver
20 DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT +@KERNEL_RELAY
21 FILES:= $(PKG_BUILD_DIR)/mt7915/mt7915e.ko
22 AUTOLOAD:=$(call AutoProbe,mt7915e)
23 endef
24
developer7800b8d2022-06-23 22:15:56 +080025+define KernelPackage/besra
developer2cf5f9a2022-03-25 02:46:17 +080026+ $(KernelPackage/mt76-default)
27+ TITLE:=MediaTek MT7902/MT7990 wireless driver
developer3ef23332022-06-10 11:48:11 +080028+ 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 +080029+ FILES:= $(PKG_BUILD_DIR)/besra/besra.ko
30+ AUTOLOAD:=$(call AutoProbe,besra)
developer2cf5f9a2022-03-25 02:46:17 +080031+endef
32+
33 define KernelPackage/mt7921-common
34 $(KernelPackage/mt76-default)
35 TITLE:=MediaTek MT7615 wireless driver common code
36@@ -281,6 +289,11 @@ ifdef CONFIG_PACKAGE_MAC80211_MESH
37 NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
38 endif
39
40+ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
41+ NOSTDINC_FLAGS += -DCONFIG_MAC80211_DEBUGFS
42+ PKG_MAKE_FLAGS += CONFIG_MAC80211_DEBUGFS=y
43+endif
44+
45 ifdef CONFIG_PACKAGE_CFG80211_TESTMODE
46 NOSTDINC_FLAGS += -DCONFIG_NL80211_TESTMODE
47 PKG_MAKE_FLAGS += CONFIG_NL80211_TESTMODE=y
48@@ -343,6 +356,13 @@ ifdef CONFIG_PACKAGE_kmod-mt7663u
49 endif
50 ifdef CONFIG_PACKAGE_kmod-mt7915e
51 PKG_MAKE_FLAGS += CONFIG_MT7915E=m
52+ifdef CONFIG_TARGET_mediatek_mt7986
53+ PKG_MAKE_FLAGS += CONFIG_MT7986_WMAC=y
54+ NOSTDINC_FLAGS += -DCONFIG_MT7986_WMAC
55+endif
56+endif
developer7800b8d2022-06-23 22:15:56 +080057+ifdef CONFIG_PACKAGE_kmod-besra
58+ PKG_MAKE_FLAGS += CONFIG_BESRA=m
developer2cf5f9a2022-03-25 02:46:17 +080059 endif
60 ifdef CONFIG_PACKAGE_kmod-mt7921-common
61 PKG_MAKE_FLAGS += CONFIG_MT7921_COMMON=m
developerb11a5392022-03-31 00:34:47 +080062@@ -447,9 +467,55 @@ define KernelPackage/mt7915e/install
developer2cf5f9a2022-03-25 02:46:17 +080063 $(PKG_BUILD_DIR)/firmware/mt7915_wa.bin \
64 $(PKG_BUILD_DIR)/firmware/mt7915_wm.bin \
65 $(PKG_BUILD_DIR)/firmware/mt7915_rom_patch.bin \
66+ $(PKG_BUILD_DIR)/firmware/mt7916_wa.bin \
67+ $(PKG_BUILD_DIR)/firmware/mt7916_wm.bin \
68+ $(PKG_BUILD_DIR)/firmware/mt7916_rom_patch.bin \
69+ $(1)/lib/firmware/mediatek
70+ifdef CONFIG_TARGET_mediatek_mt7986
71+ cp \
72+ $(PKG_BUILD_DIR)/firmware/mt7986_wa.bin \
73+ $(PKG_BUILD_DIR)/firmware/mt7986_wm.bin \
74+ $(PKG_BUILD_DIR)/firmware/mt7986_wm_mt7975.bin \
75+ $(PKG_BUILD_DIR)/firmware/mt7986_rom_patch.bin \
76+ $(PKG_BUILD_DIR)/firmware/mt7986_rom_patch_mt7975.bin \
developerb11a5392022-03-31 00:34:47 +080077+ $(1)/lib/firmware/mediatek
developer2cf5f9a2022-03-25 02:46:17 +080078+endif
79+ cp \
80+ $(PKG_BUILD_DIR)/firmware/mt7916_eeprom.bin \
81+ $(PKG_BUILD_DIR)/firmware/mt7915_eeprom.bin \
82+ $(PKG_BUILD_DIR)/firmware/mt7915_eeprom_dbdc.bin \
developerb11a5392022-03-31 00:34:47 +080083 $(1)/lib/firmware/mediatek
developer2cf5f9a2022-03-25 02:46:17 +080084+ifdef CONFIG_TARGET_mediatek_mt7986
85+ cp \
86+ $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7976_dual.bin \
87+ $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7976.bin \
88+ $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7976_dbdc.bin \
89+ $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7975_dual.bin \
90+ $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7975.bin \
91+ $(1)/lib/firmware/mediatek
developerb11a5392022-03-31 00:34:47 +080092+ifdef CONFIG_NET_MEDIATEK_SOC_WED
93+ cp \
94+ $(PKG_BUILD_DIR)/firmware/mt7986_wo_0.bin \
95+ $(PKG_BUILD_DIR)/firmware/mt7986_wo_1.bin \
96+ $(1)/lib/firmware/mediatek
97+endif
developere7861102022-04-04 18:16:16 +080098+endif
developerb11a5392022-03-31 00:34:47 +080099 endef
100
developer7800b8d2022-06-23 22:15:56 +0800101+ifdef CONFIG_PACKAGE_kmod-besra
102+define KernelPackage/besra/install
developerb11a5392022-03-31 00:34:47 +0800103+ $(INSTALL_DIR) $(1)/lib/firmware/mediatek
104+ cp \
105+ $(PKG_BUILD_DIR)/firmware/mt7902_wa.bin \
106+ $(PKG_BUILD_DIR)/firmware/mt7902_wm.bin \
107+ $(PKG_BUILD_DIR)/firmware/mt7902_rom_patch.bin \
108+ $(PKG_BUILD_DIR)/firmware/mt7902_wf_rom.bin \
109+ $(PKG_BUILD_DIR)/firmware/mt7902_wf_rom_sram.bin \
110+ $(PKG_BUILD_DIR)/firmware/mt7902_eeprom.bin \
111+ $(1)/lib/firmware/mediatek
112+endef
developer2cf5f9a2022-03-25 02:46:17 +0800113+endif
developerb11a5392022-03-31 00:34:47 +0800114+
developer2cf5f9a2022-03-25 02:46:17 +0800115 define KernelPackage/mt7921e/install
116 $(INSTALL_DIR) $(1)/lib/firmware/mediatek
developerb11a5392022-03-31 00:34:47 +0800117 cp \
developer4721e252022-06-21 16:41:28 +0800118@@ -489,5 +555,6 @@ $(eval $(call KernelPackage,mt7921-common))
developerb11a5392022-03-31 00:34:47 +0800119 $(eval $(call KernelPackage,mt7921u))
120 $(eval $(call KernelPackage,mt7921s))
121 $(eval $(call KernelPackage,mt7921e))
developer7800b8d2022-06-23 22:15:56 +0800122+$(eval $(call KernelPackage,besra))
developerb11a5392022-03-31 00:34:47 +0800123 $(eval $(call KernelPackage,mt76))
124 $(eval $(call BuildPackage,mt76-test))
developer2cf5f9a2022-03-25 02:46:17 +0800125--
1262.29.2
127