[Letux-kernel] SGX working on BeagleBone...
H. Nikolaus Schaller
hns at goldelico.com
Mon Oct 14 10:12:30 CEST 2019
> Am 14.10.2019 um 08:33 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>> Am 12.10.2019 um 22:11 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>> I managed to hack the SD card image that I made according to
>> to run the LetuxOS kernel with the described pvr setup.
>> Required was:
>> * remove bootargs.scr and some unneeded dtbs
>> * rename the beaglebone.dtb and zImage to the kernel names expected by the U-Boot
>> * move away all /lib/firmware/*.dtbo overlays
>> I have even written a small script that can copy things back and forward to
>> switch between both kernels (ti-4.4 and our letux kernel).
>> Then I could boot again into the Debian system.
>> But now using my own pvrsrvkm built from  and the setup described
>> of the tutorial, I could successfully download the uKernel and run
>> gles1test1. Unfortunately without LCD cape working so I can't make
>> a video yet.
>> root at arm:~# pvrsrvctl --start --no-module
>> [ 500.690679] PVR_K: UM DDK-(3699939) and KM DDK-(3699939) match. [ OK ]
>> rroot at arm:~# cat /proc/pvr/version
>> Version SGX_DDK sgxddk MAIN at 3699939 (release) omap_sgx
>> System Version String: SGX revision = 125
>> root at arm:~#
>> And I checked that we are really running our pvrsrvkm:
>> root at arm:~# lsmod|fgrep pvr
>> pvrsrvkm_omap_am335x_sgx530_125 290816 0
>> drm 356352 4 pvrsrvkm_omap_am335x_sgx530_125,tilcdc,drm_kms_helper
>> root at arm:~# dmesg|fgrep pvr
>> [ 26.928017] pvrsrvkm_omap_am335x_sgx530_125: module is from the staging directory, the quality is unknown, you have been warned.
>> [ 27.527189] [drm] Initialized pvr 1.14.3699939 20110701 for 56000000.sgx on minor 1
>> root at arm:~# uname -a
>> Linux arm 5.4.0-rc2-letux+ #1198 SMP PREEMPT Sat Oct 12 18:20:32 CEST 2019 armv7l GNU/Linux
>> root at arm:~#
>> This means:
>> * the kernel module is ok!
>> * the clock and reset and sysc stuff from linux-next and beyond is ok!
>> * there is something incompatible or broken within our user-space setup
>> so that ours works only on OMAP5/Pyra for unknown reasons
>> * the same kernel driver tree can be used to build kernel modules for am335x and omap5
>> * it is no longer unlikely that this setup also works on omap3/gta04 :)
>> Next, I have to find the differences in user-space setup to get a better understanding
>> and find out if I can make a full LetuxOS build work on am335x and omap5. If that works
>> I can try on omap3...
> Found it: there are separate user-space variants of the libs and binaries
> for ti335x, ti437x and jacinto6evm. The first seems to be for sgx530, the second
> for sgx540 and the last for sgx544 cores. This would be reasonable since
> those are different sgx revisions and likely need different uKernel and libraries.
> With this in mind I have reworked the user-space setup into a new debian package
> that I have attached. It just clones the git repo for omap5-sgx-ddk-um-linux
> and does a make install for the right version.
> With this I was able to start the pvrsrvctl --start --no-module without problems
> on BeagleBoneBlack - and it also works on the GTA04.
> There are just some memory allocation issues when trying to run gles1test1
> so there is still no video...
> root at letux:~# pvrsrvctl --start --no-module
> [ 4466.006683] PVR_K: UM DDK-(3699939) and KM DDK-(3699939) match. [ OK ]
> root at letux:~# cat /proc/pvr/version
> Version SGX_DDK sgxddk MAIN at 3699939 (release) omap_sgx
> System Version String: SGX revision = 125
> root at letux:~# uname -a
> Linux letux 5.4.0-rc2-letux+ #1198 SMP PREEMPT Sat Oct 12 18:20:32 CEST 2019 armv7l GNU/Linux
> root at letux:~# cat /sys/devices/soc0/machine
> root at letux:~# gles
> gles1test1 gles2test1
> root at letux:~# gles1test1
> [ 4478.031799] PVR_K:(Error): DoMapToUser: Error - vmf_insert_mixed failed (100)
> PVR:(Error): PVRPMapKMem: mmap(2) failed: Mapping handle=0xf: Tܿ7p% [0, ]
> PVR:(Error): WSEGL_InitialiseDisplay: Failed to open primary device: No such file or directory [0, ]
> 'eglInitialize' returned egl error 'EGL_NOT_INITIALIZED' (0x3001)
> root at letux:~#
> Anyways, this is a good indication that we can run the 1.14 PVR also on OMAP3 even
> if not officially supported. Maybe the driver needs some hack to help with vmf_insert_mixed.
Quick test: this variant does not run on OMAP5. Complains that it does not know OMAP5432,
about bad number of cores and mismatch of config options.
So there are multiple different user-space variants around, not only for different
SGX versions but older and newer.
Most likely we need to clone a different branch from git://git.ti.com/graphics/omap5-sgx-ddk-um-linux.git
More information about the Letux-kernel