[BPI-R64] Kernel-Development

Here you are:

root@OpenWrt:/# uname -a
Linux OpenWrt 4.19.79 #0 SMP Thu Oct 24 12:11:02 2019 aarch64 GNU/Linux

root@OpenWrt:/# cat /etc/openwrt_release 
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='SNAPSHOT'
DISTRIB_REVISION='r11323-49db202'
DISTRIB_TARGET='mediatek/mt7622'
DISTRIB_ARCH='aarch64_cortex-a53'
DISTRIB_DESCRIPTION='OpenWrt SNAPSHOT r11323-49db202'
DISTRIB_TAINTS='no-all'

root@OpenWrt:/# for i in 0 1 2 3 4 5 6; do swconfig dev switch0 port $i get link; done
port:0 link:down
port:1 link:up speed:100baseT full-duplex
port:2 link:down
port:3 link:down
port:4 link:down
port:5 link:up speed:1000baseT full-duplex
port:6 link:up speed:1000baseT full-duplex

root@OpenWrt:/# ip -4 ad
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
5: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    inet 192.168.100.31/24 brd 192.168.100.255 scope global br-lan
       valid_lft forever preferred_lft forever

root@OpenWrt:/# ip -4 r
default via 192.168.100.2 dev br-lan  src 192.168.100.31 
192.168.100.0/24 dev br-lan scope link  src 192.168.100.31 

root@OpenWrt:/# ping -c 4 -s 1500 192.168.100.2
PING 192.168.100.2 (192.168.100.2): 1500 data bytes
1508 bytes from 192.168.100.2: seq=0 ttl=64 time=0.964 ms
1508 bytes from 192.168.100.2: seq=1 ttl=64 time=0.915 ms
1508 bytes from 192.168.100.2: seq=2 ttl=64 time=0.956 ms
1508 bytes from 192.168.100.2: seq=3 ttl=64 time=0.744 ms

--- 192.168.100.2 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss

root@OpenWrt:/# iperf3 -c 192.168.100.2 -i 0
Connecting to host 192.168.100.2, port 5201
[  5] local 192.168.100.31 port 44264 connected to 192.168.100.2 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-10.00  sec   113 MBytes  95.0 Mbits/sec    0    380 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   113 MBytes  95.0 Mbits/sec    0             sender
[  5]   0.00-10.00  sec   112 MBytes  94.3 Mbits/sec                  receiver

iperf Done.

root@OpenWrt:/# iperf3 -c 192.168.100.2 -i 0 -R
Connecting to host 192.168.100.2, port 5201
Reverse mode, remote host 192.168.100.2 is sending
[  5] local 192.168.100.31 port 44268 connected to 192.168.100.2 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-10.00  sec   112 MBytes  94.2 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   112 MBytes  94.3 Mbits/sec  1103             sender
[  5]   0.00-10.00  sec   112 MBytes  94.2 Mbits/sec                  receiver

iperf Done.

More interesting is bootlog with messages from my patch above in 4.19. I guess problem with sgmii-setup is similar…throughput is terrible…only 100mbit/s or have you only 100mbit-client for iperf?

I see that port 6 is also only 1000mbit, sgmii should be 2.5gbit/s,but maybe only reporting is wrong…or dts…afair it was defined as sgmii with speed 1000 in openwrt

root@bpi-r64:~# ethtool eth0                                                                                                          
Settings for eth0:                                                                                                                    
        Supported ports: [ MII ]                                                                                                      
        Supported link modes:   2500baseX/Full                                                                                        
        Supported pause frame use: Symmetric Receive-only                                                                             
        Supports auto-negotiation: No                                                                                                 
        Supported FEC modes: Not reported                                                                                             
        Advertised link modes:  2500baseX/Full                                                                                        
        Advertised pause frame use: Symmetric Receive-only                                                                            
        Advertised auto-negotiation: No                                                                                               
        Advertised FEC modes: Not reported                                                                                            
        Speed: 2500Mb/s                                                                                                               
        Duplex: Full                                                                                                                  
        Port: MII                                                                                                                     
        PHYAD: 0                                                                                                                      
        Transceiver: internal                                                                                                         
        Auto-negotiation: on                                                                                                          
        Current message level: 0x000000ff (255)                                                                                       
                               drv probe link timer ifdown ifup rx_err tx_err                                                         
        Link detected: yes

btw. my iperf3 over lan-port (sgmii-lane) looks like this:

root@bpi-r64:~# ip a                                                                                                                  
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000                                           
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00                                                                             
    inet 127.0.0.1/8 scope host lo                                                                                                    
       valid_lft forever preferred_lft forever                                                                                        
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000                                 
    link/ether 2e:c2:ec:3b:f4:8e brd ff:ff:ff:ff:ff:ff                                                                                
    inet 192.168.0.19/24 brd 192.168.0.255 scope global eth0                                                                          
       valid_lft forever preferred_lft forever                                                                                        
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000                                                 
    link/ether aa:6c:e2:0a:1d:2c brd ff:ff:ff:ff:ff:ff
root@bpi-r64:~# iperf3 -c 192.168.0.21 -R -i 0                                                                                        
Connecting to host 192.168.0.21, port 5201                                                                                            
Reverse mode, remote host 192.168.0.21 is sending                                                                                     
[  5] local 192.168.0.19 port 56164 connected to 192.168.0.21 port 5201                                                               
[ ID] Interval           Transfer     Bitrate                                                                                         
[  5]   0.00-10.00  sec  1.10 GBytes   941 Mbits/sec                                                                                  
- - - - - - - - - - - - - - - - - - - - - - - - -                                                                                     
[ ID] Interval           Transfer     Bitrate         Retr                                                                            
[  5]   0.00-10.00  sec  1.10 GBytes   944 Mbits/sec    0             sender                                                          
[  5]   0.00-10.00  sec  1.10 GBytes   941 Mbits/sec                  receiver                                                        
                                                                                                                                      
iperf Done.                                                                                                                           
root@bpi-r64:~# iperf3 -c 192.168.0.21 -i 0                                                                                           
Connecting to host 192.168.0.21, port 5201                                                                                            
[  5] local 192.168.0.19 port 56168 connected to 192.168.0.21 port 5201                                                               
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd                                                                      
[  5]   0.00-10.00  sec  1.10 GBytes   943 Mbits/sec    0    680 KBytes                                                               
- - - - - - - - - - - - - - - - - - - - - - - - -                                                                                     
[ ID] Interval           Transfer     Bitrate         Retr                                                                            
[  5]   0.00-10.00  sec  1.10 GBytes   943 Mbits/sec    0             sender                                                          
[  5]   0.00-10.00  sec  1.10 GBytes   942 Mbits/sec                  receiver                                                        
                                                                                                                                      
iperf Done.                                                                                                                           
root@bpi-r64:~#

Applied patch and switched to 1G. eth1 (Port 0) - List 1, eth0 (Port 1) - List 2, logread - List 3

List 1:

root@OpenWrt:/# ip -4 ad
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
    inet 192.168.100.29/24 brd 192.168.100.255 scope global eth1
       valid_lft forever preferred_lft forever

oot@OpenWrt:/# for i in 0 1 2 3 4 5 6; do swconfig dev switch0 port $i get link; done
port:0 link:up speed:1000baseT full-duplex 
port:1 link:down
port:2 link:down
port:3 link:down
port:4 link:down
port:5 link:up speed:1000baseT full-duplex 
port:6 link:up speed:1000baseT full-duplex 

root@OpenWrt:/# iperf3 -c 192.168.100.2 -i 0
Connecting to host 192.168.100.2, port 5201
[  5] local 192.168.100.29 port 46204 connected to 192.168.100.2 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-10.00  sec  1.09 GBytes   939 Mbits/sec  1645    170 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.09 GBytes   939 Mbits/sec  1645             sender
[  5]   0.00-10.00  sec  1.09 GBytes   938 Mbits/sec                  receiver

iperf Done.
root@OpenWrt:/# iperf3 -c 192.168.100.2 -i 0 -R
Connecting to host 192.168.100.2, port 5201
Reverse mode, remote host 192.168.100.2 is sending
[  5] local 192.168.100.29 port 46208 connected to 192.168.100.2 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-10.00  sec  1.09 GBytes   937 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.09 GBytes   938 Mbits/sec    0             sender
[  5]   0.00-10.00  sec  1.09 GBytes   937 Mbits/sec                  receiver

iperf Done.

List 2

root@OpenWrt:/# ip -4 ad
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
    inet 192.168.100.16/24 brd 192.168.100.255 scope global eth0
       valid_lft forever preferred_lft forever

root@OpenWrt:/# for i in 0 1 2 3 4 5 6; do swconfig dev switch0 port $i get link; done
port:0 link:down
port:1 link:up speed:1000baseT full-duplex 
port:2 link:down
port:3 link:down
port:4 link:down
port:5 link:up speed:1000baseT full-duplex 
port:6 link:up speed:1000baseT full-duplex 

root@OpenWrt:/# iperf3 -c 192.168.100.2 -i 0
Connecting to host 192.168.100.2, port 5201
[  5] local 192.168.100.16 port 56866 connected to 192.168.100.2 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-10.00  sec  1.09 GBytes   938 Mbits/sec  1596    175 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.09 GBytes   938 Mbits/sec  1596             sender
[  5]   0.00-10.00  sec  1.09 GBytes   937 Mbits/sec                  receiver

iperf Done.
root@OpenWrt:/# iperf3 -c 192.168.100.2 -i 0 -R
Connecting to host 192.168.100.2, port 5201
Reverse mode, remote host 192.168.100.2 is sending
[  5] local 192.168.100.16 port 56870 connected to 192.168.100.2 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-10.00  sec  1.09 GBytes   938 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.09 GBytes   938 Mbits/sec    0             sender
[  5]   0.00-10.00  sec  1.09 GBytes   938 Mbits/sec                  receiver

iperf Done.

List 3

root@OpenWrt:/# logread | grep mt753x
Fri Oct 25 11:12:17 2019 kern.info kernel: [    1.886872] mt753x gsw@0: LAN/WAN VLAN setting=wllll
Fri Oct 25 11:12:17 2019 kern.info kernel: [    1.892465] mt753x gsw@0: Switch is MediaTek MT7531BE rev 0
Fri Oct 25 11:12:17 2019 kern.info kernel: [    1.905195] mt753x gsw@0: mt7531_core_pll_setup:475 hwstrap: 0xff
Fri Oct 25 11:12:17 2019 kern.info kernel: [    1.915445] mt753x gsw@0: mt7531_mac_port_setup:461 PMCR(5):0xf805633b
Fri Oct 25 11:12:17 2019 kern.info kernel: [    1.923568] mt753x gsw@0: mt7531_set_port_sgmii_force_mode:292 0x800140
Fri Oct 25 11:12:17 2019 kern.info kernel: [    1.930550] mt753x gsw@0: mt7531_set_port_sgmii_force_mode:299 0xc00 TX:800 RX:400
Fri Oct 25 11:12:17 2019 kern.info kernel: [    1.938518] mt753x gsw@0: mt7531_set_port_sgmii_force_mode:292 0x40140
Fri Oct 25 11:12:17 2019 kern.info kernel: [    1.945246] mt753x gsw@0: mt7531_mac_port_setup:450 set-port-sgmii retval: 0
Fri Oct 25 11:12:17 2019 kern.info kernel: [    1.952675] mt753x gsw@0: mt7531_mac_port_setup:461 PMCR(6):0xf805633b
Fri Oct 25 11:12:17 2019 kern.info kernel: [    4.485446] mt753x gsw@0: mt7531_phy_pll_setup:687 hwstrap: 0xff
Fri Oct 25 11:12:17 2019 kern.info kernel: [    4.647272] mt753x gsw@0: >>>>>>>>>>>>>>>>>>>>>>>>>>>>> START CALIBRATION:
Fri Oct 25 11:12:17 2019 kern.info kernel: [    4.656365] mt753x gsw@0: -------- gephy-calbration (port:0) --------
Fri Oct 25 11:12:17 2019 kern.info kernel: [    6.997120] mt753x gsw@0: -------- gephy-calbration (port:1) --------
Fri Oct 25 11:12:17 2019 kern.info kernel: [    8.944477] mt753x gsw@0: -------- gephy-calbration (port:2) --------
Fri Oct 25 11:12:17 2019 kern.info kernel: [   10.951504] mt753x gsw@0: -------- gephy-calbration (port:3) --------
Fri Oct 25 11:12:17 2019 kern.info kernel: [   12.925308] mt753x gsw@0: -------- gephy-calbration (port:4) --------
Fri Oct 25 11:12:17 2019 kern.info kernel: [   15.083048] mt753x gsw@0: Port 0 Link is Up - 1Gbps/Full
Fri Oct 25 11:19:48 2019 kern.info kernel: [  472.743791] mt753x gsw@0: Port 0 Link is Down
Fri Oct 25 11:19:51 2019 kern.info kernel: [  476.167711] mt753x gsw@0: Port 1 Link is Up - 1Gbps/Full
1 Like

Thanks,

that means first try also go in error (maybe because soc-side was not ready),but then sgmii-link is ok

tried to getting bluetooth to work (in 5.4-r64-rc) like i’ve done here, but no success yet:

root@bpi-r64:~# cat /sys/firmware/devicetree/base/serial@1100c000/bluetooth/status
okayroot@bpi-r64:~# ls /lib/firmware/mediatek/
mt7622pr2h.bin
root@bpi-r64:~#

root@bpi-r64:~# dmesg | grep -i hci
[    0.118222] Bluetooth: HCI device and connection manager initialized
[    0.118233] Bluetooth: HCI socket layer initialized
[    3.960775] xhci-mtk 1a0c0000.usb: xHCI Host Controller
[    3.966023] xhci-mtk 1a0c0000.usb: new USB bus registered, assigned bus number 1
[    3.975053] xhci-mtk 1a0c0000.usb: hcc params 0x01403198 hci version 0x96 quirks 0x0000000000210010
[    3.984136] xhci-mtk 1a0c0000.usb: irq 129, io mem 0x1a0c0000
[    3.998676] xhci-mtk 1a0c0000.usb: xHCI Host Controller
[    4.003914] xhci-mtk 1a0c0000.usb: new USB bus registered, assigned bus number 2
[    4.011319] xhci-mtk 1a0c0000.usb: Host supports USB 3.0 SuperSpeed
root@bpi-r64:~# dmesg | grep -i bluetooth
[    0.118192] Bluetooth: Core ver 2.22
[    0.118222] Bluetooth: HCI device and connection manager initialized
[    0.118233] Bluetooth: HCI socket layer initialized
[    0.118241] Bluetooth: L2CAP socket layer initialized
[    0.118256] Bluetooth: SCO socket layer initialized
[    1.338827] Bluetooth: RFCOMM TTY layer initialized
[    1.343745] Bluetooth: RFCOMM socket layer initialized
[    1.349031] Bluetooth: RFCOMM ver 1.11
[    1.352927] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    1.358390] Bluetooth: BNEP filters: protocol multicast
[    1.363770] Bluetooth: BNEP socket layer initialized
[    1.368766] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    1.374721] Bluetooth: HIDP socket layer initialized
root@bpi-r64:~#

root@bpi-r64:~# bluetoothctl
Agent registered
[bluetooth]# power on
No default controller available
[bluetooth]# 

seems like the driver is named CONFIG_BT_MTKUART, after changing that to y (from m) i see more info (loading over tftp, so before no module available):

[    1.264907] bluetooth hci0: Direct firmware load for mediatek/mt7622pr2h.bin failed with error -2
[    1.273827] Bluetooth: hci0: Failed to load firmware file (-2)

i still have the firmware-file in same place

root@bpi-r64:~# ls -l /lib/firmware/mediatek/mt7622pr2h.bin
-rw-r--r-- 1 root root 78158 Oct 21 13:25 /lib/firmware/mediatek/mt7622pr2h.bin
root@bpi-r64:~#

Imho error -2 is “no such file” (ref)

i guess driver (when builtin) tries to load firmware before rootfs is mounted (here i have 1s boottime,in the other linked thread it is 14 sec and loaded as module)…

now i have this again:

[   21.218564] Bluetooth: hci0: Execution of wmt command timed out
[   21.224502] Bluetooth: hci0: Failed to query firmware status (-110)

also after doing some hciconfig hci0 down/up…had also applied the msleep-patch (mtk-scpsys.c)

https://github.com/frank-w/BPI-R2-4.14/commits/5.4-r64-rc

@linkerosa @moore @ryder.lee any idea here?

While working on wifi, i replaced firmware file,now bluetooth seems to work…

Got also wifi working:

All in my 5.4-r64-rc branch which will be soon renamed to main (maybe squashing build.sh commits)

If anyone wants to test…remember copying firmware-files to /lib/firmware/mediatek

kernel 5.4 is now finally released so i have updated my repo and added 5.4-r64-main and uploaded binary-kernels on my gdrive

https://drive.google.com/drive/folders/1SRUhYQqs5Jg_lKqgMfUlwSX4dG5T6qPZ

1 Like

good news, on Patchwork/Mailinglist there was a DSA-driver for mt7531 released…i added it to this branch and made a quick test:

details
root@bpi-r64:~# uname -a                                                                                                                       
Linux bpi-r64 5.5.0-rc1-bpi-r64-netnext #9 SMP PREEMPT Tue Dec 10 11:59:07 CET 2019 aarch64 GNU/Linux                                          
root@bpi-r64:~# ip a                                                                                                                           
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000                                                    
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00                                                                                      
    inet 127.0.0.1/8 scope host lo                                                                                                             
       valid_lft forever preferred_lft forever                                                                                                 
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000                                          
    link/ether 12:9b:2c:56:cd:f0 brd ff:ff:ff:ff:ff:ff                                                                                         
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000                                                          
    link/ether b6:2e:63:86:9e:98 brd ff:ff:ff:ff:ff:ff                                                                                         
4: wan@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000                                                      
    link/ether 12:9b:2c:56:cd:f0 brd ff:ff:ff:ff:ff:ff                                                                                         
5: lan0@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000                                        
    link/ether 12:9b:2c:56:cd:f0 brd ff:ff:ff:ff:ff:ff                                                                                         
    inet 192.168.0.19/24 scope global lan0                                                                                                     
       valid_lft forever preferred_lft forever                                                                                                 
6: lan1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000                                                     
    link/ether 12:9b:2c:56:cd:f0 brd ff:ff:ff:ff:ff:ff                                                                                         
7: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000                                                     
    link/ether 12:9b:2c:56:cd:f0 brd ff:ff:ff:ff:ff:ff                                                                                         
8: lan3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000                                                     
    link/ether 12:9b:2c:56:cd:f0 brd ff:ff:ff:ff:ff:ff                                                                                         
root@bpi-r64:~# ping -c4 192.168.0.10                                                                                                          
PING 192.168.0.10 (192.168.0.10) 56(84) bytes of data.                                                                                         
64 bytes from 192.168.0.10: icmp_seq=1 ttl=64 time=0.498 ms                                                                                    
64 bytes from 192.168.0.10: icmp_seq=2 ttl=64 time=0.371 ms                                                                                    
64 bytes from 192.168.0.10: icmp_seq=3 ttl=64 time=0.487 ms                                                                                    
64 bytes from 192.168.0.10: icmp_seq=4 ttl=64 time=0.458 ms                                                                                    
                                                                                                                                               
--- 192.168.0.10 ping statistics ---                                                                                                           
4 packets transmitted, 4 received, 0% packet loss, time 81ms                                                                                   
rtt min/avg/max/mdev = 0.371/0.453/0.498/0.054 ms                                                                                              
root@bpi-r64:~# 
root@bpi-r64:~# iperf3 -c 192.168.0.21                                                                                                         
Connecting to host 192.168.0.21, port 5201                                                                                                     
[  5] local 192.168.0.19 port 56412 connected to 192.168.0.21 port 5201                                                                        
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd                                                                               
[  5]   0.00-1.00   sec   114 MBytes   957 Mbits/sec    0   1003 KBytes                                                                        
[  5]   1.00-2.00   sec   113 MBytes   944 Mbits/sec    0   1.08 MBytes                                                                        
[  5]   2.00-3.00   sec   112 MBytes   941 Mbits/sec    0   1.08 MBytes                                                                        
[  5]   3.00-4.00   sec   112 MBytes   941 Mbits/sec    0   1.08 MBytes                                                                        
[  5]   4.00-5.00   sec   112 MBytes   942 Mbits/sec    0   1.08 MBytes                                                                        
[  5]   5.00-6.00   sec   112 MBytes   944 Mbits/sec    0   1.21 MBytes                                                                        
[  5]   6.00-7.00   sec   112 MBytes   944 Mbits/sec    0   1.27 MBytes                                                                        
[  5]   7.00-8.00   sec   112 MBytes   943 Mbits/sec    0   1.27 MBytes                                                                        
[  5]   8.00-9.00   sec   111 MBytes   934 Mbits/sec    0   1.27 MBytes                                                                        
[  5]   9.00-10.00  sec   112 MBytes   944 Mbits/sec    0   1.27 MBytes                                                                        
- - - - - - - - - - - - - - - - - - - - - - - - -                                                                                              
[ ID] Interval           Transfer     Bitrate         Retr                                                                                     
[  5]   0.00-10.00  sec  1.10 GBytes   943 Mbits/sec    0             sender                                                                   
[  5]   0.00-10.00  sec  1.10 GBytes   941 Mbits/sec                  receiver                                                                 
                                                                                                                                               
iperf Done.                                                                                                                                    
root@bpi-r64:~# iperf3 -c 192.168.0.21 -R                                                                                                      
Connecting to host 192.168.0.21, port 5201                                                                                                     
Reverse mode, remote host 192.168.0.21 is sending                                                                                              
[  5] local 192.168.0.19 port 56416 connected to 192.168.0.21 port 5201                                                                        
[ ID] Interval           Transfer     Bitrate                                                                                                  
[  5]   0.00-1.00   sec   112 MBytes   941 Mbits/sec                                                                                           
[  5]   1.00-2.00   sec   111 MBytes   932 Mbits/sec                                                                                           
[  5]   2.00-3.00   sec   112 MBytes   941 Mbits/sec                                                                                           
[  5]   3.00-4.00   sec   112 MBytes   938 Mbits/sec                                                                                           
[  5]   4.00-5.00   sec   112 MBytes   941 Mbits/sec                                                                                           
[  5]   5.00-6.00   sec   112 MBytes   941 Mbits/sec                                                                                           
[  5]   6.00-7.00   sec   112 MBytes   938 Mbits/sec                                                                                           
[  5]   7.00-8.00   sec   112 MBytes   941 Mbits/sec                                                                                           
[  5]   8.00-9.00   sec   112 MBytes   937 Mbits/sec                                                                                           
[  5]   9.00-10.00  sec   112 MBytes   941 Mbits/sec                                                                                           
- - - - - - - - - - - - - - - - - - - - - - - - -                                                                                              
[ ID] Interval           Transfer     Bitrate         Retr                                                                                     
[  5]   0.00-10.00  sec  1.10 GBytes   942 Mbits/sec  617             sender                                                                   
[  5]   0.00-10.00  sec  1.09 GBytes   939 Mbits/sec                  receiver                                                                 
                                                                                                                                               
iperf Done.                                                                                                                                    
root@bpi-r64:~#

have managed to backport to 5.4:

i added the timeout-loop (waiting for MT7531_SGMII_LINK_STATUS) from the other mt7531-phy-driver, but the driver seem to have same SGMII-timeout if loaded from local storage…

this loop seems to break functionality if sgmii is not initialized before (uboot tftp). I have reverted it and it works again. Retransmitts were caused by my local switch config (flowcontrol is disabled by default…after set to autonegotiate/on on both ports no retransmitts happen)

1 Like

Hi Frank,

I tested your image with kernel 5.4+buster and wanted to get internet via Wifi (client mode!) for BPI-R64, but failed.

Is it possible to fix that?

I dont have /dev/rfkill, by the way, maybe that is the root cause. The same command at my computer x86 works (I get connection via Wifi).

root@bpi-r64:~# wpa_supplicant -i wlan0 -c <(wpa_passphrase catbo passphrase)
Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device
wlan0: SME: Trying to authenticate with cc:2d:21:14:60:81 (SSID='catbo' freq=2437 MHz)
nl80211: Failed to open /proc/sys/net/ipv6/conf/wlan0/drop_unicast_in_l2_multicast: No such file or directory
nl80211: Failed to set IPv6 unicast in multicast filter
wlan0: SME: Trying to authenticate with cc:2d:21:14:60:81 (SSID='catbo' freq=2437 MHz)
nl80211: Failed to open /proc/sys/net/ipv6/conf/wlan0/drop_unicast_in_l2_multicast: No such file or directory
nl80211: Failed to set IPv6 unicast in multicast filter
wlan0: SME: Trying to authenticate with cc:2d:21:14:60:81 (SSID='catbo' freq=2437 MHz)
nl80211: Failed to open /proc/sys/net/ipv6/conf/wlan0/drop_unicast_in_l2_multicast: No such file or directory
nl80211: Failed to set IPv6 unicast in multicast filter
wlan0: SME: Trying to authenticate with cc:2d:21:14:60:81 (SSID='catbo' freq=2437 MHz)
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="catbo" auth_failures=1 duration=10 reason=CONN_FAILED
nl80211: Failed to open /proc/sys/net/ipv6/conf/wlan0/drop_unicast_in_l2_multicast: No such file or directory
nl80211: Failed to set IPv6 unicast in multicast filter
^Cnl80211: Failed to open /proc/sys/net/ipv6/conf/wlan0/drop_unicast_in_l2_multicast: No such file or directory
nl80211: Failed to set IPv6 unicast in multicast filter
nl80211: Failed to open /proc/sys/net/ipv6/conf/wlan0/drop_unicast_in_l2_multicast: No such file or directory
nl80211: Failed to set IPv6 unicast in multicast filter
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
wlan0: CTRL-EVENT-TERMINATING 
root@bpi-r64:~#

dmesg at the same time:

[104448.297511] wlan0: authenticate with cc:2d:21:14:60:81                                                                                                                                         
[104448.349616] wlan0: send auth to cc:2d:21:14:60:81 (try 1/3)                                                                                                                                                    
[104448.361821] wlan0: send auth to cc:2d:21:14:60:81 (try 2/3)                                                                                                                                                    
[104448.373934] wlan0: send auth to cc:2d:21:14:60:81 (try 3/3)                                                                                                                                                    
[104448.386182] wlan0: authentication with cc:2d:21:14:60:81 timed out                                                                                                                                             
[104452.541424] wlan0: authenticate with cc:2d:21:14:60:81                                                                                                                                                         
[104452.593539] wlan0: send auth to cc:2d:21:14:60:81 (try 1/3)                                                                                                                                                    
[104452.605874] wlan0: send auth to cc:2d:21:14:60:81 (try 2/3)                                                                                                                                                    
[104452.617989] wlan0: send auth to cc:2d:21:14:60:81 (try 3/3)                                                                                                                                                    
[104452.630210] wlan0: authentication with cc:2d:21:14:60:81 timed out                                                                                                                                             
[104457.185530] wlan0: authenticate with cc:2d:21:14:60:81                                                                                                                                                         
[104457.237700] wlan0: send auth to cc:2d:21:14:60:81 (try 1/3)                                                                                                                                                    
[104457.249998] wlan0: send auth to cc:2d:21:14:60:81 (try 2/3)                                                                                                                                                    
[104457.262245] wlan0: send auth to cc:2d:21:14:60:81 (try 3/3)                                                                                                                                                    
[104457.274466] wlan0: authentication with cc:2d:21:14:60:81 timed out                                                                                                                                             
[104462.333487] wlan0: authenticate with cc:2d:21:14:60:81                                                                                                                                                         
[104462.385575] wlan0: send auth to cc:2d:21:14:60:81 (try 1/3)                                                                                                                                                    
[104462.397729] wlan0: send auth to cc:2d:21:14:60:81 (try 2/3)                                                                                                                                                    
[104462.410166] wlan0: send auth to cc:2d:21:14:60:81 (try 3/3)                                                                                                                                                    
[104462.422325] wlan0: authentication with cc:2d:21:14:60:81 timed out                                                                                                                                             

I have not tested client-mode.maybe it is not implemented. You should ask in mt7622 wifi thread

Have you tried searching in menuconfig of kernel for rfkill? Imho there is such option…maybe it’s required for client mode

Meanwhile I use your image with Debian. A little bit later I try to rebuild the thing

@Ilya_Murav_jov have added rfkill to 5.4-main…clientmode works in my quick test

@jasmin have you an idea hoe to define pwm-gpio’s? [BPI-R64] Kernel-Development or maybe how to get poweroff working?

Thanks, I’ll try.

Finally I managed to build and test 5.4-main branch, and with dkms built wireguard too.

sa@bpi-r64:~$ sudo ip link add dev wg0 type wireguard
sa@bpi-r64:~$ sudo wg
interface: wg0

Client tools I got from Debian testing, but wireguard.ko requires building. For convenience I used fpm to build linux-headers deb, and after recompling fixdep/modpost I got success, but it is long and errorprone.

After all I found another way to build:

ARCH=arm64 CROSS_COMPILE='ccache aarch64-linux-gnu-' make bindeb-pkg

and got almost at once

$ ls -1 *.deb
linux-headers-5.4.0-bpi-r64+_5.4.0-bpi-r64+-4_arm64.deb
linux-image-5.4.0-bpi-r64+_5.4.0-bpi-r64+-4_arm64.deb
linux-libc-dev_5.4.0-bpi-r64+-4_arm64.deb

At least linux-headers (the main target as it is needed for dkms) is usable. I think, after tweaking, it would be nice to put linux-headers.deb along other artifacts to https://github.com/frank-w/BPI-R2-4.14/releases with CI.

How did you create linux-headers deb from linux source of my repo? Imho version is wrong (should be 5.4.12+).

As I said it was not an easy way:

git checkout 5.4-r64-main
bash build.sh importconfig
bash build.sh build
bash build.sh cryptodev
bash build.sh pack

fpm -v 5.4.0-bpi-r64-r64-main -f --prefix=/ -a arm64 -p ../SD -s dir -t deb --name linux-headers-5.4.0-bpi-r64-r64-main --description "Header files related to Linux kernel version 5.4.0-bpi-r64-r64-main" \
              \
./.config=/usr/src/linux-headers-5.4.0-bpi-r64-r64-main/.config \
./.missing-syscalls.d=/usr/src/linux-headers-5.4.0-bpi-r64-r64-main/.missing-syscalls.d \
./Kbuild=/usr/src/linux-headers-5.4.0-bpi-r64-r64-main/Kbuild \
./Kconfig=/usr/src/linux-headers-5.4.0-bpi-r64-r64-main/Kconfig \
./Makefile=/usr/src/linux-headers-5.4.0-bpi-r64-r64-main/Makefile \
./Module.symvers=/usr/src/linux-headers-5.4.0-bpi-r64-r64-main/Module.symvers \
 \
./include=/usr/src/linux-headers-5.4.0-bpi-r64-r64-main/ \
./arch/arm64/include=/usr/src/linux-headers-5.4.0-bpi-r64-r64-main/arch/arm64/ \
./arch/arm64/Makefile=/usr/src/linux-headers-5.4.0-bpi-r64-r64-main/arch/arm64/ \
./arch/arm64/kernel/module.lds=/usr/src/linux-headers-5.4.0-bpi-r64-r64-main/arch/arm64/kernel/ \
./scripts=/usr/src/linux-headers-5.4.0-bpi-r64-r64-main/ \

dpkg-deb -I ../SD/linux-headers-5.4.0-bpi-r64-r64-main_5.4.0-bpi-r64-r64-main_arm64.deb 
 new Debian package, version 2.0.
 size 8308784 bytes: control archive=158906 bytes.

Is your current source located at /usr/src/linux-headers-5.4.0-bpi-r64-r64-main?

I thinking about adding it to build.sh (deb function). But it needs to be universal (kernelversion,source directory).

Yep:

sa@bpi-r64:~$ ls -lah /lib/modules/`uname -r`/build                                                                                                                                                                
lrwxrwxrwx 1 root root 45 Jan 27 23:33 /lib/modules/5.4.0-bpi-r64-r64-main/build -> /usr/src/linux-headers-5.4.0-bpi-r64-r64-main                                                                                  

I would recommend to make use of

$ grep -RE module.lds scripts
scripts/package/builddeb:(cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> "$objtree/debian/hdrsrcfiles"

to build linux-headers etc. make bindeb-pkg is officially documented and use it.

I mean if it is source or target for deb creation…

afair buildeb does not work for crosscompile (binary package). can you give example for adding it to build.sh (function deb already contains versionstring)?

After some poking I got compatible linux-headers, I think:

$ bash build.sh build
...
$ cat include/config/kernel.release
5.4.0-bpi-r64-r64-main

$ LOCALVERSION=-r64-main ./scripts/setlocalversion .
-bpi-r64-r64-main

$ LOCALVERSION=-r64-main ARCH=arm64 CROSS_COMPILE='ccache aarch64-linux-gnu-' make bindeb-pkg

$ ls -lah ../*.deb
-rw-r--r-- 1 ilya ilya  11M фев  2 12:50 ../linux-headers-5.4.0-bpi-r64-r64-main_5.4.0-bpi-r64-r64-main-11_arm64.deb
-rw-r--r-- 1 ilya ilya 4,5M фев  2 12:50 ../linux-image-5.4.0-bpi-r64-r64-main_5.4.0-bpi-r64-r64-main-11_arm64.deb
-rw-r--r-- 1 ilya ilya 1,0M фев  2 12:50 ../linux-libc-dev_5.4.0-bpi-r64-r64-main-11_arm64.deb