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

Just compiled 5.10.9… Here is the output I have:

root@bpi-r2:/sys/kernel/debug/ieee80211/phy0/mt76# uname -a
Linux bpi-r2 5.10.9-bpi-r2-main #12 SMP Wed Jan 20 17:13:23 CST 2021 armv7l GNU/Linux
root@bpi-r2:/sys/kernel/debug/ieee80211/phy0/mt76# dmesg | grep mt76
[   13.492986] mt7615e 0000:01:00.0: enabling device (0140 -> 0142)
[   13.499332] mt7615e 0000:01:00.0: Load eeprom: /lib/firmware/mediatek/mt7615e_rf.bin
[   13.499662] mt7615e 0000:01:00.0: Open eeprom file failed: /lib/firmware/mediatek/mt7615e_rf.bin
[   13.557554] mt7615e 0000:01:00.0: HW/SW Version: 0x3e0a3c68, Build Time: 
[   13.900281] mt7615e 0000:01:00.0 wlp1s0: renamed from wlan0
[   33.781081] mt7615e 0000:01:00.0: Message 1 (seq 2) timeout
[   33.786688] mt7615e 0000:01:00.0: Download request failed
[   54.261073] mt7615e 0000:01:00.0: Message 16 (seq 3) timeout
[   54.266764] mt7615e 0000:01:00.0: Failed to release patch semaphore
root@bpi-r2:/sys/kernel/debug/ieee80211/phy0/mt76# 

At power-on, DBDC cannot to be set to 1. Same issue after reboot.


EDIT #1: I have this card

I grabbed the file mt7615_rf.bin file and placed it in /lib/firmware/mediatek/ and rebooted. Got this output on next boot:

root@bpi-r2:~# dmesg | grep mt76
[   11.904041] mt7615e 0000:01:00.0: enabling device (0140 -> 0142)
[   11.910466] mt7615e 0000:01:00.0: Load eeprom: /lib/firmware/mediatek/mt7615e_rf.bin
[   11.922263] mt7615e 0000:01:00.0: Load eeprom OK, count 1200 byte
[   12.286394] mt7615e 0000:01:00.0 wlp1s0: renamed from wlan0
[   32.501733] mt7615e 0000:01:00.0: Message 16 (seq 1) timeout
[   32.507426] mt7615e 0000:01:00.0: Failed to get patch semaphore

EDIT #2: Just for shits and giggles, I powered off and powered back on. Here is the result:

root@bpi-r2:~# dmesg | grep mt76
[   11.362207] mt7615e 0000:01:00.0: enabling device (0140 -> 0142)
[   11.368618] mt7615e 0000:01:00.0: Load eeprom: /lib/firmware/mediatek/mt7615e_rf.bin
[   11.389162] mt7615e 0000:01:00.0: Load eeprom OK, count 1200 byte
[   11.456570] mt7615e 0000:01:00.0: HW/SW Version: 0x3e0a3c68, Build Time: 
[   11.782609] mt7615e 0000:01:00.0 wlp1s0: renamed from wlan0
[   31.860503] mt7615e 0000:01:00.0: Message 1 (seq 2) timeout
[   31.866109] mt7615e 0000:01:00.0: Download request failed
[   52.340506] mt7615e 0000:01:00.0: Message 16 (seq 3) timeout
[   52.346193] mt7615e 0000:01:00.0: Failed to release patch semaphore
root@bpi-r2:~# 

strange…i don’t see the patch semaphore message some time (e.g. after 5.6 this should be fixed)…do you have all firmware-files in /lib/firmware/mediatek?

Maybe @sinovoip can help…

oh found something in buildroot environment… first i needed to mount debugfs itself

mount -t debugfs none /sys/kernel/debug/

and then mt76 is phy4 after starting r2 internal wifi…and dbdc file is only there…maybe your phy also differs

# ls /sys/kernel/debug/ieee80211/phy4/mt76/dbdc 
/sys/kernel/debug/ieee80211/phy4/mt76/dbdc

so i need to echo 1 to this and wlan2 appears (wlan0 is r2 internal wifi,wlan1 is first phy of mt7615)

Been racking my brain, trying to figure out what I had done. Turns out my mt7615*.bin files were corrupted or something. Got fresh files from a few posts back and now it works properly with 5.9.0, but I’m back at the no 2nd physical after reboot thing… Gonna try with 5.10-main branch, maybe tomorrow…

My /sys/kernel/debug directory does appear to be mounted correctly. The mt7615 card is phy0, unless I add the onboard wireless, then maybe it moves around a little…

What does happen if you echo again to the dbdc? You need to do it every bootup

Echoing 1 to /sys/kernel/debug/ieee80211/phy0/mt76/dbdc on power-up from nothing works. Once the board is rebooted, it does nothing.

EDIT: Yeah, I know that it needs to be done every bootup. I got commands to do so in my /etc/rc.local file.

BTW, powering down the system, then powering up again allows the second physical to come up.

i guess the bpi-version holds something in registers/on cache which needs maybe an additional reset while driver load. with the standard-size card i cannot reproduce this problem

maybe @sinovoip or @Ryder.Lee can test this

Potential solution in this link doesn’t work to bring up second physical interface…

I don’t know. I didn’t see any issues on mt7615.

Well, it seems that my experiments with the mt7615 have ended. The card seems to have failed… No interfaces come up in regard to the mt7615 card. So I guess it is off to find another card. Any suggestions? I live in the US and I found a mt7915 card on asiarf, but they want $35 to ship a $35 card…

Thanks for your efforts, Frank!

Imho current mt7915 is single bssid only (no dbdc see here), atm a mt7615 is better. But same problem with shipping costs…i got my card as sample,maybe you can get one too

I found tech support contact on the seller’s listing. I’m trying to contact for possible warranty replacement.

Finally got tired of dealing with this POS of a non-standard size MT7615 card and ordered the standard size MT7615 card. It works as expected, aka firmware loads at each boot and DBDC is enable-able on each reboot. Using my changes enables DBDC on each boot without such a command in the rc.local file, which may or may not enable DBDC on the card. I’m running the 5.9.0 kernel at the moment.

The side benefit of these non-helper changes are that the networking service can be restarted at any time without erroring out, which forces me to reboot the router to effect IP address changes. Now, I can change the interface file(s) without having to reboot.

I hope this post helps someone dealing with these same issues…

I have an issue of building kernel BPI-R2-4.14-4.19-mt7615. Can you help me? Here is part of build.sh output:

  CC      drivers/opp/cpu.o
In file included from drivers/net/wireless/mediatek/mt76_new/mt7615/../mt76.h:27,
             from drivers/net/wireless/mediatek/mt76_new/mt7615/mt7615.h:9,
             from drivers/net/wireless/mediatek/mt76_new/mt7615/init.c:9:
drivers/net/wireless/mediatek/mt76_new/mt7615/init.c: In function ‘mt7615_register_device’:
./include/net/mac80211.h:2342:57: error: ‘IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN’ undeclared (first use in this function); did you mean ‘IEEE80211_TX_STAT_AMPDU’?
 #define ieee80211_hw_set(hw, flg) _ieee80211_hw_set(hw, IEEE80211_HW_##flg)
                                                         ^~~~~~~~~~~~~
drivers/net/wireless/mediatek/mt76_new/mt7615/init.c:210:2: note: in expansion of macro ‘ieee80211_hw_set’
  ieee80211_hw_set(hw, TX_STATUS_NO_AMPDU_LEN);
  ^~~~~~~~~~~~~~~~
./include/net/mac80211.h:2342:57: note: each undeclared identifier is reported only once for each function it appears in
 #define ieee80211_hw_set(hw, flg) _ieee80211_hw_set(hw, IEEE80211_HW_##flg)
                                                         ^~~~~~~~~~~~~
drivers/net/wireless/mediatek/mt76_new/mt7615/init.c:210:2: note: in expansion of macro ‘ieee80211_hw_set’
  ieee80211_hw_set(hw, TX_STATUS_NO_AMPDU_LEN);
  ^~~~~~~~~~~~~~~~
make[6]: *** [scripts/Makefile.build:303: drivers/net/wireless/mediatek/mt76_new/mt7615/init.o] Error 1
make[6]: *** Waiting for unfinished jobs....
  CC [M]  drivers/net/wireless/mediatek/mt76_new/mmio.o
  CC      drivers/opp/of.o
make[5]: *** [scripts/Makefile.build:544: drivers/net/wireless/mediatek/mt76_new/mt7615] Error 2
make[5]: *** Waiting for unfinished jobs....
  CC      drivers/opp/debugfs.o

You should use newer kernel version. In 5.4 mt7615 is already supported…4.19 was only for testing

Thank you! I will try 5.4. And also a question. I have built 5.10, but x-server doesn’t work in this version on my board. Why is it? I will be able to make logs at morning.

Maybe it is because of lima. There are 2 options maybe set (AutoAddGPU,glamoregl)

https://www.fw-web.de/dokuwiki/doku.php?id=en/bpi-r2/hdmi#usage

But you can disable lima or you need to compile mesa libs

Thank you, Frank! Option “AutoAddGPU” “off” has fixed this issue and 5.10 is working fine.

Why does eth1 absent in 5.10 and 5.4? Is it normal? 5.10 ip output part:

3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc pfifo_fast state UP group default qlen 1000
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
5: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
6: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br0 state LOWERLAYERDOWN group default qlen 1000

4.19 ip output part:

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
5: wan@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
6: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br0 state LOWERLAYERDOWN group default qlen 1000

My 4.19 have some patches for second gmac (ethernet connection between soc and switch). But these are unstable and it works with one too. All ports of switch are passed with vlan (similar) over eth0

Thanks. I’ve corrected my network/interfaces.