developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 1 | DESCRIPTION = "Mediatek Wireless Drivers" |
| 2 | SECTION = "kernel/modules" |
| 3 | LICENSE = "GPLv2" |
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=c188eeeb69c0a05d0545816f1458a0c9" |
| 5 | |
| 6 | inherit module |
| 7 | |
developer | a20cdc2 | 2024-05-31 18:57:31 +0800 | [diff] [blame] | 8 | require mt76-3x.inc |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 9 | SRC_URI = " \ |
developer | 93e9720 | 2024-01-17 12:29:44 +0800 | [diff] [blame] | 10 | git://git@github.com/openwrt/mt76.git;protocol=https;branch=master \ |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 11 | file://COPYING;subdir=git \ |
| 12 | " |
developer | bc4d803 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 13 | SRC_URI += " \ |
| 14 | file://src \ |
| 15 | " |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 16 | |
developer | e6cee7d | 2022-11-16 18:00:20 +0800 | [diff] [blame] | 17 | |
| 18 | |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 19 | DEPENDS += "virtual/kernel" |
| 20 | DEPENDS += "linux-mac80211" |
| 21 | |
developer | e2cfb52 | 2022-12-08 18:09:45 +0800 | [diff] [blame] | 22 | FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches-${PV}:" |
developer | bc4d803 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 23 | FILESEXTRAPATHS_prepend := "${THISDIR}/src:" |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 24 | |
developer | 5f4cfb1 | 2022-12-15 16:48:11 +0800 | [diff] [blame] | 25 | require files/patches-${PV}/patches.inc |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 26 | |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 27 | S = "${WORKDIR}/git" |
| 28 | |
developer | e6cee7d | 2022-11-16 18:00:20 +0800 | [diff] [blame] | 29 | |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 30 | NOSTDINC_FLAGS = " \ |
| 31 | -I${B} \ |
| 32 | -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211-backport/uapi \ |
| 33 | -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211-backport \ |
| 34 | -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211/uapi \ |
| 35 | -I${STAGING_KERNEL_BUILDDIR}/usr/include/mac80211 \ |
| 36 | -include backport/autoconf.h \ |
| 37 | -include backport/backport.h \ |
| 38 | " |
| 39 | |
| 40 | PKG_MAKE_FLAGS = " \ |
| 41 | CONFIG_MAC80211_DEBUGFS=y \ |
| 42 | CONFIG_NL80211_TESTMODE=y \ |
| 43 | CONFIG_MT76_CONNAC_LIB=m \ |
developer | f8dbcb3 | 2022-12-15 18:14:59 +0800 | [diff] [blame] | 44 | CONFIG_MT7996E=m \ |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 45 | " |
| 46 | |
| 47 | NOSTDINC_FLAGS += " \ |
| 48 | -DCONFIG_MAC80211_MESH \ |
| 49 | -DCONFIG_NL80211_TESTMODE \ |
| 50 | -DCONFIG_MAC80211_DEBUGFS \ |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 51 | " |
| 52 | |
| 53 | EXTRA_OEMAKE = " \ |
| 54 | -C ${STAGING_KERNEL_BUILDDIR}/ \ |
| 55 | M=${S} \ |
| 56 | ${PKG_MAKE_FLAGS} \ |
| 57 | NOSTDINC_FLAGS="${NOSTDINC_FLAGS}" \ |
| 58 | " |
| 59 | |
| 60 | MAKE_TARGETS = "modules" |
| 61 | |
| 62 | do_configure[noexec] = "1" |
| 63 | |
| 64 | # make_scripts requires kernel source directory to create |
| 65 | # kernel scripts |
| 66 | do_make_scripts[depends] += "virtual/kernel:do_shared_workdir" |
| 67 | |
| 68 | do_install() { |
| 69 | # Module |
| 70 | install -d ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/ |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 71 | install -m 0644 ${B}/mt76.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/ |
| 72 | install -m 0644 ${B}/mt76-connac-lib.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/ |
developer | f8dbcb3 | 2022-12-15 18:14:59 +0800 | [diff] [blame] | 73 | install -m 0644 ${B}/mt7996/mt7996e.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/ |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 74 | } |
| 75 | |
developer | bc4d803 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 76 | do_install_append () { |
developer | f8dbcb3 | 2022-12-15 18:14:59 +0800 | [diff] [blame] | 77 | install -d ${D}/${base_libdir}/firmware/mediatek/mt7996 |
developer | c62da67 | 2022-12-26 16:10:38 +0800 | [diff] [blame] | 78 | install -m 644 ${WORKDIR}/src/firmware/mt7996/mt7996*.* ${D}${base_libdir}/firmware/mediatek/mt7996 |
developer | 813b996 | 2024-03-15 14:45:44 +0800 | [diff] [blame] | 79 | install -m 644 ${WORKDIR}/src/firmware/mt7996/mt7992*.* ${D}${base_libdir}/firmware/mediatek/mt7996 |
developer | 6ba5f60 | 2022-11-24 13:04:49 +0800 | [diff] [blame] | 80 | } |
| 81 | |
developer | f8dbcb3 | 2022-12-15 18:14:59 +0800 | [diff] [blame] | 82 | do_install_append_mt7988 () { |
developer | 6ba5f60 | 2022-11-24 13:04:49 +0800 | [diff] [blame] | 83 | install -d ${D}/${base_libdir}/firmware/mediatek/ |
developer | ce67314 | 2022-08-30 10:54:58 +0800 | [diff] [blame] | 84 | |
developer | d7066b0 | 2023-04-21 11:17:26 +0800 | [diff] [blame] | 85 | install -m 644 ${WORKDIR}/src/firmware/mtk_wo_0.bin ${D}${base_libdir}/firmware/mediatek/ |
| 86 | install -m 644 ${WORKDIR}/src/firmware/mtk_wo_1.bin ${D}${base_libdir}/firmware/mediatek/ |
| 87 | install -m 644 ${WORKDIR}/src/firmware/mtk_wo_2.bin ${D}${base_libdir}/firmware/mediatek/ |
developer | bc4d803 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 88 | } |
developer | 6ba5f60 | 2022-11-24 13:04:49 +0800 | [diff] [blame] | 89 | |
developer | 71d801e | 2022-11-02 18:14:41 +0800 | [diff] [blame] | 90 | FILES_${PN} += "${base_libdir}/firmware/mediatek/*" |
developer | bc4d803 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 91 | |
developer | bc4d803 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 92 | # Make linux-mt76 depend on all of the split-out packages. |
| 93 | python populate_packages_prepend () { |
| 94 | firmware_pkgs = oe.utils.packages_filter_out_system(d) |
| 95 | d.appendVar('RDEPENDS_linux-mt76', ' ' + ' '.join(firmware_pkgs)) |
| 96 | } |
| 97 | |
developer | 71d801e | 2022-11-02 18:14:41 +0800 | [diff] [blame] | 98 | #RPROVIDES_${PN} += "kernel-module-${PN}-${KERNEL_VERSION}" |
| 99 | #RPROVIDES_${PN} += "kernel-module-${PN}-connac-lib-${KERNEL_VERSION}" |
| 100 | |
developer | f8dbcb3 | 2022-12-15 18:14:59 +0800 | [diff] [blame] | 101 | KERNEL_MODULE_AUTOLOAD += "mt7996e" |