Banana Pi R-64 and WiFi

[ 1.564659] mtk-pcie 1a143000.pcie: host bridge /pcie@1a143000 ranges: [ 1.572607] mtk-pcie 1a143000.pcie: Parsing ranges property… [ 1.583678] mtk-pcie 1a143000.pcie: MEM 0x0020000000…0x0027ffffff -> 0x0020000000 [ 1.695696] mtk-pcie 1a143000.pcie: Port0 link down [ 1.700783] mtk-pcie 1a143000.pcie: PCI host bridge to bus 0000:00 [ 1.706975] pci_bus 0000:00: root bus resource [bus 00-ff] [ 1.712470] pci_bus 0000:00: root bus resource [mem 0x20000000-0x27ffffff] [ 1.719352] pci_bus 0000:00: scanning bus [ 1.724542] pci_bus 0000:00: fixups for bus [ 1.728735] pci_bus 0000:00: bus scan returning with max=00 [ 1.734702] mtk-pcie 1a145000.pcie: host bridge /pcie@1a145000 ranges: [ 1.741278] mtk-pcie 1a145000.pcie: Parsing ranges property… [ 1.747123] mtk-pcie 1a145000.pcie: MEM 0x0028000000…0x002fffffff -> 0x0028000000 [ 1.855455] mtk-pcie 1a145000.pcie: Port1 link down [ 1.860551] mtk-pcie 1a145000.pcie: PCI host bridge to bus 0001:00 [ 1.866746] pci_bus 0001:00: root bus resource [bus 00-ff] [ 1.872240] pci_bus 0001:00: root bus resource [mem 0x28000000-0x2fffffff] [ 1.879122] pci_bus 0001:00: scanning bus [ 1.884284] pci_bus 0001:00: fixups for bus [ 1.888474] pci_bus 0001:00: bus scan returning with max=00

mhm, still link down.

#check kernel version
uname -r
#list loaded modules
lsmod
#show modules directory
ls -l /lib/modules/$(uname -r)

uname -r => 5.15.33-bpi-r64-main

lsmod => Module Size Used by btmtkuart 24576 0 bluetooth 471040 2 btmtkuart cfg80211 270336 0 ecdh_generic 16384 1 bluetooth ecc 24576 1 ecdh_generic rfkill 28672 3 bluetooth,cfg80211 libaes 16384 1 bluetooth pwm_fan 20480 0 ip_tables 28672 0 x_tables 32768 1 ip_tables

ls -l /lib/modules/$(uname -r) => There are all my modules, that I´ve copied it…

ok, some modules are loaded, so that this is not the problem…and you can do

modprobe mt7615e

and should see loading of the mt7622-wmac

but still the pcie port link down…looks like something is broken in 5.15 with pcie, need to find some time to test it with my board

Thank you so much, if I type “modprobe mt7615e”, I see now the “wlan0 - Interface” with “ifconfig -a” -> but, without IP - Adresses. Is there a good way to do that via booting the system?

where should the wlan0-ip came from? you can set a static ip on your host or get an ip-adress from your router after an connection to its bssid

but wlan0 is the mt7622 wmac, not the mt7615 you inserted into your pcie-slot

dmesg | grep -iB5 wlan0

“…but wlan0 is the mt7622 wmac, not the mt7615 you plugged into your pcie slot”.

Now I don’t understand the WHOLE thing at all. I do have 2.4 GHz (onBoard) and the 5 GHz (pcie-slot), right? And if so, which system must report, how?

You should see the 5g card in lspci (no “port link down”)…and 2 wlan interfaces (mt7622-wmac and one for mt7615 card),if dbdc active there should be 3 wlanX interfaces

here my output with kernel i have currently installed on my board:

root@bpi-r64:~# uname -a
Linux bpi-r64 5.17.0-rc4-bpi-r64-r64 #10 SMP PREEMPT Sun Feb 20 19:24:22 CET 2022 aarch64 GNU/Linux
root@bpi-r64:~# lspci
00:00.0 PCI bridge: MEDIATEK Corp. Device 3258
01:00.0 Unclassified device [0002]: MEDIATEK Corp. Device 7615
root@bpi-r64:~# dmesg | grep -i 'pci\|mt76'
[    0.000000] Kernel command line: board=bpi-r64 console=ttyS0,115200n1 earlyprintk root=/dev/mmcblk1p5 rootfstype=ext4 rootwait service=linux debug=7 initcall_debug=0 2
[    0.066803] PCI: CLS 0 bytes, default 64
[    1.346746] rtc_mt7622 10212800.rtc: registered as rtc0
[    1.352025] rtc_mt7622 10212800.rtc: setting system clock to 2000-01-01T00:00:00 UTC (946684800)
[    1.610417] mtk-pcie 1a143000.pcie: host bridge /pcie@1a143000 ranges:
[    1.617215] mtk-pcie 1a143000.pcie: Parsing ranges property...
[    1.625316] mtk-pcie 1a143000.pcie:      MEM 0x0020000000..0x0027ffffff -> 0x0020000000
[    1.769967] mtk-pcie 1a143000.pcie: PCI host bridge to bus 0000:00
[    1.776171] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.781666] pci_bus 0000:00: root bus resource [mem 0x20000000-0x27ffffff]
[    1.788548] pci_bus 0000:00: scanning bus
[    1.792611] pci 0000:00:00.0: [14c3:3258] type 01 class 0x060400
[    1.798654] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x1ffffffff 64bit pref]
[    1.807494] pci_bus 0000:00: fixups for bus
[    1.811713] pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 0
[    1.818422] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.826506] pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 1
[    1.833371] pci_bus 0000:01: scanning bus
[    1.837555] pci 0000:01:00.0: [14c3:7615] type 00 class 0x000280
[    1.843750] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit]
[    1.851526] pci 0000:01:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x1 link at 0000:00:00.0 (capable of 4.000 Gb/s with 5.0 GT/s PCIe x1 link)
[    1.878538] pci_bus 0000:01: fixups for bus
[    1.882751] pci_bus 0000:01: bus scan returning with max=01
[    1.888332] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    1.894961] pci_bus 0000:00: bus scan returning with max=01
[    1.900557] pci 0000:00:00.0: BAR 0: no space for [mem size 0x200000000 64bit pref]
[    1.908220] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x200000000 64bit pref]
[    1.916230] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
[    1.923029] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
[    1.930430] pci 0000:00:00.0: PCI bridge to [bus 01]
[    1.935406] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
[    1.942703] mtk-pcie 1a145000.pcie: host bridge /pcie@1a145000 ranges:
[    1.949320] mtk-pcie 1a145000.pcie: Parsing ranges property...
[    1.955177] mtk-pcie 1a145000.pcie:      MEM 0x0028000000..0x002fffffff -> 0x0028000000
[    2.169335] mtk-pcie 1a145000.pcie: Port1 link down
[    2.174421] mtk-pcie 1a145000.pcie: PCI host bridge to bus 0001:00
[    2.180613] pci_bus 0001:00: root bus resource [bus 00-ff]
[    2.186108] pci_bus 0001:00: root bus resource [mem 0x28000000-0x2fffffff]
[    2.192990] pci_bus 0001:00: scanning bus
[    2.198198] pci_bus 0001:00: fixups for bus
[    2.202390] pci_bus 0001:00: bus scan returning with max=00
[    6.552232] mt7615e 0000:01:00.0: assign IRQ: got 146
[    6.597695] pci 0000:00:00.0: enabling device (0000 -> 0002)
[    6.685422] pci 0000:00:00.0: enabling bus mastering
[    6.741563] mt7615e 0000:01:00.0: enabling device (0000 -> 0002)
[    6.788484] mt7615e 0000:01:00.0: enabling bus mastering
[    6.836077] mtk-pcie 1a143000.pcie: msi#0 address_hi 0x0 address_lo 0x410c50c0
[    6.883635] mt7615e 0000:01:00.0: Load eeprom: /lib/firmware/mediatek/mt7615e_rf.bin
[    6.912638] mt7615e 0000:01:00.0: Open eeprom file failed: /lib/firmware/mediatek/mt7615e_rf.bin
[    7.208328] mt7622-wmac 18000000.wmac: Load eeprom: /lib/firmware/mediatek/mt7622-wmac_rf.bin
[    7.231200] mt7622-wmac 18000000.wmac: Load eeprom OK, count 1024 byte
[    7.403987] mt7615e 0000:01:00.0 wlp1s0: renamed from wlan0
[    7.405200] mt7622-wmac 18000000.wmac: N9 Firmware Version: _reserved_, Build Time: 20190801210351
root@bpi-r64:~# 

mt7615 card is inserted in the pci-slot near the power-jack, i have not done any hw-modifications (resistor-/capacitor changes)

IF I type in “dmesg … grep -iB5 wlan0” i´ve got the following message:[45062.860650] mt7622-wmac 18000000.wmac: Load eeprom OK, count 1024 byte [45062.870156] ieee80211 phy0: Selected rate control algorithm ‘minstrel_ht’ [45062.912826] mt7622-wmac 18000000.wmac: HW/SW Version: 0x8a108a10, Build Time: 20190801210006a

[45062.967529] mt7622-wmac 18000000.wmac: N9 Firmware Version: reserved, Build Time: 20190801210351 [45072.010072] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

So, what kind of WLAN did I have now? And how can I setup the IP - Adress over which directory?

you see that wlan0 is from mt7622-wmac so the soc-internal wifi, not the pci one.

basicly you can set ip-address this way

ip addr add 192.168.1.1/24 dev wlan0
ip link set wlan0 up

but to have a connection you need to connect to a wifi-network like your router (wpa-supplicant), or create an own accesspoint using hostap

at least for hostap i have examples in my wiki, it is same for r2 and r64, so maybe i have them only in the r2 section

btw. booted the 5.15.0, which should be same as the one you have in the image…and my card is still recognized

root@bpi-r64:~# uname -a
Linux bpi-r64 5.15.0-bpi-r64-main #1 SMP PREEMPT Sat Nov 27 14:56:12 CET 2021 aarch64 GNU/Linux
root@bpi-r64:~# dmesg | grep -i 'pci\|mt76'
[    0.000000] Kernel command line: board=bpi-r64 console=ttyS0,115200n1 earlyprintk root=/dev/mmcblk1p5 rootfstype=ext4 rootwait service=linux debug=7 initcall_debug=0 androidboot.hardware=mt7622 swiotlb=512
[    0.064345] PCI: CLS 0 bytes, default 64
[    1.321756] rtc_mt7622 10212800.rtc: registered as rtc0
[    1.327063] rtc_mt7622 10212800.rtc: setting system clock to 2022-05-17T11:17:40 UTC (1652786260)
[    1.586943] mtk-pcie 1a143000.pcie: host bridge /pcie@1a143000 ranges:
[    1.593612] mtk-pcie 1a143000.pcie: Parsing ranges property...
[    1.603858] mtk-pcie 1a143000.pcie:      MEM 0x0020000000..0x0027ffffff -> 0x0020000000
[    1.636316] mtk-pcie 1a143000.pcie: PCI host bridge to bus 0000:00
[    1.645712] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.645723] pci_bus 0000:00: root bus resource [mem 0x20000000-0x27ffffff]
[    1.662637] pci_bus 0000:00: scanning bus
[    1.662740] pci 0000:00:00.0: [14c3:3258] type 01 class 0x060400
[    1.670295] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x1ffffffff 64bit pref]
[    1.683081] pci_bus 0000:00: fixups for bus
[    1.693508] pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 0
[    1.710639] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.718662] pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 1
[    1.725492] pci_bus 0000:01: scanning bus
[    1.729690] pci 0000:01:00.0: [14c3:7615] type 00 class 0x000280
[    1.735886] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit]
[    1.743668] pci 0000:01:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x1 link at 0000:00:00.0 (capable of 4.000 Gb/s with 5.0 GT/s PCIe x1 link)
[    1.768287] pci_bus 0000:01: fixups for bus
[    1.772502] pci_bus 0000:01: bus scan returning with max=01
[    1.778082] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    1.784711] pci_bus 0000:00: bus scan returning with max=01
[    1.790307] pci 0000:00:00.0: BAR 0: no space for [mem size 0x200000000 64bit pref]
[    1.797974] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x200000000 64bit pref]
[    1.805985] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
[    1.812783] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
[    1.820185] pci 0000:00:00.0: PCI bridge to [bus 01]
[    1.825202] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
[    1.832490] mtk-pcie 1a145000.pcie: host bridge /pcie@1a145000 ranges:
[    1.839073] mtk-pcie 1a145000.pcie: Parsing ranges property...
[    1.844919] mtk-pcie 1a145000.pcie:      MEM 0x0028000000..0x002fffffff -> 0x0028000000
[    1.953254] mtk-pcie 1a145000.pcie: Port1 link down
[    1.958320] mtk-pcie 1a145000.pcie: PCI host bridge to bus 0001:00
[    1.964511] pci_bus 0001:00: root bus resource [bus 00-ff]
[    1.970005] pci_bus 0001:00: root bus resource [mem 0x28000000-0x2fffffff]
[    1.976887] pci_bus 0001:00: scanning bus
[    1.982068] pci_bus 0001:00: fixups for bus
[    1.986258] pci_bus 0001:00: bus scan returning with max=00
[    6.815333] mt7615e 0000:01:00.0: assign IRQ: got 146
[    6.820508] pci 0000:00:00.0: enabling device (0000 -> 0002)
[    6.839656] pci 0000:00:00.0: enabling bus mastering
[    6.851118] mt7615e 0000:01:00.0: enabling device (0000 -> 0002)
[    6.883391] mt7615e 0000:01:00.0: enabling bus mastering
[    6.912684] mtk-pcie 1a143000.pcie: msi#0 address_hi 0x0 address_lo 0x40ebd0c0
[    6.950802] mt7615e 0000:01:00.0: Load eeprom: /lib/firmware/mediatek/mt7615e_rf.bin
[    6.950881] mt7615e 0000:01:00.0: Open eeprom file failed: /lib/firmware/mediatek/mt7615e_rf.bin
[    7.079129] mt7622-wmac 18000000.wmac: Load eeprom: /lib/firmware/mediatek/mt7622-wmac_rf.bin
[    7.100361] mt7622-wmac 18000000.wmac: Load eeprom OK, count 1024 byte
[    7.256360] mt7622-wmac 18000000.wmac: N9 Firmware Version: _reserved_, Build Time: 20190801210351
[    7.384705] mt7615e 0000:01:00.0 wlp1s0: renamed from wlan0
root@bpi-r64:~#

but i see i have also a link down…i guess from the other slot:

mtk-pcie 1a145000.pcie: Port1 link down

Please excuse me, but slowly I don’t understand anything anymore & above all not why I don’t see my card; although it is available.

This is incomprehensibly slow for me. I have hostapd on my system and when I display the status I see the message “wlan0: interface state UNITIALIZED->COUNTRY_UPDATE”… Whatever, I still can not understand why I have so many problems with this board at once. ICh would be really once satisfied if the 2.4 GHz would work properly again and that also at the SYSTEM - start… How do I manage that? I have a project to design and here I’m just running out of time … Sorry, but I’m just a bit under PRESSURE, because 2 servers with me have also said goodbye & there were important applications on it (DB & GitLab) …

the soc of the board has a 2g4 wifi builtin…this is the wlan0 you see (detected as mt7622-wmac by mt7615e driver).

the card you’ve inserted into the pci-slot is not recognized…maybe it is defect, you can try another card if available

It seems terrible, if this card is defect - because it is a NEW ONE.

Any way. How can I start my 2.4 GHz after reboot automatically without given modprobe - command? And with which way I can bind the IP on WLAN0?

best regards

Matthias

Do you want an ap or client-connection?

Ap: https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:wlan#hostapd

For a connection you have to set ip address and run an dhcp-client (e.g. dnsmasq) on your wlan interface

In bullseye image i used systemd to make network setup,just look how i set ips for the wan/lan interfaces and do same for wlan0 (different subnet). Hostapd and dnsmasq can run as daemon so they are started at system boot if enabled

Output from: hostapd -dd /etc/hostapd/hostapd.conf

… wlan0: interface state UNINITIALIZED->DISABLED hostapd_bss_deinit: deinit bss wlan0 wlan0: AP-DISABLED hostapd_cleanup(hapd=0x55a46a4150 (wlan0)) wlan0: CTRL-EVENT-TERMINATING hostapd_free_hapd_data: Interface wlan0 wasn’t started …

Afaik wlan0 has to be up before starting hostapd

ip link set wlan0 up

Hello Frank, I would like to start by thanking you for the help and perseverance you have given me. But somehow the router doesn’t work the way I want it to.

The WLAN interface constantly flaps and the config doesn’t really want it either. Unfortunately, I don’t know what the reason for this is or what it could be…

Well, then I’m currently only using it as a “LAN router” without an AccessPoint… And I can’t imagine that the external WiFi card is defective either… I don’t know; I’m at a bit of a loss at the moment…

maybe check your power supply is 2A+ and runs cleanly? had no such problems