blob: 915a34c711ebfdf504b3a397d8977553cceda6e8 [file] [log] [blame]
developer049f58d2022-04-04 18:16:16 +08001From bd0dae19286bf13e74698d753a98e46b155a5882 Mon Sep 17 00:00:00 2001
developer6b966f52022-03-25 02:46:17 +08002From: Evelyn Tsai <evelyn.tsai@mediatek.com>
developer16092652022-03-31 00:34:47 +08003Date: Wed, 30 Mar 2022 10:38:24 +0800
developer6b966f52022-03-25 02:46:17 +08004Subject: [PATCH] mt76: add MT7986/MT7916/Bersa support in makefile
5
6---
developer049f58d2022-04-04 18:16:16 +08007 kernel/mt76/Makefile | 69 +++++++++++++++++++++++++++++++++++++++++++-
developer16092652022-03-31 00:34:47 +08008 1 file changed, 68 insertions(+), 1 deletion(-)
developer6b966f52022-03-25 02:46:17 +08009
10diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
developer049f58d2022-04-04 18:16:16 +080011index 0ccf067..75e65f7 100644
developer6b966f52022-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
25+define KernelPackage/bersa
26+ $(KernelPackage/mt76-default)
27+ TITLE:=MediaTek MT7902/MT7990 wireless driver
28+ DEPENDS+=@PCI_SUPPORT +kmod-mt76-core +kmod-mt76-connac +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT
29+ FILES:= $(PKG_BUILD_DIR)/bersa/bersa.ko
30+ AUTOLOAD:=$(call AutoProbe,bersa)
31+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
57+ifdef CONFIG_PACKAGE_kmod-bersa
58+ PKG_MAKE_FLAGS += CONFIG_BERSA=m
59 endif
60 ifdef CONFIG_PACKAGE_kmod-mt7921-common
61 PKG_MAKE_FLAGS += CONFIG_MT7921_COMMON=m
developer16092652022-03-31 00:34:47 +080062@@ -447,9 +467,55 @@ define KernelPackage/mt7915e/install
developer6b966f52022-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 \
developer16092652022-03-31 00:34:47 +080077+ $(1)/lib/firmware/mediatek
developer6b966f52022-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 \
developer16092652022-03-31 00:34:47 +080083 $(1)/lib/firmware/mediatek
developer6b966f52022-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
developer16092652022-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
developer049f58d2022-04-04 18:16:16 +080098+endif
developer16092652022-03-31 00:34:47 +080099 endef
100
developer6b966f52022-03-25 02:46:17 +0800101+ifdef CONFIG_PACKAGE_kmod-bersa
102+define KernelPackage/bersa/install
developer16092652022-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
developer6b966f52022-03-25 02:46:17 +0800113+endif
developer16092652022-03-31 00:34:47 +0800114+
developer6b966f52022-03-25 02:46:17 +0800115 define KernelPackage/mt7921e/install
116 $(INSTALL_DIR) $(1)/lib/firmware/mediatek
developer16092652022-03-31 00:34:47 +0800117 cp \
118@@ -489,5 +555,6 @@ $(eval $(call KernelPackage,mt7921-common))
119 $(eval $(call KernelPackage,mt7921u))
120 $(eval $(call KernelPackage,mt7921s))
121 $(eval $(call KernelPackage,mt7921e))
122+$(eval $(call KernelPackage,bersa))
123 $(eval $(call KernelPackage,mt76))
124 $(eval $(call BuildPackage,mt76-test))
developer6b966f52022-03-25 02:46:17 +0800125--
1262.29.2
127