[BPI-R64] Kernel-Development

dts & ethernet driver are not all correct in 5.2 tree. maybe you can start your test after v5.3 to save your time, thanks.

your dts-part is same as mine (found no difference)…

we are trying to get phylink working for mt7622…so we cannot wait till merge-window is closed…else the changes will firstly get into 5.4 which will be no LTS

i expect that you mean this Patches from net-next:

edit: With 5.2 + net-next (which go into 5.3) and phylink-patches we got network working (retransmits on tx fixed by activating flowcontrol,rx clean)

phylink for bpi-r64 based on 5.3-rc1 (working so far):

have now also 5.4 for r64 in my repo

rtl8367 works so far, have now added mt7531-driver, but can’t test

compiled kernels here on my gdrive: https://drive.google.com/open?id=1SRUhYQqs5Jg_lKqgMfUlwSX4dG5T6qPZ

is there anyone having a new r64-board who can test the kernel with mt7531-driver (and maybe my uboot).

have now 4.19 and 5.4-rc1 with working network-driver (rtl8367s + mt7531) in my repo…for mt7531 i fixed the dts…

mhm, seems like a have a configuration issue on r64 with mt7531…all ports are connected to both gmac…

fixed this, but it seems that kernel via tftp works but not if loaded from sdcard

if i boot 5.4 from sd-card, sgmii (gmac0 for lanports) does not come up, if i boot same kernel/dtb from tftp ist works. i guess it’s problem in other subsystem e.g. clock-framework (uboot activates clock for switch when do tftp, but not for sdcard-boot)

as far as i know here happens timeout:

if booted from tftp the val is set and then break and then return 0 is executed…

hwstrap and pmcr are same between tftp and sd

after adding some usleep in the steps before, it seems to work, but still wrong values inside the loop checking for sgmii-status

i compared driver from openwrt (i’m using atm) with the one from bpi-r64-bsp-4.19…they seem to be the same

then i tried further debugging based on technical document for mt7531: https://drive.google.com/file/d/1aVdQz3rbKWjkvdga8-LQ-VFXjmHR8yf9/view page 714

if loading from tftp i get 0x40140 in the PCS_CONTROL_1 register, on sd 0x800140, that means that for sd SGMII_PCS_FAULT bit is set. i tried to make a reset by setting SGMI_ISOLATE there, but nothing happens except this bit is set :frowning:

then i read out PCS_STATUS_2 to get more info and i get 0xc00 => txfifo_full + rx_fifo_empty

@moore / @Ryder.Lee can you guide me to fix this? maybe this is caused by phylink changes, but i still don’t know why it works on tftp load but not on sd-card. it look like there is any initialization missing that is done by uboot when setup switch, but i see a switch-reset in drivers probe

uploaded here my current work:

@frank-w did you check the module order that is loaded when booting from sd and from tftp. Just thworing this our, but maybe it is just the order of modules that somehow rely on each other that get screwed up?

As modules (mt753x is builtin) and rootfs only exist on sdcard only kernel itself is loaded differently. I guess it’s because switch/gmac is previously initialized by uboot if using tftp. Driver itself makes a full reset of the switch in probe. But maybe clock is calibrated/stabilized more than booting from sd

I see, but not sure how the clock would be less stable/calibrated just by loading from sd. What are actually the values before? Did you try to pre-initialize them to have a clean starting point?

I mean did you try to read the register before the reset occurs on /* Step 5: AN re-start */ occurs? Maybe the initial value there has an influcene on the outcome?

btw. this method makes me wonder if someone else stumbled once about a similar issue:

static int mt7531_internal_phy_calibration(struct gsw_mt753x *gsw)
{
	return 0;
}

If i load via tftp,uboot need to initialize gmac and switch including its clocks. If loading from sd-card this step is not done and have to be done by linux-kernel first. Some clocks need some time to get stable (to be “warm” enough). Thats why i think this can be the cause…

I don’t know how to access the clock-values. Values in sgmii_force_mode function are same with tftp and sd…only inside the loop i get link-bit on tftp and fault-bit on tftp

So maybe i can reset the sgmii-link anyhow without dropping the settings or just clear the errors to let it initialize finally…

You had looked in wrong function…we use force here no autoneg

Ok, I assumed to give the clocks swing in is the reason for the while loop with the timeout. But as far as I understood you even if you add a delay (sleep) infront of it, it will eventually still have a bad state in one of the registers. If I understand this code part correcly it essentially try to synchronize the link between a system connected to a lan port, walking through 10/100/1000MB, FD, HD,… till the link is established but eventually fails.

How are you connected to this port? If you have it connected to e;g. a Windows machine, can you try to set this side to e.g. 100MB or HD instead of FD and see if it then can establish a link?

sorry, just throwing out ideas.

It is not a lan-port…it is a sgmii-ethernet-lane between soc (mt7622) and the mt7531 switch.

and it is set on both sides to 2500Mbit (forced mode) via dts

after i added the delays i can work over the sgmii-link (also when loaded from sd) but still get fault-bit and so the timeout. This again can be point to a clock-issue or switch is busy on any step and need some time to apply settings

but the empty function mt7531_internal_phy_calibration is strange…seems like it is prepared but not yet implemented…i saw some calibration output here but did not found strings in the driver

ah, found it in openwrt tree as patchfile: https://github.com/openwrt/openwrt/blob/master/target/linux/mediatek/patches-4.19/0003-mt7531-gsw-internal_phy_calibration.patch

edit: tried that patch but it seems to be called after sgmii-setup so this exits again with etimeout

[    4.277668] mt753x gsw@0: mt7531_set_port_sgmii_force_mode:295 0x800140                                         
[    4.284379] mt753x gsw@0: mt7531_set_port_sgmii_force_mode:302 0xc00 TX:800 RX:400                              
[    4.291952] mt753x gsw@0: mt7531_mac_port_setup:455 set-port-sgmii retval: -110                                 
[    4.299356] mt753x gsw@0: mt7531_mac_port_setup:466 PMCR(6):0xf805633b                                          
[    4.305888] mt753x gsw@0: mt753x_probe:501                                                                      
[    4.310073] mt753x gsw@0: mt753x_probe:507                                                                      
[    4.314314] mt753x gsw@0: mt753x_probe:521                                                                      
[    4.318502] mt753x gsw@0: mt753x_probe:527                                                                      
[    4.322687] mt753x gsw@0: mt753x_probe:530                                                                      
[    5.818790] mt753x gsw@0: mt753x_probe:534                                                                      
[    5.823073] mt753x gsw@0: mt7531_phy_pll_setup:692 hwstrap: 0xff                                                
[    5.921027] mt753x gsw@0: >>>>>>>>>>>>>>>>>>>>>>>>>>>>> START CALIBRATION:                                      
[    5.929093] mt753x gsw@0: -------- gephy-calbration (port:0) --------                                           
[    7.374054] mt753x gsw@0: -------- gephy-calbration (port:1) --------                                           
[    8.639674] mt753x gsw@0: -------- gephy-calbration (port:2) --------                                           
[    9.854206] mt753x gsw@0: -------- gephy-calbration (port:3) --------                                           
[   11.058177] mt753x gsw@0: -------- gephy-calbration (port:4) --------                                           
[   12.453057] mt753x gsw@0: mt753x_probe:538  irq:67                                                              
[   12.459817] mt753x gsw@0: mt753x_probe:542                                                                      
[   12.464525] mt753x gsw@0: Port 1 Link is Up - 1Gbps/Full

as far as i see only the external ports (0-4) are calibrated not the cpu-ports (5+6)

have rebased 5.4-r64-rc and added only dts-changes (adaption to phylink) needed debug (SGMII-Status and return-value)…

  • ping works without delays
  • fault still the same:
[    4.255944] mt753x gsw@0: mt7531_set_port_sgmii_force_mode:298 0xc00 TX:800 RX:400                                                 
[    4.263518] mt753x gsw@0: mt7531_mac_port_setup:449 set-port-sgmii retval: -110

can anybody please test this on openwrt with kernel 4.19 (maybe @Ivan_Revyakin)?

https://github.com/frank-w/BPI-R2-4.14/commit/8ea7ca75a33e934cef4aec26e2beba226acb529f.patch

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?