package.mk for mediatek 7925 PCIe (mt7925e)

  • Hi,

    I would like to add this driver: https://github.com/openwrt/mt76 to my image

    Its for Mediatek MT7925 M2 PCIe card (mt7925e, not to be mixed with mt7925u which is for the USB version)

    I currently build and run this LE version: 6.16.7 #1 SMP Sat Sep 20 11:48:57 UTC 2025 x86_64 GNU/Linux

    My understanding is that I just have to add this as package.mk to packages/linux-driver-addons and it will be picked up during make image?

    What would package.mk need to look like?

    Thx

  • My understanding is that I just have to add this as package.mk to packages/linux-driver-addons and it will be picked up during make image?

    Not quite. Create the package folder and mt76 package.mk under packages/linux-drivers and test built the driver to ensure it compiles with e.g. PROJECT=Generic ARCH=x86_64 scripts/build mt76 then add the package to ADDITIONAL_PACKAGES in an appropriate 'options' file; either distro, project, or device level and the package will be built as part of a normal image build. Here's an example package.mk (for a realtek wifi driver): https://github.com/chewitt/LibreE…dd77d9cfa1d713e - no idea if that would work as-is or needs changes.

    The easier option would be to enable CONFIG_MT7925E=m in the kernel defconfig, as it's a one-line change and then you're using an upstream supported in-kernel driver. Just edit the relevant defconfig and rebuilt the image; the defconfig change will be detected and the kernel will be rebuilt automatically. NB: I've no idea if the driver needs firmware, but that can be manually added if needed, or you can edit the firmware pick file, either at project level or the x86_64 default one under the kernel-firmware package.

  • Firmware of mt7925e from ubuntu 6.16.8 mainline kernel:

    Code
    $ modinfo mt7925e
    [...]
    firmware:       mediatek/mt7925/WIFI_MT7925_PATCH_MCU_1_1_hdr.bin
    firmware:       mediatek/mt7925/WIFI_RAM_CODE_MT7925_1_1.bin
    [...]