blob: 2f613efa732a930e51e92af44989bb80af8347f4 [file] [log] [blame]
developerec4ebe42022-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
8PV = "1.0"
9
developer3262bf82022-07-12 11:37:54 +080010SRCREV ?= "93e3fce916c62d06892d41bf00d0f4c2926c9a0b"
developerec4ebe42022-04-12 11:17:45 +080011SRC_URI = " \
12 git://git@github.com/openwrt/mt76.git;protocol=https \
13 file://COPYING;subdir=git \
14 "
developerbc7ed682022-04-15 13:47:16 +080015SRC_URI += " \
16 file://src \
17 "
developerec4ebe42022-04-12 11:17:45 +080018
19DEPENDS += "virtual/kernel"
20DEPENDS += "linux-mac80211"
21
22FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:"
developerbc7ed682022-04-15 13:47:16 +080023FILESEXTRAPATHS_prepend := "${THISDIR}/src:"
developerec4ebe42022-04-12 11:17:45 +080024
25require files/patches/patches.inc
26
developerec4ebe42022-04-12 11:17:45 +080027S = "${WORKDIR}/git"
28
29NOSTDINC_FLAGS = " \
30 -I${B} \
31 -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211-backport/uapi \
32 -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211-backport \
33 -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211/uapi \
34 -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211 \
35 -include backport/autoconf.h \
36 -include backport/backport.h \
37 "
38
39PKG_MAKE_FLAGS = " \
40 CONFIG_MAC80211_DEBUGFS=y \
41 CONFIG_NL80211_TESTMODE=y \
42 CONFIG_MT76_CONNAC_LIB=m \
43 CONFIG_MT7615_COMMON=m \
44 CONFIG_MT7915E=m \
45 CONFIG_MT7986_WMAC=y \
46 "
47
48NOSTDINC_FLAGS += " \
49 -DCONFIG_MAC80211_MESH \
50 -DCONFIG_NL80211_TESTMODE \
51 -DCONFIG_MAC80211_DEBUGFS \
52 -DCONFIG_MT7986_WMAC \
53 "
54
55EXTRA_OEMAKE = " \
56 -C ${STAGING_KERNEL_BUILDDIR}/ \
57 M=${S} \
58 ${PKG_MAKE_FLAGS} \
59 NOSTDINC_FLAGS="${NOSTDINC_FLAGS}" \
60 "
61
62MAKE_TARGETS = "modules"
63
64do_configure[noexec] = "1"
65
66# make_scripts requires kernel source directory to create
67# kernel scripts
68do_make_scripts[depends] += "virtual/kernel:do_shared_workdir"
69
70do_install() {
71 # Module
72 install -d ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/
73 install -d ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/mt7615/
74 install -d ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/mt7915/
75 install -m 0644 ${B}/mt76.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/
76 install -m 0644 ${B}/mt76-connac-lib.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/
77 install -m 0644 ${B}/mt7615/mt7615-common.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/mt7615/
78 install -m 0644 ${B}/mt7915/mt7915e.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/mt7915/
79}
80
developerbc7ed682022-04-15 13:47:16 +080081do_install_append () {
82 install -d ${D}/${base_libdir}/firmware/mediatek/
83
84 install -m 644 ${WORKDIR}/src/firmware/mt7915_rom_patch.bin ${D}${base_libdir}/firmware/mediatek/
85 install -m 644 ${WORKDIR}/src/firmware/mt7915_wa.bin ${D}${base_libdir}/firmware/mediatek/
86 install -m 644 ${WORKDIR}/src/firmware/mt7915_wm.bin ${D}${base_libdir}/firmware/mediatek/
87 install -m 644 ${WORKDIR}/src/firmware/mt7915_eeprom.bin ${D}${base_libdir}/firmware/mediatek/
88 install -m 644 ${WORKDIR}/src/firmware/mt7915_eeprom_dbdc.bin ${D}${base_libdir}/firmware/mediatek/
89
developerf8dda1f2022-08-30 10:54:58 +080090 install -m 644 ${WORKDIR}/src/firmware/mt7916_rom_patch.bin ${D}${base_libdir}/firmware/mediatek/
91 install -m 644 ${WORKDIR}/src/firmware/mt7916_wa.bin ${D}${base_libdir}/firmware/mediatek/
92 install -m 644 ${WORKDIR}/src/firmware/mt7916_wm.bin ${D}${base_libdir}/firmware/mediatek/
93 install -m 644 ${WORKDIR}/src/firmware/mt7916_eeprom.bin ${D}${base_libdir}/firmware/mediatek/
94
developerbc7ed682022-04-15 13:47:16 +080095 install -m 644 ${WORKDIR}/src/firmware/mt7986_rom_patch.bin ${D}${base_libdir}/firmware/mediatek/
96 install -m 644 ${WORKDIR}/src/firmware/mt7986_rom_patch_mt7975.bin ${D}${base_libdir}/firmware/mediatek/
97 install -m 644 ${WORKDIR}/src/firmware/mt7986_wa.bin ${D}${base_libdir}/firmware/mediatek/
98 install -m 644 ${WORKDIR}/src/firmware/mt7986_wm.bin ${D}${base_libdir}/firmware/mediatek/
99 install -m 644 ${WORKDIR}/src/firmware/mt7986_wm_mt7975.bin ${D}${base_libdir}/firmware/mediatek/
100 install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7975_dual.bin ${D}${base_libdir}/firmware/mediatek/
101 install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7976_dbdc.bin ${D}${base_libdir}/firmware/mediatek/
102 install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7976.bin ${D}${base_libdir}/firmware/mediatek/
103 install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7976_dual.bin ${D}${base_libdir}/firmware/mediatek/
developer3262bf82022-07-12 11:37:54 +0800104 install -m 644 ${WORKDIR}/src/firmware/mt7986_wo_0.bin ${D}${base_libdir}/firmware/mediatek/
105 install -m 644 ${WORKDIR}/src/firmware/mt7986_wo_1.bin ${D}${base_libdir}/firmware/mediatek/
developerbc7ed682022-04-15 13:47:16 +0800106}
107
108FILES_${PN} += " \
109 ${base_libdir}/firmware/mediatek/mt7915_rom_patch.bin \
110 ${base_libdir}/firmware/mediatek/mt7915_wa.bin \
111 ${base_libdir}/firmware/mediatek/mt7915_wm.bin \
112 ${base_libdir}/firmware/mediatek/mt7915_eeprom.bin \
113 ${base_libdir}/firmware/mediatek/mt7915_eeprom_dbdc.bin \
developerf8dda1f2022-08-30 10:54:58 +0800114 ${base_libdir}/firmware/mediatek/mt7916_rom_patch.bin \
115 ${base_libdir}/firmware/mediatek/mt7916_wa.bin \
116 ${base_libdir}/firmware/mediatek/mt7916_wm.bin \
117 ${base_libdir}/firmware/mediatek/mt7916_eeprom.bin \
developerbc7ed682022-04-15 13:47:16 +0800118 ${base_libdir}/firmware/mediatek/mt7986_rom_patch.bin\
119 ${base_libdir}/firmware/mediatek/mt7986_rom_patch_mt7975.bin \
120 ${base_libdir}/firmware/mediatek/mt7986_wa.bin \
121 ${base_libdir}/firmware/mediatek/mt7986_wm.bin \
122 ${base_libdir}/firmware/mediatek/mt7986_wm_mt7975.bin \
123 ${base_libdir}/firmware/mediatek/mt7986_eeprom_mt7975_dual.bin \
124 ${base_libdir}/firmware/mediatek/mt7986_eeprom_mt7976_dbdc.bin \
125 ${base_libdir}/firmware/mediatek/mt7986_eeprom_mt7976.bin \
126 ${base_libdir}/firmware/mediatek/mt7986_eeprom_mt7976_dual.bin \
developer3262bf82022-07-12 11:37:54 +0800127 ${base_libdir}/firmware/mediatek/mt7986_wo_0.bin \
128 ${base_libdir}/firmware/mediatek/mt7986_wo_1.bin \
developerbc7ed682022-04-15 13:47:16 +0800129 "
130# Make linux-mt76 depend on all of the split-out packages.
131python populate_packages_prepend () {
132 firmware_pkgs = oe.utils.packages_filter_out_system(d)
133 d.appendVar('RDEPENDS_linux-mt76', ' ' + ' '.join(firmware_pkgs))
134}
135
developerec4ebe42022-04-12 11:17:45 +0800136KERNEL_MODULE_AUTOLOAD += "mt7915e"