[BPI-R2] internal Wifi/BT (MT6625L) - Kernel

Thanks creating a PKGBUILD for this, Will try to compile kernel along with boot :smiley: Will put it on my repo maybe so just updating the kernel from the repo can keep the OS updated :smiley:

Thanks for your work.

Frank, I spent some time toying with the driver code we’ve got on hands.
Please take a look at this PR:

1 Like

Thank you very much for your help.Does it now work as module?

Well, it is mixed experience. I hadn’t hit any explicit driver bug/problem when running as module compared to running built-in. But it looks like there’re some kernel memory corruptions happening occasionally when running as a module which mainly manifest themselves as fake ext4 errors being detected causing root file system to be remounted read-only. Finding the cause for this one would be a nightmare I guess.

oh, thats bad…does it also happen when builtin after your modifications? any idea how to debug this?

this problem in my head i think it’s better to clean code a bit…have posted some other comments

Please test current codebase because @LeXa2 did some fixes

1 Like

frank-w in kernel build bpi-r2_5.4.0-rc5-merged wat features are supported ?

In merged-tree all feature-branches except second gmac (wifi,poweroff,hdmi) are merged, and of course all mainline-options from older lts.

@LeXa2 i’ve got a report from @deadmeat that wifi driver hangs on kalHifAhbKalWakeLockTimeout after some time of usage

I guess here but did not found message printed.

Any idea why this happen?

It’s in Frank’s 5.4-wifi branch, w/o any patches, but with custom config.

Compiled with:

➜  ~ armv7a-hardfloat-linux-gnueabihf-gcc -v
Используются внутренние спецификации.
COLLECT_GCC=armv7a-hardfloat-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/armv7a-hardfloat-linux-gnueabihf/9.2.0/lto-wrapper
Целевая архитектура: armv7a-hardfloat-linux-gnueabihf
Параметры конфигурации: /mnt/disk/tmp/portage/cross-armv7a-hardfloat-linux-gnueabihf/gcc-9.2.0-r2/work/gcc-9.2.0/configure --host=x86_64-pc-linux-gnu --target=armv7a-hardfloat-linux-gnueabihf --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=
/usr/x86_64-pc-linux-gnu/armv7a-hardfloat-linux-gnueabihf/gcc-bin/9.2.0 --includedir=/usr/lib/gcc/armv7a-hardfloat-linux-gnueabihf/9.2.0/include --datadir=/usr/share/gcc-data/armv7a-hardfloat-linux-gnueabihf/9.2.0 --mandir=/usr/share/gcc-data/
armv7a-hardfloat-linux-gnueabihf/9.2.0/man --infodir=/usr/share/gcc-data/armv7a-hardfloat-linux-gnueabihf/9.2.0/info --with-gxx-include-dir=/usr/lib/gcc/armv7a-hardfloat-linux-gnueabihf/9.2.0/include/g++-v9 --with-python-dir=/share/gcc-data/ar
mv7a-hardfloat-linux-gnueabihf/9.2.0/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.
gentoo.org/ --with-pkgversion='Gentoo 9.2.0-r2 p3' --disable-esp --enable-libstdcxx-time --enable-poison-system-directories --with-sysroot=/usr/armv7a-hardfloat-linux-gnueabihf --disable-bootstrap --enable-__cxa_atexit --enable-clocale=gnu --d
isable-multilib --disable-altivec --disable-fixed-point --with-float=hard --with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16 --enable-libgomp --disable-libmudflap --disable-libssp --disable-systemtap --enable-vtable-verify --enable-lto
--without-isl --enable-default-pie --enable-default-ssp
Модель многопоточности: posix
gcc версия 9.2.0 (Gentoo 9.2.0-r2 p3)

P.S. 5.5-merged (build with same tools) has no any errors in dmesg, but does not work propertly, long story short - there is no outgoing traffic.

5.4-wifi works but not 5.5-merged? I have only gcc 8.2 (ubuntu 18.4 has no gcc9)

Has 5.5 problems from.beginning or after some time?

I didn’t really tested it in 5.4-wifi, my goal was to test vlans and bridges. But as i remember i wasn’t able to connect and use it, and dmesg was with lots of

kalHifAhbKalWakeLockTimeout

are there There is 5.4 dmesg: dmesg-5.4-wifi (162.4 КБ)

5.5: Right after boot it works, for now i found 3 states.

  1. Everything works. 1-3 minutse after boot (wifi init).
  2. Outgoing traffic disapears. Some times first partially (i.e. i can ping, but can’t connect via ssh), but then always fully. When client is connected i can tcpdump incoming traffic, but no outgoing. In case ou using bridge outgoing traffic is always present on bridge.
  3. Unable to connect to ap. After about 10+ minutes after wifi init, may be depends on ap usage, but i’m not sure. And there are no message in dmesg about wifi.

made only quick test directly after boot running my wifi.sh with -wifi kernels and then merging to main/merged. i have made no longtime test due to missing time.

something is wrong with download-link…i cannot download it :frowning:

Away from pc, will try to upload tommorow.

2nd attempt: dmesg54 (162.0 КБ)

Messages start after you enable client-mode

[MTK-WIFI] WIFI_write: WIFI_write 1

After that you start ap-mode

[MTK-WIFI] WIFI_write: WIFI_write A 

Could you try skip first initialization (echo 1 > /dev/wmtWifi) and testing ap-mode only?

Afair you need to reset controller (echo 0) if setting mode again. But don’t know how stable it works after doing this.

For download it seems forum blocks unknown file extensions (created one with dot in kernelversion before). Maybe filename works if you add .txt or .log

i booted 5.4-main and started Ap with wifi.sh, but got not this message in dmesg…

@DeadMeat

Have it now ~6h running with multiple connects to ap0 still working,no new messages in dmesg. I guess your timeout is caused by initialisation in clientmode and then switching to ap-mode

Ok, i’ll try it again in ap only mode, but it doesn’t helped in 5.5-merged, i’ve tried to enable ap mode without client mode, and all sympthoms are the same.

Have 5.5-merged running for 40 minutes. Started wifi ap mode directly after boot. Still working,no timeout in dmesg. Have connected 4 times to ap and run ssh-connection over it. Do you made more traffic?

edit: now 4h up with additional 3 ap-connects + ssh working, no new message in dmesg

edit2:

root@bpi-r2:~# dmesg | tail -10                                                 
[   64.068177] [STP] mtk_wcn_stp_psm_enable:[W] STP Not Ready, Dont do Sleep/Wap
[   68.417566] [MTK-WIFI] WIFI_open: WIFI_open: major 155 minor 0 (pid 603)     
[   68.417635] [MTK-WIFI] WIFI_write: WIFI_write A                              
                                                                            
[   68.455054] kalFirmwareImageMapping firmware size 225840                     
[   69.628450] [MTK-WIFI] register_set_p2p_mode_handler: (pid 610) register set0
[   69.628557] [MTK-WIFI] WIFI_write: WMT turn on WIFI success!                 
[   69.629943] [MTK-WIFI] WIFI_write: Set wlan mode 0 --> 1                     
[   69.629989] [MTK-WIFI] WIFI_close: WIFI_close: major 155 minor 0 (pid 603)   
[   71.758733] IPv6: ADDRCONF(NETDEV_CHANGE): ap0: link becomes ready           
root@bpi-r2:~# uptime                                                           
 13:19:16 up  5:25,  2 users,  load average: 0.02, 0.02, 0.00                   
root@bpi-r2:~# uname -r                                                         
5.5.0-rc1-bpi-r2-merged                                                         
root@bpi-r2:~# 

unable to reproduce your timeout error at the moment

Cold you give me your config if it’s different from default? I and pls remind what gcc version do you use?