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 | |
| 10 | SRCREV ?= "053668acdaf83d0350ce3e21720e20eac9fbbcd7" |
| 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 | |
| 27 | SRC_URI_append += " \ |
| 28 | file://100-Revert-of-net-pass-the-dst-buffer-to-of_get_mac_addr.patch \ |
| 29 | " |
| 30 | S = "${WORKDIR}/git" |
| 31 | |
| 32 | NOSTDINC_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 | |
| 42 | PKG_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 | |
| 51 | NOSTDINC_FLAGS += " \ |
| 52 | -DCONFIG_MAC80211_MESH \ |
| 53 | -DCONFIG_NL80211_TESTMODE \ |
| 54 | -DCONFIG_MAC80211_DEBUGFS \ |
| 55 | -DCONFIG_MT7986_WMAC \ |
| 56 | " |
| 57 | |
| 58 | EXTRA_OEMAKE = " \ |
| 59 | -C ${STAGING_KERNEL_BUILDDIR}/ \ |
| 60 | M=${S} \ |
| 61 | ${PKG_MAKE_FLAGS} \ |
| 62 | NOSTDINC_FLAGS="${NOSTDINC_FLAGS}" \ |
| 63 | " |
| 64 | |
| 65 | MAKE_TARGETS = "modules" |
| 66 | |
| 67 | do_configure[noexec] = "1" |
| 68 | |
| 69 | # make_scripts requires kernel source directory to create |
| 70 | # kernel scripts |
| 71 | do_make_scripts[depends] += "virtual/kernel:do_shared_workdir" |
| 72 | |
| 73 | do_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 | |
developer | bc7ed68 | 2022-04-15 13:47:16 +0800 | [diff] [blame^] | 84 | do_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 | |
| 104 | FILES_${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. |
| 121 | python populate_packages_prepend () { |
| 122 | firmware_pkgs = oe.utils.packages_filter_out_system(d) |
| 123 | d.appendVar('RDEPENDS_linux-mt76', ' ' + ' '.join(firmware_pkgs)) |
| 124 | } |
| 125 | |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 126 | KERNEL_MODULE_AUTOLOAD += "mt7915e" |