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

Back to topic…

Found out that huawei mediapad t3 also uses this chip,but did not yet found driver in source

https://consumer.huawei.com/en/opensource/detail/?siteCode=worldwide&productCode=Tablets&fileType=openSourceSoftware&pageSize=10&curPage=1

But it’s also android (7) where i guess it also uses kernel 3.18, driver package seems to be the BG2-W09, which is same driver…

So it means driver is also targeted at android so in best case scenario it will be the same thing we’ve got now on hands and more probable is that it won’t compile for linux at all as you mentioned that @garywang had modified/ported Android driver to linux 4.4/4.9 as a first step. Oh well, it might be a proper thing then to at least take sources we’ve got and patch them to be buildable as an out-of-tree module (the same way it is done in linux kernel backports thing). Building it as a module is in any case a hard requirement if we want it to work with openwrt - they do use out of tree 80211n stack from backports so to have this driver working in openwrt with stock openwrt kernel it needs to be a module linked with backports cfg80211n.

i also think that workung on (my) current codebase will be the best we can do and enable module building and tidy up. Here are you more expert.

I currently fighting with r64 uboot and emmc (but i think i found the problem…have to make some tests after patching mmc-driver)

Can I use any pre-compile kernel from your git with a working wifi ? If so then which one? Also advice which branch should I use in case I want to compile it on my own with a working wifi and stable version? I plan to build a new image for Arch Linux this week.

Please advice. Thanks.

Precompiled only for 4.14 and 4.19. All others need to be compiled (-wifi branch)

if you want to try last wifi-enabled kernel: https://github.com/frank-w/BPI-R2-4.14/tree/5.4-wifi

1 Like

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 КБ)