[R2] Can't get the kernel to load MT7615 firmware on neither debian 9 (4.14) nor 10 (5.4)

Hi,

I’ve been trying for a while to get an MTK MT7615 (the one from here) on my banana pi R2.

I’ve already checked this thread for help. That thread mentions mt7615e_rf.bin, and later mt7615e_cr4.bin, mt7615e_n9.bin and mt7615e_rom_patch.bin. The first one I’ve never found it anywhere, so I guess it’s a typo or has been renamed. As for the rest, I’ve tried copying them to /lib/firmware/mediatek, /lib/firmware with zero success (not even any relevant change in dmesg) both in debian 9 and 10.

I’ve also tried to modprobe mt76 with and without the firmware, again, with zero success.

# lspci  # Partial
01:00.0 Unclassified device [0002]: MEDIATEK Corp. Device 7615

# lshw  # Partial
        *-generic UNCLAIMED
             description: Unclassified device
             product: MEDIATEK Corp.
             vendor: MEDIATEK Corp.
             physical id: 0
             bus info: pci@0000:01:00.0
             version: 00
             width: 64 bits
             clock: 33MHz
             capabilities: msi pm pciexpress cap_list
             configuration: latency=0
             resources: memory:60000000-600fffff

Am I blind and missing something? Wouldn’t be the first time… Or do I need to recompile a new kernel? I’d like to avoid that if at all possible.

Thanks.

mt7615e_rf.bin (and mt7622_rf.bin maybe with wmac) is eeprom file for patches by skype/me. It is downloadable in the thread with the eeprom-patches

What is the problem with your card (card not recognized,not working,…)? Any dmesg output which helps further?

4.14 does not have mt7615 driver…only 5.4 (maybe only my version)

The information above stands for both debian 9 and 10 with their respective kernels (thread title).

Running dmesg | grep mt76 returns nothing on both systems.

Thanks for pointing me to the right thread for the files, just found them. For anyone that needs them in the future, this post has them.

I’m currently trying if it works. As soon as I manage to get it working (or not), I’ll update this message.

If your dmesg does not return anything for mt76 you have no driver or it is not loaded…

You can try to find it in /lib/modules/$(uname -r)/kernel/drivers/net/wireless/mediatek if there is any

As i said,4.14 does not have mt7615 driver (see my tree) Mainline 5.4 does contain mt7615 driver (my repo uses different folder because i added newer version with mt7622 wifi driver,but mainline mt76 folder is still there)

Which exact 5.4 kernel do you have? From my repo or anywhere else? Imho 5.4 i shipped with debian 10 image had not the driver included

Yes, the mt76 is there (/lib/modules/5.4.58-bpi-r2-main/kernel/drivers/net/wireless/mediatek/mt76_new/mt76.ko), but loading does nothing (no change in lspci or lshw, or dmesg).

For both versions I’m using your images, but I’ve stopped trying on the 4.14 since it doesn’t have the driver. The image is the one from your repo, downloaded this evening.

Exact kernel version:

# uname -a
Linux bpi-r2 5.4.58-bpi-r2-main #146 SMP Sun Aug 16 15:42:09 CEST 2020 armv7l GNU/Linux

Still no dmesg, wlan interface, or noticeable change after copying the firmware files, modprobing, rebooting… (in any order).

Mt7615 is imho names mt7615e…so you need to load this module too…look in mt76_new/mt7615 dir

mt76.ko imho is only core. *_rf.bin is not loaded in -main branch (only in 5.9-mt76eeprom)

It seems that there’s no mt7615e module.

root@bpi-r2:~# find /lib/modules/$(uname -r)/kernel/drivers/net/wireless/mediatek         
/lib/modules/5.4.58-bpi-r2-main/kernel/drivers/net/wireless/mediatek
/lib/modules/5.4.58-bpi-r2-main/kernel/drivers/net/wireless/mediatek/mt76_new
/lib/modules/5.4.58-bpi-r2-main/kernel/drivers/net/wireless/mediatek/mt76_new/mt76x2
/lib/modules/5.4.58-bpi-r2-main/kernel/drivers/net/wireless/mediatek/mt76_new/mt76x2/mt76x2e.ko
/lib/modules/5.4.58-bpi-r2-main/kernel/drivers/net/wireless/mediatek/mt76_new/mt76x2/mt76x2-common.ko
/lib/modules/5.4.58-bpi-r2-main/kernel/drivers/net/wireless/mediatek/mt76_new/mt76.ko
/lib/modules/5.4.58-bpi-r2-main/kernel/drivers/net/wireless/mediatek/mt76_new/mt76x02-lib.ko

Does that mean I have to build my own kernel using the 5.9-mt76eeprom branch?

you do not need the eeprom-patch as it currently only for testing (increasing tx power, change mac and similar).

but you need newer version, to include mt7615 driver, as i do not see mt7615e.ko, current r2 defconfig on 5.4-main branch contains the CONFIG_MT7615E=m option, i do not know on which kernel-version i had added it (commit a9d427b51647 on nov 19 2020, i guess 5.4.78), but you can use precompiled kernels from github-releases (you do not need to compile by yourself)

Alright, I’ve installed it from the debs, but I can’t find the uEnv.txt to add the new kernel. Has the bootloader changed?

root@bpi-r2:~# find /mnt/  # after a mount /dev/mmcblk0p1 /mnt
/mnt/
/mnt/bananapi
/mnt/bananapi/bpi-r2
/mnt/bananapi/bpi-r2/linux
/mnt/bananapi/bpi-r2/linux/uImage
/mnt/bananapi/bpi-r2/linux/dtb
/mnt/bananapi/bpi-r2/linux/dtb/bpi-r2.dtb
/mnt/bananapi/bpi-r2/linux/dtb/bpi-r2-5.4.83-bpi-r2-main.dtb
/mnt/bananapi/bpi-r2/linux/uImage_nodt
/mnt/bananapi/bpi-r2/linux/uImage_nodt-5.4.83-bpi-r2-main
/mnt/bananapi/bpi-r2/linux/uImage-5.4.83-bpi-r2-main
/mnt/config-5.4.83-bpi-r2-main
/mnt/System.map-5.4.83-bpi-r2-main

Update: Nevermind, it magically showed up somehow… Now I’m confused.

Debs in 5.4 do not change uEnv.txt as this change was only done in my own debs (now modified linux way is used to support source debs to). You have to add new kernel to your uEnv.txt manually. Path have not changed (it is defined in uboot,not linux)

/boot/bananapi/bpi-r2/linux/uEnv.txt (if mmcblk0p1 is mounted to /boot)

That’s what I’m trying, but uEnv.txt disappeared again (the previous find command applies here).

I’ve also tried writing the image name manually at the uboot menu, but it crashed with a kernel panic not syncing.

Not syncing mostly is because rootfs not found (root=/dev/mmcblk0p2 not set).

In my uboot you can use first menuentry which lists kernel-files found on sdcard and select one by entering name. Or set kernel variable b

setenv kernel uImage...

And run default menuentry (or “run newboot”). You can create a new uenv.txt if there is none

Yes, that was it. I searched your repos for uboot scripts and managed to boot it. Still no uEnv.txt, though.

The good news are that I can finally see wlp1s0. Thanks.

In your wiki you say that to enable dual-ap, the following needs to be done:

# echo 1 > /sys/kernel/debug/ieee80211/phy0/mt76/dbdc

However, there’s no dbdc on my /sys filesystem. Will dual-ap (2.4 + 5) work without it?

Update: Nope, doesn’t work. Hostapd doesn’t seem to like two processes on the same interface, so I’ll need to find a way to enable dbdc.

I guess dbdc was not yet in 5.4 driver…have tried it short in 5.9,but got report that it is not possible after reboot. I hope this is fixed in 5.10

I understand. Thanks again.

Maybe I’ll try compiling 5.9 to test it when I have some time.

5.10 was released yesterday. I’m still prepare it…if you can wait a bit it will be on github releases next days :slight_smile:

Seems like dbdc is added with 5.7:

Sure, no problem. I’ll gladly beta-test it :smiley:

i have pushed 5.10-main tree, i hope i have added all important…also added code for eeprom-override (if you want to test this too)…travis builds currently, takes approx. 1 hour to complete and upload to github-releases

but i have not yet merged the deb-patches, so they do not contain right kernel-file…have removed the debs from first build and pushed again with pack_deps patch…currently it is not compatible with out-of-tree-build, but enough for travis build

Have you tried 5.10-main?

Yes, I did try a few days ago. But then a bunch of work came and I didn’t have time to try again.

The dbdc file did exist, but echoing 1 to it did not create another wireless interface. If I remember correctly, both 2.4 and 5GHz worked ok individually, but I couldn’t manage to get both of them working at the same time on the same interface.

Then after some tries, I couldn’t manage to get neither the 2.4 nor 5GHz bands individually either, probably because of the reboot bug. After stopping the bpi for a while, I did try again, but I couldn’t configure the region and every band would be marked as “No IR” (I think it was IR), so hostapd wouldn’t start.

However, all of this was with the 5.10 from two weeks ago. I did notice a few days ago that the one I downloaded was missing, so I guess there was something wrong with it? I’ll try again with a new image and the 5.10 that’s on github releases at the moment.

PS: I’ve also noticed that the wifi board (well, at least the IC) gets as hot as 80ºC even when it’s not in use or the driver isn’t loaded. Any suggestion on how to lower its power from software? Perhaps a heatsink?