blob: e622f8933d03205074c3ec5b205cf47a014635a8 [file] [log] [blame]
developer6b966f52022-03-25 02:46:17 +08001From 80c0f2a42e6a44fb11c4256848d85c9f8f552eb7 Mon Sep 17 00:00:00 2001
2From: Evelyn Tsai <evelyn.tsai@mediatek.com>
3Date: Mon, 21 Mar 2022 10:27:08 +0800
4Subject: [PATCH] mt76: add MT7986/MT7916/Bersa support in makefile
5
6---
7 Makefile | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
8 1 file changed, 61 insertions(+), 1 deletion(-)
9
10diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
11index d683059..bf1db07 100644
12--- 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
62@@ -447,8 +467,48 @@ define KernelPackage/mt7915e/install
63 $(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 \
77 $(1)/lib/firmware/mediatek
78+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 \
83+ $(1)/lib/firmware/mediatek
84+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
92+endif
93+endef
94+
95+ifdef CONFIG_PACKAGE_kmod-bersa
96+define KernelPackage/bersa/install
97+ $(INSTALL_DIR) $(1)/lib/firmware/mediatek
98+ cp \
99+ $(PKG_BUILD_DIR)/firmware/mt7902_wa.bin \
100+ $(PKG_BUILD_DIR)/firmware/mt7902_wm.bin \
101+ $(PKG_BUILD_DIR)/firmware/mt7902_rom_patch.bin \
102+ $(PKG_BUILD_DIR)/firmware/mt7902_wf_rom.bin \
103+ $(PKG_BUILD_DIR)/firmware/mt7902_wf_rom_sram.bin \
104+ $(PKG_BUILD_DIR)/firmware/mt7902_eeprom.bin \
105+ $(1)/lib/firmware/mediatek
106 endef
107+endif
108
109 define KernelPackage/mt7921e/install
110 $(INSTALL_DIR) $(1)/lib/firmware/mediatek
111--
1122.29.2
113