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)
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
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.
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)?
Then, to make the kernel, use; substituting your cross compiler;:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- deb-pkg
Note: if you want to build, but not start from scratch, the target bindeb-pkg does not do a clean first, whereas deb-pkg does.
maybe we can set KBUILD_PKG_ROOTCMD or DPKG_FLAGS to create source-only or using script before to generate uImage…DPKG_FLAGS seem not to be set anywhere
btw. bindeb-pkg should build only binary package (not source), see help at the end of makefile…but in my test it also creates the source-deb, but deb-pkg makes clean before and seem to create a source tarball. filename ($kernel_headers_packagename) for source-deb is set in the mkdebian script, but i have not found where it was used to create the headers-file…i guess somewhere with the debian/control file, where also the others are listed.
some of the magic (including collecting files for headers-package) seems to be in this script: scripts/package/builddeb
imho adding mkimage and patchs for dtb should be added here. there is also a section about location for image…there is no arm/arm64-part…maybe we can add one using an ENV-Variable to set target-directory
Meanwhile, I’ve tried the last commit 2e4b86dfcf329f94ac123175b3eed5231b77bbf6
for my BPI-R64 and it doesn’t work for me because DHCP/WAN=eth1 doesn’t work:
Was in 5.4-r64-main:
sa@bpi-r64:~$ ip addr
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 3e:af:11:8b:df:12 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.1/24 brd 192.168.2.255 scope global eth0
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 5e:7d:b9:2e:95:c4 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.47/24 brd 192.168.1.255 scope global dynamic eth1
valid_lft 86387sec preferred_lft 86387sec
Now:
sa@bpi-r64:~$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether f6:34:86:70:68:93 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 32:b0:c0:e3:0f:41 brd ff:ff:ff:ff:ff:ff
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/sit 0.0.0.0 brd 0.0.0.0
5: wan@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether f6:34:86:70:68:93 brd ff:ff:ff:ff:ff:ff
6: lan0@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether f6:34:86:70:68:93 brd ff:ff:ff:ff:ff:ff
7: lan1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether f6:34:86:70:68:93 brd ff:ff:ff:ff:ff:ff
8: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether f6:34:86:70:68:93 brd ff:ff:ff:ff:ff:ff
9: lan3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether f6:34:86:70:68:93 brd ff:ff:ff:ff:ff:ff
Also wlan disappered.
sa@bpi-r64:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
auto lo
iface lo inet loopback
auto eth0
#allow-hotplug eth0
iface eth0 inet static
address 192.168.2.1/24
#gateway 192.168.1.10
auto eth1
#allow-hotplug eth1
iface eth1 inet dhcp
source-directory /etc/network/interfaces.d
In 5.4-main i merged dsa driver for r64 and did not merged openwrt phy driver for r64.
You can now work with wan instead of eth1,but need to set eth0 up before…config like for r2. Have you tried working on wan?
Eth is defined in dts only for soc-side (thats why it is visible in ip a),but switchside (port5) is not defined
Just try wan/lanX instead of ethX
For internal wifi…i see a semaphore error on boot,but if i unload module and load again it works in my quick tests…have not found cause of it…[BPI-R64] mt7622 mac80211 WiFi driver