[BPI-R2] Kernel Development

is @DeadMeat s 4.16-lima working? imho no public repo had working lima…but you can test it and report if it’s working and compare to 5.4-lima

It is not working and wlan&BT stuff need to disable because compile error. Lima dosn’t detect, same error than 5.3-lima:

[    1.238006] lima 13040000.gpu: get core clk failed -517
[    1.243301] lima 13040000.gpu: clk init fail -517
[    1.247977] lima 13040000.gpu: Fatal error during GPU init
[    3.415826] lima 13040000.gpu: get core clk failed -517
[    3.421189] lima 13040000.gpu: clk init fail -517
[    3.425974] lima 13040000.gpu: Fatal error during GPU init
[   12.891693] lima 13040000.gpu: get core clk failed -517
[   12.891708] lima 13040000.gpu: clk init fail -517
[   12.891715] lima 13040000.gpu: Fatal error during GPU init
[   12.907644] lima 13040000.gpu: get core clk failed -517
[   12.907658] lima 13040000.gpu: clk init fail -517
[   12.907665] lima 13040000.gpu: Fatal error during GPU init
[   12.975271] lima 13040000.gpu: get core clk failed -517
[   12.975288] lima 13040000.gpu: clk init fail -517
[   12.975294] lima 13040000.gpu: Fatal error during GPU init
[   13.004238] lima 13040000.gpu: get core clk failed -517
[   13.004255] lima 13040000.gpu: clk init fail -517

Were it try to get gpu clock, from dts??

It should give lines like:

[    8.492918] lima 13040000.gpu: bus rate = 500500000
[    8.492930] lima 13040000.gpu: mod rate = 500500000

please make separate lima-thread (maybe any exists already).

where did you get the lines? as i said, there is no working lima-kernel, so you can start with 5.4-main and my above patches and start debugging there…clocks and other setting are selected by dts (read and assigned by driver)

These lima lines are from Alex first post Mali-450 support by lima

So need to dig dts and put somewhere 50050000 and 500500000. They are maybe hex or converted decimal by driver? Maybe in mt7623n-bananapi-bpi-r2.dts? or mt7623.dtsi?

i guess there are hex…and imho it’s better to continue this thread and asking alex…

No, pls, see Mali-450 support by lima thread

Which compile-errors and which compiler/version? Imho it should compile till gcc 8 without errors

BPI-R2-4.14-4.20-lima

drivers/gpu/drm/lima/lima_drv.c: At top level: ./include/drm/drm_ioctl.h:159:16: error: ‘DRM_IOCTL_LIMA_GEM_MOD’ undeclared here (not in a function); did you mean ‘DRM_IOCTL_LIMA_GEM_VA’? [DRM_IOCTL_NR(DRM_IOCTL_##ioctl) - DRM_COMMAND_BASE] = { \

And gcc 7.3 CONFIG_COMMON_CLK_MT2701_G3DSYS=y CONFIG_DRM_LIMA=y

i meant why you need to disable wifi/bt…in my tree there is no working lima…only tests…so just start with 5.4-main, and further discuss in lima-thread

Lost more more time, of try to compile kernel from sources under MacOS Catalina… Maybe anybody need for notes how to do it: In my MacOS, by default system volume AFPS with case insensitive (WTF???), when receive from git or unzip, I received answer of need to rewrite some files: xt_connmark.h xt_dscp.h xt_mark.h xt_rateest.h xt_tcpmss.h ipt_ecn.h ipt_ttl.h ip6t_hl.h xt_dscp.c xt_hl.c xt_rateest.c xt_tcpmss.c but agree to rewrite. Them I don`t understand why received errors while try to compile kernel… WHAT TO DO: create virtual volume(dmg file) 5Gb size with CASE SENSITIVE from Disk Utility, and work with kernel sources in this Volume. Start compile from docker container under MacOS: Mount your created volume(dmg file) and run:

  1. docker build /Volumes/$NAME_YOUR_VOLUME/$KERNEL_SOURCES/utils/docker --tag bpi-cross-compile:1
  2. mkdir /Volumes/$NAME_YOUR_VOLUME/$KERNEL_SOURCES/SD
  3. docker run -it -v “/Volumes/$NAME_YOUR_VOLUME/$KERNEL_SOURCES/SD”:/SD -v “/Volumes/$NAME_YOUR_VOLUME/$KERNEL_SOURCES”:/srv --tag bpi-cross-compile:1 /bin/bash
  4. And in docker run: ./build.sh importconfig || ./build.sh
1 Like

i started work on 5.6-rc1 have wifi working, hdmi works too, but there is a warning in drm_atomic_helper_async_commit

and line 1745 (bootlog)

currently i have no idea how to fix it (without removing the WARN_ON-lines)

i noticed a usb-disconnection-problem while testing wifi…maybe some more users can help testing 5.6-rc/5.6-hdmi/5.6-wifi branch

Is there a merged tree available?

Correct me if i wrong:

  • 5.6-rc - general patches only (dts, defconfig,mmc and serial ports order)

  • 5.6-hdmi - 5.6-rc +hdmi patches

  • 5.6-wifi - 5.6-rc + wifi

You are right,there is no merged tree yet,because i want to check for regressions first on features alone.

On wifi-branch i experienced usb disconnects. they happen on my display (touchscreen hid-device), but it looks like this happens always if no hdmi is available (display switches also off and on again when it happens…also while hdmi connected and no touchscreen). watchdog-patch on hdmi does not break anything…seems like i should create a merged tree :wink:

On hdmi i got some warnings. Got a patch from mtk which fixes this warning, pushed it. there is also a strange cursor-display (on 5.5-rc5 there is no issue, so it should be only on 5.6)

maybe

can’t be reverted so easily found 2 commits on top of https://github.com/ckhu-mediatek/linux.git-tags/commits/mediatek-drm-fixes-5.6 cursor-related…try to add them and compare cursor behaviour => no success

created merged-tree and no more usb-disconnects…seems like i had not tried older kernels with display connected without hdmi working :wink:

updated 5.4-main to .21 and included patches from @Ilya_Murav_jov for building debian-packages.

https://github.com/frank-w/BPI-R2-4.14/releases/tag/CI-BUILD-20200223_103817-0b9b9e3c9

wondering why binary deb for r2 is only ~20MB instead of ~49MB (my deb 1 release before)…i hope all modules are packed.

maybe anyone using debs can test it? uenv.txt is not changed in these debs…needs to be done manually

Just wondering… How about to make a 5.4-main branch default in your tree? :wink:

It is relevant for BPI-R64 too. :slight_smile:

Have updated it…i hope most things working on 5.4-main on both devices

1 Like

i merged 5.6-rc7 and noticed that some timeval/ktime-functions/macros are removed because of year2038-issues

i removed additions by me from timekeeping32.h (which are using the removed functions)

  • struct timeval => timespec64
  • timespec64 has no tv_usec => tv_nsec/1000
  • do_gettimeofday => ktime_get_real_ts64
  • get_monotonic_boottime => ktime_get_boottime_ts64

maybe this can be done in more effective way (especially the usec-calculation), but as first start it compiles :slight_smile:

anybody can help me testing?

i did a quick test and wifi seems to work…also noticed that trgmii-mode is broken on 5.6…changed to rgmii

pushed some more commits, but it seems they do not fix the problem…so if you have issues with ethernet while testing just go back to this commit:

05f0f82aeda4 arm: dts: trgmii-mode broken, so move to rgmii

btw. with the author of musb-driver i got otg finally working on r2 (5.4). only one issue exists…if device stays connected to otg-port on poweroff, r2 prints WARNING and do not poweroff. if this one is solved, i merge changes to 5.4-main. if anyone will try it, i have cleaned up to have only 2 commits (dts+defconfig):

1 Like

john posted hwnat-patch for openwrt

https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/mediatek/patches-5.4/0999-hnat.patch;h=ad04e355e62ade948c701b8ff9f7165f4ce347b3;hb=8021652478db50f5739bc2d8d8425cabc6e5d957

Yes that good to hear. I saw this was pushed to OpenWRT trunk.

Also 4.14 support in Mediatek was dropped and they made 5.4 kernel the default.