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 | 0447f74 | 2022-10-31 14:57:29 +0800 | [diff] [blame] | 8 | require mt76.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 | |
| 22 | FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:" |
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/patches.inc |
| 26 | SRC_URI_append += "file://5000-mt76-add-internal-wed_tiny-header-file.patch" |
developer | c62da67 | 2022-12-26 16:10:38 +0800 | [diff] [blame] | 27 | SRC_URI_append += "file://5001-mt76-mt7915-disable-wed.patch" |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 28 | |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 29 | S = "${WORKDIR}/git" |
| 30 | |
| 31 | NOSTDINC_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 | |
| 41 | PKG_MAKE_FLAGS = " \ |
| 42 | CONFIG_MAC80211_DEBUGFS=y \ |
| 43 | CONFIG_NL80211_TESTMODE=y \ |
| 44 | CONFIG_MT76_CONNAC_LIB=m \ |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 45 | CONFIG_MT7915E=m \ |
developer | 7af0f76 | 2023-05-22 15:16:16 +0800 | [diff] [blame] | 46 | CONFIG_MT798X_WMAC=y \ |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 47 | " |
| 48 | |
| 49 | NOSTDINC_FLAGS += " \ |
| 50 | -DCONFIG_MAC80211_MESH \ |
| 51 | -DCONFIG_NL80211_TESTMODE \ |
| 52 | -DCONFIG_MAC80211_DEBUGFS \ |
developer | 7af0f76 | 2023-05-22 15:16:16 +0800 | [diff] [blame] | 53 | -DCONFIG_MT798X_WMAC \ |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 54 | " |
| 55 | |
| 56 | EXTRA_OEMAKE = " \ |
| 57 | -C ${STAGING_KERNEL_BUILDDIR}/ \ |
| 58 | M=${S} \ |
| 59 | ${PKG_MAKE_FLAGS} \ |
| 60 | NOSTDINC_FLAGS="${NOSTDINC_FLAGS}" \ |
| 61 | " |
| 62 | |
| 63 | MAKE_TARGETS = "modules" |
| 64 | |
| 65 | do_configure[noexec] = "1" |
| 66 | |
| 67 | # make_scripts requires kernel source directory to create |
| 68 | # kernel scripts |
| 69 | do_make_scripts[depends] += "virtual/kernel:do_shared_workdir" |
| 70 | |
| 71 | do_install() { |
| 72 | # Module |
| 73 | install -d ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/ |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 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/ |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 77 | install -m 0644 ${B}/mt7915/mt7915e.ko ${D}/lib/modules/${KERNEL_VERSION}/updates/drivers/net/wireless/mediatek/mt76/mt7915/ |
| 78 | } |
| 79 | |
developer | bc4d803 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 80 | do_install_append () { |
| 81 | install -d ${D}/${base_libdir}/firmware/mediatek/ |
| 82 | |
| 83 | install -m 644 ${WORKDIR}/src/firmware/mt7915_rom_patch.bin ${D}${base_libdir}/firmware/mediatek/ |
| 84 | install -m 644 ${WORKDIR}/src/firmware/mt7915_wa.bin ${D}${base_libdir}/firmware/mediatek/ |
| 85 | install -m 644 ${WORKDIR}/src/firmware/mt7915_wm.bin ${D}${base_libdir}/firmware/mediatek/ |
| 86 | install -m 644 ${WORKDIR}/src/firmware/mt7915_eeprom.bin ${D}${base_libdir}/firmware/mediatek/ |
| 87 | install -m 644 ${WORKDIR}/src/firmware/mt7915_eeprom_dbdc.bin ${D}${base_libdir}/firmware/mediatek/ |
| 88 | |
developer | ce67314 | 2022-08-30 10:54:58 +0800 | [diff] [blame] | 89 | install -m 644 ${WORKDIR}/src/firmware/mt7916_rom_patch.bin ${D}${base_libdir}/firmware/mediatek/ |
| 90 | install -m 644 ${WORKDIR}/src/firmware/mt7916_wa.bin ${D}${base_libdir}/firmware/mediatek/ |
| 91 | install -m 644 ${WORKDIR}/src/firmware/mt7916_wm.bin ${D}${base_libdir}/firmware/mediatek/ |
| 92 | install -m 644 ${WORKDIR}/src/firmware/mt7916_eeprom.bin ${D}${base_libdir}/firmware/mediatek/ |
developer | 6ba5f60 | 2022-11-24 13:04:49 +0800 | [diff] [blame] | 93 | } |
| 94 | |
| 95 | do_install_append_mt7986 () { |
| 96 | install -d ${D}/${base_libdir}/firmware/mediatek/ |
developer | ce67314 | 2022-08-30 10:54:58 +0800 | [diff] [blame] | 97 | |
developer | bc4d803 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 98 | install -m 644 ${WORKDIR}/src/firmware/mt7986_rom_patch.bin ${D}${base_libdir}/firmware/mediatek/ |
| 99 | install -m 644 ${WORKDIR}/src/firmware/mt7986_rom_patch_mt7975.bin ${D}${base_libdir}/firmware/mediatek/ |
| 100 | install -m 644 ${WORKDIR}/src/firmware/mt7986_wa.bin ${D}${base_libdir}/firmware/mediatek/ |
| 101 | install -m 644 ${WORKDIR}/src/firmware/mt7986_wm.bin ${D}${base_libdir}/firmware/mediatek/ |
| 102 | install -m 644 ${WORKDIR}/src/firmware/mt7986_wm_mt7975.bin ${D}${base_libdir}/firmware/mediatek/ |
| 103 | install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7975_dual.bin ${D}${base_libdir}/firmware/mediatek/ |
| 104 | install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7976_dbdc.bin ${D}${base_libdir}/firmware/mediatek/ |
| 105 | install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7976.bin ${D}${base_libdir}/firmware/mediatek/ |
| 106 | install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7976_dual.bin ${D}${base_libdir}/firmware/mediatek/ |
developer | f79ad45 | 2022-07-12 11:37:54 +0800 | [diff] [blame] | 107 | install -m 644 ${WORKDIR}/src/firmware/mt7986_wo_0.bin ${D}${base_libdir}/firmware/mediatek/ |
| 108 | install -m 644 ${WORKDIR}/src/firmware/mt7986_wo_1.bin ${D}${base_libdir}/firmware/mediatek/ |
developer | bc4d803 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 109 | } |
developer | 6ba5f60 | 2022-11-24 13:04:49 +0800 | [diff] [blame] | 110 | |
developer | 71d801e | 2022-11-02 18:14:41 +0800 | [diff] [blame] | 111 | FILES_${PN} += "${base_libdir}/firmware/mediatek/*" |
developer | bc4d803 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 112 | |
developer | bc4d803 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 113 | # Make linux-mt76 depend on all of the split-out packages. |
| 114 | python populate_packages_prepend () { |
| 115 | firmware_pkgs = oe.utils.packages_filter_out_system(d) |
| 116 | d.appendVar('RDEPENDS_linux-mt76', ' ' + ' '.join(firmware_pkgs)) |
| 117 | } |
| 118 | |
developer | 71d801e | 2022-11-02 18:14:41 +0800 | [diff] [blame] | 119 | #RPROVIDES_${PN} += "kernel-module-${PN}-${KERNEL_VERSION}" |
| 120 | #RPROVIDES_${PN} += "kernel-module-${PN}-connac-lib-${KERNEL_VERSION}" |
| 121 | |
developer | f11ee16 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 122 | KERNEL_MODULE_AUTOLOAD += "mt7915e" |