developer | ec4ebe4 | 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 | |
| 8 | PV = "1.0" |
| 9 | |
developer | 3262bf8 | 2022-07-12 11:37:54 +0800 | [diff] [blame^] | 10 | SRCREV ?= "93e3fce916c62d06892d41bf00d0f4c2926c9a0b" |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 11 | SRC_URI = " \ |
| 12 | git://git@github.com/openwrt/mt76.git;protocol=https \ |
| 13 | file://COPYING;subdir=git \ |
| 14 | " |
developer | bc7ed68 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 15 | SRC_URI += " \ |
| 16 | file://src \ |
| 17 | " |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 18 | |
| 19 | DEPENDS += "virtual/kernel" |
| 20 | DEPENDS += "linux-mac80211" |
| 21 | |
| 22 | FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:" |
developer | bc7ed68 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 23 | FILESEXTRAPATHS_prepend := "${THISDIR}/src:" |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 24 | |
| 25 | require files/patches/patches.inc |
| 26 | |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 27 | S = "${WORKDIR}/git" |
| 28 | |
| 29 | NOSTDINC_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 | |
| 39 | PKG_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 | |
| 48 | NOSTDINC_FLAGS += " \ |
| 49 | -DCONFIG_MAC80211_MESH \ |
| 50 | -DCONFIG_NL80211_TESTMODE \ |
| 51 | -DCONFIG_MAC80211_DEBUGFS \ |
| 52 | -DCONFIG_MT7986_WMAC \ |
| 53 | " |
| 54 | |
| 55 | EXTRA_OEMAKE = " \ |
| 56 | -C ${STAGING_KERNEL_BUILDDIR}/ \ |
| 57 | M=${S} \ |
| 58 | ${PKG_MAKE_FLAGS} \ |
| 59 | NOSTDINC_FLAGS="${NOSTDINC_FLAGS}" \ |
| 60 | " |
| 61 | |
| 62 | MAKE_TARGETS = "modules" |
| 63 | |
| 64 | do_configure[noexec] = "1" |
| 65 | |
| 66 | # make_scripts requires kernel source directory to create |
| 67 | # kernel scripts |
| 68 | do_make_scripts[depends] += "virtual/kernel:do_shared_workdir" |
| 69 | |
| 70 | do_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 | |
developer | bc7ed68 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 81 | do_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 | |
| 90 | install -m 644 ${WORKDIR}/src/firmware/mt7986_rom_patch.bin ${D}${base_libdir}/firmware/mediatek/ |
| 91 | install -m 644 ${WORKDIR}/src/firmware/mt7986_rom_patch_mt7975.bin ${D}${base_libdir}/firmware/mediatek/ |
| 92 | install -m 644 ${WORKDIR}/src/firmware/mt7986_wa.bin ${D}${base_libdir}/firmware/mediatek/ |
| 93 | install -m 644 ${WORKDIR}/src/firmware/mt7986_wm.bin ${D}${base_libdir}/firmware/mediatek/ |
| 94 | install -m 644 ${WORKDIR}/src/firmware/mt7986_wm_mt7975.bin ${D}${base_libdir}/firmware/mediatek/ |
| 95 | install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7975_dual.bin ${D}${base_libdir}/firmware/mediatek/ |
| 96 | install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7976_dbdc.bin ${D}${base_libdir}/firmware/mediatek/ |
| 97 | install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7976.bin ${D}${base_libdir}/firmware/mediatek/ |
| 98 | install -m 644 ${WORKDIR}/src/firmware/mt7986_eeprom_mt7976_dual.bin ${D}${base_libdir}/firmware/mediatek/ |
developer | 3262bf8 | 2022-07-12 11:37:54 +0800 | [diff] [blame^] | 99 | install -m 644 ${WORKDIR}/src/firmware/mt7986_wo_0.bin ${D}${base_libdir}/firmware/mediatek/ |
| 100 | install -m 644 ${WORKDIR}/src/firmware/mt7986_wo_1.bin ${D}${base_libdir}/firmware/mediatek/ |
developer | bc7ed68 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 101 | } |
| 102 | |
| 103 | FILES_${PN} += " \ |
| 104 | ${base_libdir}/firmware/mediatek/mt7915_rom_patch.bin \ |
| 105 | ${base_libdir}/firmware/mediatek/mt7915_wa.bin \ |
| 106 | ${base_libdir}/firmware/mediatek/mt7915_wm.bin \ |
| 107 | ${base_libdir}/firmware/mediatek/mt7915_eeprom.bin \ |
| 108 | ${base_libdir}/firmware/mediatek/mt7915_eeprom_dbdc.bin \ |
| 109 | ${base_libdir}/firmware/mediatek/mt7986_rom_patch.bin\ |
| 110 | ${base_libdir}/firmware/mediatek/mt7986_rom_patch_mt7975.bin \ |
| 111 | ${base_libdir}/firmware/mediatek/mt7986_wa.bin \ |
| 112 | ${base_libdir}/firmware/mediatek/mt7986_wm.bin \ |
| 113 | ${base_libdir}/firmware/mediatek/mt7986_wm_mt7975.bin \ |
| 114 | ${base_libdir}/firmware/mediatek/mt7986_eeprom_mt7975_dual.bin \ |
| 115 | ${base_libdir}/firmware/mediatek/mt7986_eeprom_mt7976_dbdc.bin \ |
| 116 | ${base_libdir}/firmware/mediatek/mt7986_eeprom_mt7976.bin \ |
| 117 | ${base_libdir}/firmware/mediatek/mt7986_eeprom_mt7976_dual.bin \ |
developer | 3262bf8 | 2022-07-12 11:37:54 +0800 | [diff] [blame^] | 118 | ${base_libdir}/firmware/mediatek/mt7986_wo_0.bin \ |
| 119 | ${base_libdir}/firmware/mediatek/mt7986_wo_1.bin \ |
developer | bc7ed68 | 2022-04-15 13:47:16 +0800 | [diff] [blame] | 120 | " |
| 121 | # Make linux-mt76 depend on all of the split-out packages. |
| 122 | python populate_packages_prepend () { |
| 123 | firmware_pkgs = oe.utils.packages_filter_out_system(d) |
| 124 | d.appendVar('RDEPENDS_linux-mt76', ' ' + ' '.join(firmware_pkgs)) |
| 125 | } |
| 126 | |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 127 | KERNEL_MODULE_AUTOLOAD += "mt7915e" |