blob: b40464c24816467cc9a16aa552520d2218f7e89a [file] [log] [blame]
developer356ecec2022-11-14 10:25:04 +08001From a01e3dd6b0419aaa70bafc5bcd40030b91f8604d Mon Sep 17 00:00:00 2001
2From: Peter Chiu <chui-hao.chiu@mediatek.com>
3Date: Mon, 14 Nov 2022 14:21:43 +0800
4Subject: [PATCH] master mt76 makefile for new chip
5
6Change-Id: I0271373cf1d5f23874aca94360d9a5a253e7c109
7---
8 package/kernel/mt76/Makefile | 84 ++++++++++++++++++++++++++++++++++--
9 1 file changed, 81 insertions(+), 3 deletions(-)
10
developer1bfe18b2022-07-13 16:05:35 +080011diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
developer356ecec2022-11-14 10:25:04 +080012index 4b9a8885..3d71a487 100644
developer1bfe18b2022-07-13 16:05:35 +080013--- a/package/kernel/mt76/Makefile
14+++ b/package/kernel/mt76/Makefile
developerad3184f2022-08-30 13:15:07 +080015@@ -220,7 +220,7 @@ endef
developer2cf5f9a2022-03-25 02:46:17 +080016
17 define KernelPackage/mt7915e
18 $(KernelPackage/mt76-default)
19- TITLE:=MediaTek MT7915e wireless driver
20+ TITLE:=MediaTek MT7915e/MT7986/MT7916 wireless driver
21 DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT +@KERNEL_RELAY
22 FILES:= $(PKG_BUILD_DIR)/mt7915/mt7915e.ko
23 AUTOLOAD:=$(call AutoProbe,mt7915e)
developer356ecec2022-11-14 10:25:04 +080024@@ -234,10 +234,26 @@ endef
developerad3184f2022-08-30 13:15:07 +080025
26 define KernelPackage/mt7986-firmware
27 $(KernelPackage/mt76-default)
28- DEPENDS:=@TARGET_mediatek_filogic
29+ DEPENDS:=+@TARGET_mediatek_mt7986
30 TITLE:=MediaTek MT7986 firmware
developer2cf5f9a2022-03-25 02:46:17 +080031 endef
32
developer7800b8d2022-06-23 22:15:56 +080033+define KernelPackage/besra
developer2cf5f9a2022-03-25 02:46:17 +080034+ $(KernelPackage/mt76-default)
35+ TITLE:=MediaTek MT7902/MT7990 wireless driver
developer3ef23332022-06-10 11:48:11 +080036+ 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 +080037+ FILES:= $(PKG_BUILD_DIR)/besra/besra.ko
38+ AUTOLOAD:=$(call AutoProbe,besra)
developer2cf5f9a2022-03-25 02:46:17 +080039+endef
40+
developer782053a2022-10-24 17:40:58 +080041+define KernelPackage/mt7996e
42+ $(KernelPackage/mt76-default)
43+ TITLE:=MediaTek MT7996/MT7995/MT7919 wireless driver
developer4fb99042022-11-08 00:25:27 +080044+ DEPENDS+=@PCI_SUPPORT +kmod-mt76-core +kmod-mt76-connac +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT +@DRIVER_11BE_SUPPORT
developer782053a2022-10-24 17:40:58 +080045+ FILES:= $(PKG_BUILD_DIR)/mt7996/mt7996e.ko
46+ AUTOLOAD:=$(call AutoProbe,mt7996e)
47+endef
48+
developer356ecec2022-11-14 10:25:04 +080049 define KernelPackage/mt7921-firmware
developer2cf5f9a2022-03-25 02:46:17 +080050 $(KernelPackage/mt76-default)
developer356ecec2022-11-14 10:25:04 +080051 TITLE:=MediaTek MT7921 firmware
52@@ -298,6 +314,11 @@ ifdef CONFIG_PACKAGE_MAC80211_MESH
developer2cf5f9a2022-03-25 02:46:17 +080053 NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
54 endif
55
56+ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
57+ NOSTDINC_FLAGS += -DCONFIG_MAC80211_DEBUGFS
58+ PKG_MAKE_FLAGS += CONFIG_MAC80211_DEBUGFS=y
59+endif
60+
61 ifdef CONFIG_PACKAGE_CFG80211_TESTMODE
62 NOSTDINC_FLAGS += -DCONFIG_NL80211_TESTMODE
63 PKG_MAKE_FLAGS += CONFIG_NL80211_TESTMODE=y
developer356ecec2022-11-14 10:25:04 +080064@@ -360,11 +381,17 @@ ifdef CONFIG_PACKAGE_kmod-mt7663u
developer2cf5f9a2022-03-25 02:46:17 +080065 endif
66 ifdef CONFIG_PACKAGE_kmod-mt7915e
67 PKG_MAKE_FLAGS += CONFIG_MT7915E=m
developerad3184f2022-08-30 13:15:07 +080068- ifdef CONFIG_TARGET_mediatek_filogic
69+ ifdef CONFIG_TARGET_mediatek_mt7986
70 PKG_MAKE_FLAGS += CONFIG_MT7986_WMAC=y
71 NOSTDINC_FLAGS += -DCONFIG_MT7986_WMAC
72 endif
73 endif
developer7800b8d2022-06-23 22:15:56 +080074+ifdef CONFIG_PACKAGE_kmod-besra
75+ PKG_MAKE_FLAGS += CONFIG_BESRA=m
developerad3184f2022-08-30 13:15:07 +080076+endif
developer782053a2022-10-24 17:40:58 +080077+ifdef CONFIG_PACKAGE_kmod-mt7996e
78+ PKG_MAKE_FLAGS += CONFIG_MT7996E=m
79+endif
developer2cf5f9a2022-03-25 02:46:17 +080080 ifdef CONFIG_PACKAGE_kmod-mt7921-common
81 PKG_MAKE_FLAGS += CONFIG_MT7921_COMMON=m
developerad3184f2022-08-30 13:15:07 +080082 endif
developer356ecec2022-11-14 10:25:04 +080083@@ -468,6 +495,12 @@ define KernelPackage/mt7915e/install
developer2cf5f9a2022-03-25 02:46:17 +080084 $(PKG_BUILD_DIR)/firmware/mt7915_wa.bin \
85 $(PKG_BUILD_DIR)/firmware/mt7915_wm.bin \
86 $(PKG_BUILD_DIR)/firmware/mt7915_rom_patch.bin \
87+ $(PKG_BUILD_DIR)/firmware/mt7916_wa.bin \
88+ $(PKG_BUILD_DIR)/firmware/mt7916_wm.bin \
89+ $(PKG_BUILD_DIR)/firmware/mt7916_rom_patch.bin \
developer2cf5f9a2022-03-25 02:46:17 +080090+ $(PKG_BUILD_DIR)/firmware/mt7916_eeprom.bin \
91+ $(PKG_BUILD_DIR)/firmware/mt7915_eeprom.bin \
92+ $(PKG_BUILD_DIR)/firmware/mt7915_eeprom_dbdc.bin \
developerb11a5392022-03-31 00:34:47 +080093 $(1)/lib/firmware/mediatek
developerad3184f2022-08-30 13:15:07 +080094 endef
95
developer356ecec2022-11-14 10:25:04 +080096@@ -490,8 +523,51 @@ define KernelPackage/mt7986-firmware/install
developerad3184f2022-08-30 13:15:07 +080097 $(PKG_BUILD_DIR)/firmware/mt7986_rom_patch.bin \
98 $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7975_dual.bin \
99 $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7976_dual.bin \
100+ $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7975.bin \
developer2cf5f9a2022-03-25 02:46:17 +0800101+ $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7976.bin \
102+ $(PKG_BUILD_DIR)/firmware/mt7986_eeprom_mt7976_dbdc.bin \
developer356ecec2022-11-14 10:25:04 +0800103+ $(1)/lib/firmware/mediatek
developerb11a5392022-03-31 00:34:47 +0800104+ifdef CONFIG_NET_MEDIATEK_SOC_WED
105+ cp \
106+ $(PKG_BUILD_DIR)/firmware/mt7986_wo_0.bin \
107+ $(PKG_BUILD_DIR)/firmware/mt7986_wo_1.bin \
developer356ecec2022-11-14 10:25:04 +0800108 $(1)/lib/firmware/mediatek
developere7861102022-04-04 18:16:16 +0800109+endif
developer356ecec2022-11-14 10:25:04 +0800110+endef
111+
developer7800b8d2022-06-23 22:15:56 +0800112+ifdef CONFIG_PACKAGE_kmod-besra
113+define KernelPackage/besra/install
developer13601d92022-11-08 22:17:56 +0800114+ $(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7996
developerb11a5392022-03-31 00:34:47 +0800115+ cp \
developer13601d92022-11-08 22:17:56 +0800116+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_wa.bin \
117+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_wm.bin \
118+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_rom_patch.bin \
119+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_wf_rom.bin \
120+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_wf_rom_sram.bin \
121+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_eeprom.bin \
122+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_wm_7977.bin \
123+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_wf_rom_7977.bin \
124+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_wf_rom_sram_7977.bin \
125+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7902_eeprom_7977.bin \
126+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wa.bin \
127+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wm.bin \
128+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_rom_patch.bin \
129+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_eeprom.bin \
130+ $(1)/lib/firmware/mediatek/mt7996
developer782053a2022-10-24 17:40:58 +0800131+endef
132+endif
133+
134+ifdef CONFIG_PACKAGE_kmod-mt7996e
135+define KernelPackage/mt7996e/install
developer13601d92022-11-08 22:17:56 +0800136+ $(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7996
developer782053a2022-10-24 17:40:58 +0800137+ cp \
developer13601d92022-11-08 22:17:56 +0800138+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wa.bin \
139+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wm.bin \
140+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_rom_patch.bin \
141+ $(PKG_BUILD_DIR)/firmware/mt7996/mt7996_eeprom.bin \
142+ $(1)/lib/firmware/mediatek/mt7996
developer356ecec2022-11-14 10:25:04 +0800143 endef
developer2cf5f9a2022-03-25 02:46:17 +0800144+endif
developer356ecec2022-11-14 10:25:04 +0800145
146 define KernelPackage/mt7921-firmware/install
developer2cf5f9a2022-03-25 02:46:17 +0800147 $(INSTALL_DIR) $(1)/lib/firmware/mediatek
developer356ecec2022-11-14 10:25:04 +0800148@@ -535,5 +611,7 @@ $(eval $(call KernelPackage,mt7921-common))
developerb11a5392022-03-31 00:34:47 +0800149 $(eval $(call KernelPackage,mt7921u))
150 $(eval $(call KernelPackage,mt7921s))
151 $(eval $(call KernelPackage,mt7921e))
developer782053a2022-10-24 17:40:58 +0800152+$(eval $(call KernelPackage,mt7996e))
developer7800b8d2022-06-23 22:15:56 +0800153+$(eval $(call KernelPackage,besra))
developerb11a5392022-03-31 00:34:47 +0800154 $(eval $(call KernelPackage,mt76))
155 $(eval $(call BuildPackage,mt76-test))
developer2cf5f9a2022-03-25 02:46:17 +0800156--
developer356ecec2022-11-14 10:25:04 +08001572.18.0
developer2cf5f9a2022-03-25 02:46:17 +0800158