[BPI-R2] Kernel Development

maybe build.sh is broken there…just use 5.4-main with patches i posted above… then you have same state (except doc-patch). and you don’t need to care about build.sh…use 5.3-lima/4.20-mali only as reference. do not spend any additional work to these older branches

and yes, i still did not get any code from johnny…i asked multiple times, but none yet…else i had included it in my repo anyhow.

so start your work on 5.4 and try to get it working there…

I just found that your 4.20-lima dosn’t configure by default CONFIG_DRM_LIMA. When add it to configuration compilation dosn’t work:

drivers/gpu/drm/lima/lima_drv.c: In function ‘lima_ioctl_gem_submit’:
drivers/gpu/drm/lima/lima_drv.c:105:10: error: ‘struct drm_lima_gem_submit_in’ has no member named ‘flags’
  if (args->flags & ~(LIMA_SUBMIT_FLAG_EXPLICIT_FENCE |
          ^~
drivers/gpu/drm/lima/lima_drv.c:105:22: error: ‘LIMA_SUBMIT_FLAG_EXPLICIT_FENCE’ undeclared (first use in this function); did you mean ‘LIMA_SUBMIT_BO_WRITE’?
  if (args->flags & ~(LIMA_SUBMIT_FLAG_EXPLICIT_FENCE |

In 4.19 there is no such option. I just try compile Alex 4.16 and it compile gpu part ok with CONFIG_DRM_LIMA=y. Maybe you can get patches from it on drop then 4.19-main? (or 4.19-lima?)

I have not tested it yet, need compile rest & modules & reboot…

I keep important that there is atleast one lima/mali working kernel that can use comparsion. 5.4 is good direction but need to start from working codebase?
And 2nd I have not yet skills to get patches from github and put in new kernel. Maybe some day…

in 5.3.0-rc1-bpi-r2 there is severe error:

[22176.859874] Buffer I/O error on dev sda2, logical block 0, lost sync page write
[22176.859895] EXT4-fs (sda2): I/O error while writing superblock
[22176.860024] EXT4-fs error (device sda2): __ext4_find_entry:1531: inode #7355111: comm make: reading directory lblock 0
[22176.860078] Buffer I/O error on dev sda2, logical block 0, lost sync page write
[22176.860097] EXT4-fs (sda2): I/O error while writing superblock
[22176.860257] EXT4-fs error (device sda2): __ext4_find_entry:1531: inode #7092414: comm make: reading directory lblock 0
[22176.860316] Buffer I/O error on dev sda2, logical block 0, lost sync page write
[22176.860337] EXT4-fs (sda2): I/O error while writing superblock
[22176.860475] EXT4-fs error (device sda2): __ext4_find_entry:1531: inode #7881299: comm make: reading directory lblock 0
[22176.860529] Buffer I/O error on dev sda2, logical block 0, lost sync page write
[22176.860550] EXT4-fs (sda2): I/O error while writing superblock
[22176.860675] EXT4-fs error (device sda2): __ext4_find_entry:1531: inode #7223390: comm make: reading directory lblock 0
[22176.860730] Buffer I/O error on dev sda2, logical block 0, lost sync page write
[22176.860750] EXT4-fs (sda2): I/O error while writing superblock
[22176.860867] EXT4-fs error (device sda2): __ext4_find_entry:1531: inode #8560318: comm make: reading directory lblock 0
[22176.860921] Buffer I/O error on dev sda2, logical block 0, lost sync page write
[22176.860941] EXT4-fs (sda2): I/O error while writing superblock

Need to boot 4.19 & do fsck

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