[R2] Need help with Debian 10 and MT7615 PCIe card

Can anybody help me get the MT7615 PCIe card working with Frank’s Debian 10 image? I’ve updated the image to 5.4.77 using Frank’s kernel builder and miscellaneous files to to get the onboard wifi working . I can successfully connect to the onboard wifi.

However, the MT7615 card doesn’t show up and I don’t know how to get it to show up on the install. I’ve had success getting the MT7615 visible with OpenWRT, but not working…

Can anybody please help me? Thanks in advance!

have you installed firmware-files? is mt7615 module loaded?

here a test with 5.10…have no actual 5.4 on my test-r2 atm

root@bpi-r2:~# cat /etc/issue                                                                                                                                       
Debian GNU/Linux 10 \n \l                                                                                                                                           
                                                                                                                                                                    
root@bpi-r2:~# uname -a                                                                                                                                             
Linux bpi-r2 5.10.0-rc1-bpi-r2 #4 SMP Sun Nov 1 19:06:15 CET 2020 armv7l GNU/Linux                                                                                  
root@bpi-r2:~# dmesg | grep mt7615                                                                                                                                  
[   10.373576] mt7615e 0000:01:00.0: enabling device (0140 -> 0142)                                                                                                 
[   10.442159] mt7615e 0000:01:00.0: HW/SW Version: 0x8a108a10, Build Time: 20180518100604a                                                                         
[   10.500853] mt7615e 0000:01:00.0: N9 Firmware Version: _reserved_, Build Time: 20200814163649                                                                    
[   10.531781] mt7615e 0000:01:00.0: CR4 Firmware Version: _reserved_, Build Time: 20190121161307                                                                   
root@bpi-r2:~# lspci                                                                                                                                                
00:00.0 PCI bridge: MEDIATEK Corp. Device 0801 (rev 01)                                                                                                             
00:01.0 PCI bridge: MEDIATEK Corp. Device 0801 (rev 01)                                                                                                             
01:00.0 Unclassified device [0002]: MEDIATEK Corp. Device 7615                                                                                                      
02:00.0 IDE interface: ASMedia Technology Inc. ASM1061 SATA IDE Controller (rev 02)                                                                                 
root@bpi-r2:~# 

currently building 5.4 for r2…on 5.4 i replaced the mt76 driver (drivers/net/wireless/mt76_new) with a newer version from openwrt…maybe there is any bug with mt7615

  • first check, mt7615 is not activated in 5.4

Building the kernel using 5.10-rc branch at this moment…

BTW, when I executed dmesg | grep mt7615, I received no output. Everything else was the same (except for the kernel version, obviously)

after adding mt7615 driver i see it in dmesg

root@bpi-r2:~# cat /etc/issue;uname -a; lspci;dmesg|grep mt7615                                                                                                     
Debian GNU/Linux 10 \n \l                                                                                                                                           
                                                                                                                                                                    
Linux bpi-r2 5.4.77-bpi-r2-main #1 SMP Thu Nov 19 19:25:22 CET 2020 armv7l GNU/Linux                                                                                
00:00.0 PCI bridge: MEDIATEK Corp. Device 0801 (rev 01)                                                                                                             
00:01.0 PCI bridge: MEDIATEK Corp. Device 0801 (rev 01)                                                                                                             
01:00.0 Unclassified device [0002]: MEDIATEK Corp. Device 7615                                                                                                      
02:00.0 IDE interface: ASMedia Technology Inc. ASM1061 SATA IDE Controller (rev 02)                                                                                 
[   14.411782] mt7615e 0000:01:00.0: enabling device (0140 -> 0142)                                                                                                 
[   14.418010] mt7615e 0000:01:00.0: Load firmware : /lib/firmware/mediatek/mt7615e_rf.bin                                                                          
[   14.429179] mt7615e 0000:01:00.0: Load firmware Failed : /lib/firmware/mediatek/mt7615e_rf.bin                                                                   
[   14.463311] mt7615e 0000:01:00.0: HW/SW Version: 0x8a108a10, Build Time: 20180518100604a                                                                         
[   14.516149] mt7615e 0000:01:00.0: N9 Firmware Version: _reserved_, Build Time: 20200814163649                                                                    
[   14.538770] mt7615e 0000:01:00.0: CR4 Firmware Version: _reserved_, Build Time: 20190121161307                                                                   
root@bpi-r2:~# 

pushed defconfig-change to github

Since you pushed something to the repo, I removed my git pull, then repulled, then recompiled from the master branch for 5.4.77. Here is the results:

root@bananapi:~# cat /etc/issue;uname -a; lspci;dmesg|grep mt7615
Debian GNU/Linux 10 \n \l

Linux bananapi 5.4.77-bpi-r2-main #1 SMP Thu Nov 19 14:11:29 CST 2020 armv7l GNU/Linux
00:00.0 PCI bridge: MEDIATEK Corp. Device 0801 (rev 01)
00:01.0 PCI bridge: MEDIATEK Corp. Device 0801 (rev 01)
01:00.0 Unclassified device [0002]: MEDIATEK Corp. Device 7615
02:00.0 IDE interface: ASMedia Technology Inc. ASM1061 SATA IDE Controller (rev 02)
[   10.709532] mt7615e 0000:01:00.0: enabling device (0140 -> 0142)
[   10.715916] mt7615e 0000:01:00.0: Load firmware : /lib/firmware/mediatek/mt7615e_rf.bin
[   10.756072] mt7615e 0000:01:00.0: Load firmware Failed : /lib/firmware/mediatek/mt7615e_rf.bin
[   10.790073] mt7615e 0000:01:00.0: Direct firmware load for mediatek/mt7615_rom_patch.bin failed with error -2
[   10.802370] mt7615e: probe of 0000:01:00.0 failed with error -2
root@bananapi:~#

Will try branch 5.10-rc1 next, if you think that’s a good idea…

Have you added firmwarefile

/lib/firmware/mediatek/mt7615e_rf.bin

?

Just looked. It doesn’t exist. Where in your repo does it exist to pull from?

Afair rf was optional eeprom-file from here:

Yes,rf is eeprom-file (optional),see this commit But you need the n9,cr4 and maybe rompatch

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/mediatek

I added the mt7615_rf.bin file you mentioned to /lib/firmware/mediatek and reboot the machine. I get these messages from dmesg | grep mt7615:

root@bananapi:~# dmesg | grep "mt7615"
[   10.734252] mt7615e 0000:01:00.0: enabling device (0140 -> 0142)
[   10.740580] mt7615e 0000:01:00.0: Load firmware : /lib/firmware/mediatek/mt7615e_rf.bin
[   10.793882] mt7615e 0000:01:00.0: Load firmware OK, count 1024 byte
[   20.979016] mt7615e 0000:01:00.0: Message -16 (seq 1) timeout
[   20.984788] mt7615e 0000:01:00.0: Failed to get patch semaphore
[   31.219013] mt7615e 0000:01:00.0: Message -16 (seq 2) timeout
[   31.224792] mt7615e 0000:01:00.0: Failed to get patch semaphore
[   41.459012] mt7615e 0000:01:00.0: Message -16 (seq 3) timeout
[   41.464780] mt7615e 0000:01:00.0: Failed to get patch semaphore
[   51.699002] mt7615e 0000:01:00.0: Message -16 (seq 4) timeout
[   51.704774] mt7615e 0000:01:00.0: Failed to get patch semaphore
[   61.938998] mt7615e 0000:01:00.0: Message -16 (seq 5) timeout
[   61.944763] mt7615e 0000:01:00.0: Failed to get patch semaphore
[   72.179002] mt7615e 0000:01:00.0: Message -16 (seq 6) timeout
[   72.184770] mt7615e 0000:01:00.0: Failed to get patch semaphore
[   82.419003] mt7615e 0000:01:00.0: Message -16 (seq 7) timeout
[   82.424769] mt7615e 0000:01:00.0: Failed to get patch semaphore
[   92.659002] mt7615e 0000:01:00.0: Message -16 (seq 8) timeout
[   92.664768] mt7615e 0000:01:00.0: Failed to get patch semaphore
[  102.899003] mt7615e 0000:01:00.0: Message -16 (seq 9) timeout
[  102.904770] mt7615e 0000:01:00.0: Failed to get patch semaphore
[  113.139004] mt7615e 0000:01:00.0: Message -16 (seq 10) timeout
[  113.144857] mt7615e 0000:01:00.0: Failed to get patch semaphore
[  123.379002] mt7615e 0000:01:00.0: Message -16 (seq 11) timeout
[  123.384855] mt7615e 0000:01:00.0: Failed to get patch semaphore
[  123.394486] mt7615e: probe of 0000:01:00.0 failed with error -11

It literally takes over 2 minutes while trying to do whatever with the module. This issue didn’t exist before I added this module to my kernel; plus I cannot log in via serial or SSH until it finishes doing whatever it’s doing (which is really annoying…)


Sorry, not trying to be stupid, but where do I get those patches?

EDIT: Hold up, I followed the last link and see those files. What do I do with them? Put them in /lib/firmware/meditek as well?


UPDATE: Okay, once again, I followed the link and found the eeprom.c in the drivers/net/wireless/mediatek/mt76_new/mt7615 directory. How do I use the mt76_new folder instead of the mt76 folder? Do I just change the names, or… ?


LAST UPDATE: It’s almost bedtime and I have to get up ridiculously early in the morning to be at work. So I’m gonna retire for the night. Thank you so far for all your assistance, Frank!

Right,put these files on r2 in your rootfs in the path. Last line in your prevous log shows path for rom-patch file.

Semaphore-issue should be solved…i guess you see it because of missing firmware files

Maybe your semaphore-issue is caused by the fix…as it tries again on this error. But your semaphore issue has eootcause of missing file so i guess handle is not freed

if firmware-file is missing, mcu_init should not return -EAGAIN

as far as i see, semaphore-issue triggers before the file (RAM_PATCH) is loaded

Okay, first thing I tried was putting the specified files in the /lib/firmware/mediatek directory. Semaphore error occurred. I think tried /lib/firmware/mediatek/mediatek directory. Same thing. I’m at a loss of where to put the files… Here is the log (yeah, it’s pretty much a dup of last time…) You said the place to put the rom_patch file was the last line in my previous log. Here is it:

root@bananapi:~# dmesg | grep mt76
[   10.638721] mt7615e 0000:01:00.0: enabling device (0140 -> 0142)
[   10.644935] mt7615e 0000:01:00.0: Load firmware : /lib/firmware/mediatek/mt7615e_rf.bin
[   10.678965] mt7615e 0000:01:00.0: Load firmware OK, count 1024 byte
[   20.977932] mt7615e 0000:01:00.0: Message -16 (seq 1) timeout
[   20.983705] mt7615e 0000:01:00.0: Failed to get patch semaphore
[   31.217968] mt7615e 0000:01:00.0: Message -16 (seq 2) timeout
[   31.223739] mt7615e 0000:01:00.0: Failed to get patch semaphore
[   41.457968] mt7615e 0000:01:00.0: Message -16 (seq 3) timeout
[   41.463736] mt7615e 0000:01:00.0: Failed to get patch semaphore
[   51.697950] mt7615e 0000:01:00.0: Message -16 (seq 4) timeout
[   51.703718] mt7615e 0000:01:00.0: Failed to get patch semaphore
[   61.937957] mt7615e 0000:01:00.0: Message -16 (seq 5) timeout
[   61.943726] mt7615e 0000:01:00.0: Failed to get patch semaphore
[   72.177961] mt7615e 0000:01:00.0: Message -16 (seq 6) timeout
[   72.183729] mt7615e 0000:01:00.0: Failed to get patch semaphore
[   82.417937] mt7615e 0000:01:00.0: Message -16 (seq 7) timeout
[   82.423704] mt7615e 0000:01:00.0: Failed to get patch semaphore
[   92.657953] mt7615e 0000:01:00.0: Message -16 (seq 8) timeout
[   92.663721] mt7615e 0000:01:00.0: Failed to get patch semaphore
[  102.897957] mt7615e 0000:01:00.0: Message -16 (seq 9) timeout
[  102.903725] mt7615e 0000:01:00.0: Failed to get patch semaphore
[  113.137947] mt7615e 0000:01:00.0: Message -16 (seq 10) timeout
[  113.143820] mt7615e 0000:01:00.0: Failed to get patch semaphore
[  123.377952] mt7615e 0000:01:00.0: Message -16 (seq 11) timeout
[  123.383806] mt7615e 0000:01:00.0: Failed to get patch semaphore
[  123.389950] mt7615e: probe of 0000:01:00.0 failed with error -11
root@bananapi:~# 

In addition, your message said the rom_patch file should be placed in the location specified by the last line in my log. That path is relative, not an absolute path, so I’m a little more than a little confused here…

It is relative to /lib/firmware. I have no idea why you got the error,because it looks like before first file gets loaded. You have compiled mt7615 as module,right (like my current defconfig)?

Try removing the rf (eeprom) file,as i have not tested it with mt7615 (only with mt7622)

Yeah, I haven’t changed the default configuration regarding mt7615. Added a few options for my Relatek USB ethernet adapter and phone USB tethering, though…

I’ve put the files back in /lib/firmware/mediatek, removed the rf file, and rebooted. Only difference is these lines from dmesg.

[   10.780487] mt7615e 0000:01:00.0: Load firmware : /lib/firmware/mediatek/mt7615e_rf.bin
[   10.805624] mt7615e 0000:01:00.0: Load firmware Failed : /lib/firmware/mediatek/mt7615e_rf.bin

Semaphore errors still occur.

Btw, not sure what I’m supposed to do with the code brackets you attached several posts ago…

Should I try the 5.10-rc1 branch and see if it cooperates?


This seems to be linked to a bluetooth/rfkill option. How to disable?

EDIT: Nevermind, found the option to disable. Compiling now. Won’t be able to test until this afternoon. (It’s currently 4:18am, I get off at 2pm)

The bluetooth-problem is related to bpi-r64 where wifi and bluetooth shares some registers/memory in hardware. Your configuration is bluetooth from r2 and separate mt7615 wifi so this should not be affected. It does not on my system.not in 5.4 and not in 5.10. But you can try 5.10. And you can try reverting the semaphore patch… but i guess this only brings one error not the repeation…card should not work too.

Rf (eeprom) file is optional,so you can ignore this error. Still have no idea why you get semaphore error on r2 as should only be r64 related.

Still wondering why it does not work for you because it works with my hardware

This is annoying… Disabling bluetooth on 5.4.77 didn’t do anything. Same errors…

Changed git branch to 5.10-rc, compiled, and loaded into the rootfs. Wifi adapter came up, but the serial connection stopped responding once it got things working… Was able to log in using SSH, so not a complete loss. I’m restoring the base image so I can make the changes without contamination from anything else I did to the image, but it’s looking favorable now with the 5.10-rc branch…

I saw a 5.10-wifi branch. Is there something special about that branch compared to 5.10-rc?

EDIT: Compiling 5.10-wifi branch to see what happens… (mostly for sh!ts and giggles)

EDIT: 5.10-wifi branch is 5.10-rc1. 5.10-rc branch is 5.10-rc4… That’s seems to be the difference…

5.10-wifi contains mt6625 (r2 internal wifi) driver…afair i have not merged into rc

Wifi-branch was created from -rc while it was rc1 and rc branch was updated later :slight_smile:

Yay! Using 5.10-wifi branch, I am able to get both the onboard wifi and the mt7615 PCIe card to be recognized! Here is the dmesg output in relation to the mt7615:

root@bananapi:~# dmesg | grep mt76
[   11.446311] mt7615e 0000:01:00.0: enabling device (0140 -> 0142)
[   11.486746] mt7615e 0000:01:00.0: Firmware is not ready for download
[   11.609846] mt7615e 0000:01:00.0 wlp1s0: renamed from wlan0
root@bananapi:~# 

EDIT: Thank you for helping me, Frank!

This should also work in 5.10-rc and maybe 5.9-main…my card is recognized in 5.4-main too…

But in your log i don’t see normal (n9,cr4) firmware is loaded and wonder why it comes up

Btw have you any process trying to access the card before init is done (hostapd,ip config)?

No, all the messages in dmesg come up before the login prompt via USB-to-TTL cable.

Rewrote the SD card yet again and updated the kernel built from the 5.9-main branch.

root@bpi-r2:~# dmesg | grep mt76
[   13.639708] mt7615e 0000:01:00.0: enabling device (0140 -> 0142)
[   13.704288] mt7615e 0000:01:00.0: HW/SW Version: 0x8a108a10, Build Time: 20180518100604a
[   13.757789] mt7615e 0000:01:00.0: N9 Firmware Version: _reserved_, Build Time: 20200814163649
[   13.795044] mt7615e 0000:01:00.0: CR4 Firmware Version: _reserved_, Build Time: 20181207140436
[   13.913698] mt7615e 0000:01:00.0 wlp1s0: renamed from wlan0
root@bpi-r2:~# 

But a reboot a few minutes after seeing these messages results in this:

root@bananapi:~# dmesg | grep mt76
[   11.487844] mt7615e 0000:01:00.0: enabling device (0140 -> 0142)
[   11.522232] mt7615e 0000:01:00.0: Firmware is not ready for download
[   11.805216] mt7615e 0000:01:00.0 wlp1s0: renamed from wlan0
root@bananapi:~#

Getting kinda irritated with this… Shouldn’t I see the N9 and CR4 firmware load each restart?

UPDATE: Disabled hostapd service and rebooted. Same message as 2nd dmesg…

UPDATE 2: Powered off the R2 and booted it up about 5 minutes later. Firmware did load during the system messages…

i’m too, i guess you should see it on every boot…do you have compiled mt7615 as module?? 11/13 sec looks a bit early for filesystem ready