blob: b61b5cf881fd83ebc1abc7cb91b88ab6468f69ae [file] [log] [blame]
developerf11ee162022-04-12 11:17:45 +08001DESCRIPTION = "Mediatek Wireless Drivers"
2SECTION = "kernel/modules"
3LICENSE = "GPLv2"
4LIC_FILES_CHKSUM = "file://COPYING;md5=c188eeeb69c0a05d0545816f1458a0c9"
5
6inherit module
7
developer0447f742022-10-31 14:57:29 +08008require mt76.inc
developerf11ee162022-04-12 11:17:45 +08009SRC_URI = " \
developer93e97202024-01-17 12:29:44 +080010 git://git@github.com/openwrt/mt76.git;protocol=https;branch=master \
developerf11ee162022-04-12 11:17:45 +080011 file://COPYING;subdir=git \
12 "
developerbc4d8032022-04-15 13:47:16 +080013SRC_URI += " \
14 file://src \
15 "
developerf11ee162022-04-12 11:17:45 +080016
developere6cee7d2022-11-16 18:00:20 +080017
18
developerf11ee162022-04-12 11:17:45 +080019DEPENDS += "virtual/kernel"
20DEPENDS += "linux-mac80211"
21
22FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:"
developerbc4d8032022-04-15 13:47:16 +080023FILESEXTRAPATHS_prepend := "${THISDIR}/src:"
developerf11ee162022-04-12 11:17:45 +080024
developer5f4cfb12022-12-15 16:48:11 +080025require files/patches/patches.inc
26SRC_URI_append += "file://5000-mt76-add-internal-wed_tiny-header-file.patch"
developerc62da672022-12-26 16:10:38 +080027SRC_URI_append += "file://5001-mt76-mt7915-disable-wed.patch"
developerf11ee162022-04-12 11:17:45 +080028
developerf11ee162022-04-12 11:17:45 +080029S = "${WORKDIR}/git"
30
31NOSTDINC_FLAGS = " \
32 -I${B} \
33 -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211-backport/uapi \
34 -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211-backport \
35 -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211/uapi \
36 -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211 \
37 -include backport/autoconf.h \
38 -include backport/backport.h \
39 "
40
41PKG_MAKE_FLAGS = " \
42 CONFIG_MAC80211_DEBUGFS=y \
43 CONFIG_NL80211_TESTMODE=y \
44 CONFIG_MT76_CONNAC_LIB=m \
45 CONFIG_MT7615_COMMON=m \
46 CONFIG_MT7915E=m \
developer7af0f762023-05-22 15:16:16 +080047 CONFIG_MT798X_WMAC=y \
developerf11ee162022-04-12 11:17:45 +080048 "
49
50NOSTDINC_FLAGS += " \
51 -DCONFIG_MAC80211_MESH \
52 -DCONFIG_NL80211_TESTMODE \
53 -DCONFIG_MAC80211_DEBUGFS \
developer7af0f762023-05-22 15:16:16 +080054 -DCONFIG_MT798X_WMAC \
developerf11ee162022-04-12 11:17:45 +080055 "
56
57EXTRA_OEMAKE = " \
58 -C ${STAGING_KERNEL_BUILDDIR}/ \
59 M=${S} \
60 ${PKG_MAKE_FLAGS} \
61 NOSTDINC_FLAGS="${NOSTDINC_FLAGS}" \
62 "
63
64MAKE_TARGETS = "modules"
65
66do_configure[noexec] = "1"
67
68# make_scripts requires kernel source directory to create
69# kernel scripts
70do_make_scripts[depends] += "virtual/kernel:do_shared_workdir"
71
72do_install() {
73 # Module
74 install -d ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/
75 install -d ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/mt7615/
76 install -d ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/mt7915/
77 install -m 0644 ${B}/mt76.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/
78 install -m 0644 ${B}/mt76-connac-lib.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/
79 install -m 0644 ${B}/mt7615/mt7615-common.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/mt7615/
80 install -m 0644 ${B}/mt7915/mt7915e.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/mt7915/
81}
82
developerbc4d8032022-04-15 13:47:16 +080083do_install_append () {
84 install -d ${D}/${base_libdir}/firmware/mediatek/
85
86 install -m 644 ${WORKDIR}/src/firmware/mt7915_rom_patch.bin ${D}${base_libdir}/firmware/mediatek/
87 install -m 644 ${WORKDIR}/src/firmware/mt7915_wa.bin ${D}${base_libdir}/firmware/mediatek/
88 install -m 644 ${WORKDIR}/src/firmware/mt7915_wm.bin ${D}${base_libdir}/firmware/mediatek/
89 install -m 644 ${WORKDIR}/src/firmware/mt7915_eeprom.bin ${D}${base_libdir}/firmware/mediatek/
90 install -m 644 ${WORKDIR}/src/firmware/mt7915_eeprom_dbdc.bin ${D}${base_libdir}/firmware/mediatek/
91
developerce673142022-08-30 10:54:58 +080092 install -m 644 ${WORKDIR}/src/firmware/mt7916_rom_patch.bin ${D}${base_libdir}/firmware/mediatek/
93 install -m 644 ${WORKDIR}/src/firmware/mt7916_wa.bin ${D}${base_libdir}/firmware/mediatek/
94 install -m 644 ${WORKDIR}/src/firmware/mt7916_wm.bin ${D}${base_libdir}/firmware/mediatek/
95 install -m 644 ${WORKDIR}/src/firmware/mt7916_eeprom.bin ${D}${base_libdir}/firmware/mediatek/
developer6ba5f602022-11-24 13:04:49 +080096}
97
98do_install_append_mt7986 () {
99 install -d ${D}/${base_libdir}/firmware/mediatek/
developerce673142022-08-30 10:54:58 +0800100
developerbc4d8032022-04-15 13:47:16 +0800101 install -m 644 ${WORKDIR}/src/firmware/mt7986_rom_patch.bin ${D}${base_libdir}/firmware/mediatek/
102 install -m 644 ${WORKDIR}/src/firmware/mt7986_rom_patch_mt7975.bin ${D}${base_libdir}/firmware/mediatek/
103 install -m 644 ${WORKDIR}/src/firmware/mt7986_wa.bin ${D}${base_libdir}/firmware/mediatek/
104 install -m 644 ${WORKDIR}/src/firmware/mt7986_wm.bin ${D}${base_libdir}/firmware/mediatek/
105 install -m 644 ${WORKDIR}/src/firmware/mt7986_wm_mt7975.bin ${D}${base_libdir}/firmware/mediatek/
106 install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7975_dual.bin ${D}${base_libdir}/firmware/mediatek/
107 install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7976_dbdc.bin ${D}${base_libdir}/firmware/mediatek/
108 install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7976.bin ${D}${base_libdir}/firmware/mediatek/
109 install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7976_dual.bin ${D}${base_libdir}/firmware/mediatek/
developerf79ad452022-07-12 11:37:54 +0800110 install -m 644 ${WORKDIR}/src/firmware/mt7986_wo_0.bin ${D}${base_libdir}/firmware/mediatek/
111 install -m 644 ${WORKDIR}/src/firmware/mt7986_wo_1.bin ${D}${base_libdir}/firmware/mediatek/
developerbc4d8032022-04-15 13:47:16 +0800112}
developer6ba5f602022-11-24 13:04:49 +0800113
developer71d801e2022-11-02 18:14:41 +0800114FILES_${PN} += "${base_libdir}/firmware/mediatek/*"
developerbc4d8032022-04-15 13:47:16 +0800115
developerbc4d8032022-04-15 13:47:16 +0800116# Make linux-mt76 depend on all of the split-out packages.
117python populate_packages_prepend () {
118 firmware_pkgs = oe.utils.packages_filter_out_system(d)
119 d.appendVar('RDEPENDS_linux-mt76', ' ' + ' '.join(firmware_pkgs))
120}
121
developer71d801e2022-11-02 18:14:41 +0800122#RPROVIDES_${PN} += "kernel-module-${PN}-${KERNEL_VERSION}"
123#RPROVIDES_${PN} += "kernel-module-${PN}-connac-lib-${KERNEL_VERSION}"
124
developerf11ee162022-04-12 11:17:45 +0800125KERNEL_MODULE_AUTOLOAD += "mt7915e"