blob: 1148f62476708a7e3417a1dcdf17f622bbc15db7 [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
10SRCREV ?= "053668acdaf83d0350ce3e21720e20eac9fbbcd7"
11SRC_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
27SRC_URI_append += " \
28 file://100-Revert-of-net-pass-the-dst-buffer-to-of_get_mac_addr.patch \
29 "
30S = "${WORKDIR}/git"
31
32NOSTDINC_FLAGS = " \
33 -I${B} \
34 -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211-backport/uapi \
35 -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211-backport \
36 -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211/uapi \
37 -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211 \
38 -include backport/autoconf.h \
39 -include backport/backport.h \
40 "
41
42PKG_MAKE_FLAGS = " \
43 CONFIG_MAC80211_DEBUGFS=y \
44 CONFIG_NL80211_TESTMODE=y \
45 CONFIG_MT76_CONNAC_LIB=m \
46 CONFIG_MT7615_COMMON=m \
47 CONFIG_MT7915E=m \
48 CONFIG_MT7986_WMAC=y \
49 "
50
51NOSTDINC_FLAGS += " \
52 -DCONFIG_MAC80211_MESH \
53 -DCONFIG_NL80211_TESTMODE \
54 -DCONFIG_MAC80211_DEBUGFS \
55 -DCONFIG_MT7986_WMAC \
56 "
57
58EXTRA_OEMAKE = " \
59 -C ${STAGING_KERNEL_BUILDDIR}/ \
60 M=${S} \
61 ${PKG_MAKE_FLAGS} \
62 NOSTDINC_FLAGS="${NOSTDINC_FLAGS}" \
63 "
64
65MAKE_TARGETS = "modules"
66
67do_configure[noexec] = "1"
68
69# make_scripts requires kernel source directory to create
70# kernel scripts
71do_make_scripts[depends] += "virtual/kernel:do_shared_workdir"
72
73do_install() {
74 # Module
75 install -d ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/
76 install -d ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/mt7615/
77 install -d ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/mt7915/
78 install -m 0644 ${B}/mt76.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/
79 install -m 0644 ${B}/mt76-connac-lib.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/
80 install -m 0644 ${B}/mt7615/mt7615-common.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/mt7615/
81 install -m 0644 ${B}/mt7915/mt7915e.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/mt7915/
82}
83
developerbc7ed682022-04-15 13:47:16 +080084do_install_append () {
85 install -d ${D}/${base_libdir}/firmware/mediatek/
86
87 install -m 644 ${WORKDIR}/src/firmware/mt7915_rom_patch.bin ${D}${base_libdir}/firmware/mediatek/
88 install -m 644 ${WORKDIR}/src/firmware/mt7915_wa.bin ${D}${base_libdir}/firmware/mediatek/
89 install -m 644 ${WORKDIR}/src/firmware/mt7915_wm.bin ${D}${base_libdir}/firmware/mediatek/
90 install -m 644 ${WORKDIR}/src/firmware/mt7915_eeprom.bin ${D}${base_libdir}/firmware/mediatek/
91 install -m 644 ${WORKDIR}/src/firmware/mt7915_eeprom_dbdc.bin ${D}${base_libdir}/firmware/mediatek/
92
93 install -m 644 ${WORKDIR}/src/firmware/mt7986_rom_patch.bin ${D}${base_libdir}/firmware/mediatek/
94 install -m 644 ${WORKDIR}/src/firmware/mt7986_rom_patch_mt7975.bin ${D}${base_libdir}/firmware/mediatek/
95 install -m 644 ${WORKDIR}/src/firmware/mt7986_wa.bin ${D}${base_libdir}/firmware/mediatek/
96 install -m 644 ${WORKDIR}/src/firmware/mt7986_wm.bin ${D}${base_libdir}/firmware/mediatek/
97 install -m 644 ${WORKDIR}/src/firmware/mt7986_wm_mt7975.bin ${D}${base_libdir}/firmware/mediatek/
98 install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7975_dual.bin ${D}${base_libdir}/firmware/mediatek/
99 install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7976_dbdc.bin ${D}${base_libdir}/firmware/mediatek/
100 install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7976.bin ${D}${base_libdir}/firmware/mediatek/
101 install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7976_dual.bin ${D}${base_libdir}/firmware/mediatek/
102}
103
104FILES_${PN} += " \
105 ${base_libdir}/firmware/mediatek/mt7915_rom_patch.bin \
106 ${base_libdir}/firmware/mediatek/mt7915_wa.bin \
107 ${base_libdir}/firmware/mediatek/mt7915_wm.bin \
108 ${base_libdir}/firmware/mediatek/mt7915_eeprom.bin \
109 ${base_libdir}/firmware/mediatek/mt7915_eeprom_dbdc.bin \
110 ${base_libdir}/firmware/mediatek/mt7986_rom_patch.bin\
111 ${base_libdir}/firmware/mediatek/mt7986_rom_patch_mt7975.bin \
112 ${base_libdir}/firmware/mediatek/mt7986_wa.bin \
113 ${base_libdir}/firmware/mediatek/mt7986_wm.bin \
114 ${base_libdir}/firmware/mediatek/mt7986_wm_mt7975.bin \
115 ${base_libdir}/firmware/mediatek/mt7986_eeprom_mt7975_dual.bin \
116 ${base_libdir}/firmware/mediatek/mt7986_eeprom_mt7976_dbdc.bin \
117 ${base_libdir}/firmware/mediatek/mt7986_eeprom_mt7976.bin \
118 ${base_libdir}/firmware/mediatek/mt7986_eeprom_mt7976_dual.bin \
119 "
120# Make linux-mt76 depend on all of the split-out packages.
121python populate_packages_prepend () {
122 firmware_pkgs = oe.utils.packages_filter_out_system(d)
123 d.appendVar('RDEPENDS_linux-mt76', ' ' + ' '.join(firmware_pkgs))
124}
125
developerec4ebe42022-04-12 11:17:45 +0800126KERNEL_MODULE_AUTOLOAD += "mt7915e"