UPDATE: see last post, I'm using another ti-sdk and graphics sdk because otherwise the sgx drivers wouldn't load.
Hi,
I have a board based on the am335x EVM and I managed to port U-boot and linux. My version of u-boot is 2013.01 of the ti-sdk (psp06.00.00.00) and I'm using the arago linux distro from the TI board port labs ( kernel 3.2 ). I was trying to get some example opengl Qt apps working but when i try to run them, it said I had to install SGX support.
From my understanding, these drivers are included in the Graphics SDK from TI.
I downloaded this, the version I have is Graphics_SDK_4_10_00_01. I edited the Rules.make file :
#Rules.make
################# FIELDS MODIFIABLE BY THE USER ###############################
############### All the fields below are MANDATORY ############################
#By default all below variables have been initialized with equivalent AMSDK variables
# Change them to appropriate paths as per your machine/build environment paths.
# Set home area (ex /home/user/)
#HOME=$(SDK_INSTALL_DIR)/graphics
HOME=/home/laurens
# Set Toolchain path (ex /home/user/toolchain/arago-2011.09/armv7a)
#CSTOOL_DIR=$(LINUX_DEVKIT_PATH)
CSTOOL_DIR=/home/laurens/ti-sdk-am335x-evm/linux-devkit/sysroots/armv7ahf-vfp-neon-3.2-oe-linux-gnueabi/
# Set Tool chain prefix (ex arm-arago-linux-gnueabi- )
CSTOOL_PREFIX=arm-linux-gnueabihf-
# Set kernel installation path ( ex /home/user/linux-04.00.01.13 )
KERNEL_INSTALL_DIR=/home/laurens/ti-sdk-am335x-evm/targetNFS/lib/modules/3.2.0-g2b92769-dirty/build
# Set Target filesystem path ( ex /home/user/targetfs )
#Install dir is the sd card rootfs partition
TARGETFS_INSTALL_DIR=/media/laurens/rootfs
# Set installation folder
GRAPHICS_INSTALL_DIR=$(HOME)/Graphics_SDK_4_10_00_01
I ran the commands:
make BUILD=debug OMAPES=8.x FBDEV=no all_km
sudo make BUILD=debug OMAPES=8.x FBDEV=no install_km
I included the FBDEV=no option becauses this solved the following error:
/home/laurens/Graphics_SDK_4_10_00_01/GFX_Linux_KM/services4/3rdparty/dc_ti335x_linux/omaplfb_linux.c:134:27: fatal error: omapfb/omapfb.h: No such file or directory
Now these commands run without errors.
The problem (maybe I'm overlooking something before these steps, I don't know) is when I try to install them on my board. This is when I run the am335xdemo script.
root@am335x-evm:/etc/init.d# ./335x-demo
0x10205
debug8.x
installing 8.x SGX debug user libraries
Installing PowerVR Consumer/Embedded DDK 'sgxddk_1.10@2359475' on target
File system installation root is /
Nothing to un-install.
boot script rc.pvr -> /etc/init.d/rc.pvr
kernel module pvrsrvkm.ko -> /lib/modules/3.2.0-g2b92769-dirty/extra/pvrsrvkm.ko
kernel module omaplfb.ko -> /lib/modules/3.2.0-g2b92769-dirty/extra/omaplfb.ko
shared library libGLES_CM.so -> /usr/lib/libGLES_CM.so.1.10.2359475
shared library libusc.so -> /usr/lib/libusc.so.1.10.2359475
shared library libGLESv2.so -> /usr/lib/libGLESv2.so.1.10.2359475
shared library libglslcompiler.so -> /usr/lib/libglslcompiler.so.1.10.2359475
shared library libIMGegl.so -> /usr/lib/libIMGegl.so.1.10.2359475
shared library libEGL.so -> /usr/lib/libEGL.so.1.10.2359475
shared library libpvr2d.so -> /usr/lib/libpvr2d.so.1.10.2359475
shared library libpvrPVR2D_BLITWSEGL.so -> /usr/lib/libpvrPVR2D_BLITWSEGL.so.1.10.2359475
shared library libpvrPVR2D_FLIPWSEGL.so -> /usr/lib/libpvrPVR2D_FLIPWSEGL.so.1.10.2359475
shared library libpvrPVR2D_FRONTWSEGL.so -> /usr/lib/libpvrPVR2D_FRONTWSEGL.so.1.10.2359475
shared library libpvrPVR2D_LINUXFBWSEGL.so -> /usr/lib/libpvrPVR2D_LINUXFBWSEGL.so.1.10.2359475
shared library libsrv_um.so -> /usr/lib/libsrv_um.so.1.10.2359475
shared library libsrv_init.so -> /usr/lib/libsrv_init.so.1.10.2359475
shared library libPVRScopeServices.so -> /usr/lib/libPVRScopeServices.so.1.10.2359475
binary pvrsrvctl -> /usr/local/bin/pvrsrvctl
binary sgx_init_test -> /usr/local/bin/sgx_init_test
binary services_test -> /usr/local/bin/services_test
binary sgx_blit_test -> /usr/local/bin/sgx_blit_test
binary sgx_clipblit_test -> /usr/local/bin/sgx_clipblit_test
binary sgx_flip_test -> /usr/local/bin/sgx_flip_test
binary sgx_render_flip_test -> /usr/local/bin/sgx_render_flip_test
binary pvr2d_test -> /usr/local/bin/pvr2d_test
shader glsltest1_vertshader.txt -> /usr/local/bin/glsltest1_vertshader.txt
shader glsltest1_fragshaderA.txt -> /usr/local/bin/glsltest1_fragshaderA.txt
shader glsltest1_fragshaderB.txt -> /usr/local/bin/glsltest1_fragshaderB.txt
Installation complete!
You may now reboot your target.
Module pvrsrvkm failed to load. Retrying.
Running /sbin/depmod
[ 142.819213] Disabling lock debugging due to kernel taint
[ 142.849304] PVR: PVRCore_Init
[ 142.855102] PVR: PVRCore_Init: major device 251
./rc.pvr: line 34: /usr/local/bin/pvrsrvctl: No such file or directory
root@am335x-evm:/etc/init.d# lsmod
Module Size Used by
pvrsrvkm 484224 0
g_mass_storage 37863 0
When I reboot my board I get this when booting the kernel:
Starting PVR
[ 16.185485] Disabling lock debugging due to kernel taint
[ 16.215515] PVR: PVRCore_Init
[ 16.221405] PVR: PVRCore_Init: major device 251
[ 16.563354] PVR_K:(Fatal): Debug assertion failed! [220, home/laurens/Graphics_SDK_4_10_00_01/GFX_Linux_KM/services4/system/include/syscommon.h]
[ 16.577056] ------------[ cut here ]------------
[ 16.581878] kernel BUG at /home/laurens/Graphics_SDK_4_10_00_01/GFX_Linux_KM/services4/system/include/syscommon.h:220!
[ 16.593017] Internal error: Oops - undefined instruction: 0 [#1]
[ 16.599304] Modules linked in: omaplfb(O+) pvrsrvkm(O)
[ 16.604675] CPU: 0 Tainted: G O (3.2.0-g2b92769-dirty #1)
[ 16.611755] PC is at PVRSRVRegisterDCDeviceKM+0x6c/0x340 [pvrsrvkm]
[ 16.618316] LR is at console_unlock+0x168/0x1f4
[ 16.623016] pc : [<bf005d14>] lr : [<c003e568>] psr: 60000013
[ 16.623046] sp : de39be20 ip : de39bc60 fp : de39be4c
[ 16.635009] r10: bf08f0e4 r9 : bf08f0bc r8 : bf08f39c
[ 16.640441] r7 : 00000100 r6 : 00000000 r5 : bf090ab8 r4 : de05da00
[ 16.647247] r3 : 20000013 r2 : 00000001 r1 : 00000000 r0 : 0000009a
[ 16.654052] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 16.661499] Control: 10c5387d Table: 9e39c019 DAC: 00000015
[ 16.667480] Process modprobe (pid: 1413, stack limit = 0xde39a2f0)
[ 16.673950] Stack: (0xde39be20 to 0xde39c000)
[ 16.678466] be20: bf090984 bf090ab8 de05da04 de05da7c 00000000 de39be40 00000000 de39be30
[ 16.687011] be40: de39be8c de39be50 bf08faf8 bf005cb4 c01cc150 de313010 de313000 00000004
[ 16.695556] be60: 00000000 bf090984 bf090984 c06488c0 de39a000 0000001c c0069754 bf093000
[ 16.704071] be80: de39be9c de39be90 bf093010 bf08f9cc de39bef4 de39bea0 c000876c bf09300c
[ 16.712615] bea0: de39bec4 de39beb0 00000002 00000000 df6c7d00 e0919000 de39bee4 de39bec8
[ 16.721130] bec0: bf090984 bf090984 de0dab00 bf090984 bf090984 de0dab00 00000001 0000001c
[ 16.729675] bee0: c0069754 0000071f de39bfa4 de39bef8 c006abec c0008650 bf090990 c001a654
[ 16.738220] bf00: 00000000 c0069854 e091b11c e091e284 00000000 bf0909cc df6d7f40 c0587fd0
[ 16.746734] bf20: 00000000 00000000 00000000 00000000 00000000 00000000 e0919000 0000741b
[ 16.755279] bf40: e091ddac e091dc72 e091fcfc de08d6c0 00001ac0 00001ff0 00000000 00000000
[ 16.763793] bf60: 0000001e 0000001f 0000000f 0000000d 0000000c 00000000 00000002 00021dd8
[ 16.772338] bf80: 00000000 00021d90 00000080 c00148e8 de39a000 00000000 00000000 de39bfa8
[ 16.780853] bfa0: c0014740 c006a814 00021dd8 00000000 4030a000 0000741b 4002d230 00000002
[ 16.789398] bfc0: 00021dd8 00000000 00021d90 00000080 00021ea0 0000741b 4002d230 00000000
[ 16.797912] bfe0: 44baf5a0 beddc980 40025b24 44baf5b0 80000010 4030a000 5f6d656d 61746164
[ 16.806457] Backtrace:
[ 16.809082] [<bf005ca8>] (PVRSRVRegisterDCDeviceKM+0x0/0x340 [pvrsrvkm]) from [<bf08faf8>] (OMAPLFBInit+0x138/0x2ac [omaplfb])
[ 16.820983] [<bf08f9c0>] (OMAPLFBInit+0x0/0x2ac [omaplfb]) from [<bf093010>] (OMAPLFB_Init+0x10/0x34 [omaplfb])
[ 16.831512] [<bf093000>] (OMAPLFB_Init+0x0/0x34 [omaplfb]) from [<c000876c>] (do_one_initcall+0x128/0x1a8)
[ 16.841583] [<c0008644>] (do_one_initcall+0x0/0x1a8) from [<c006abec>] (sys_init_module+0x3e4/0x1b68)
[ 16.851226] [<c006a808>] (sys_init_module+0x0/0x1b68) from [<c0014740>] (ret_fast_syscall+0x0/0x30)
[ 16.860656] Code: e3a020dc e30a3974 e34b3f04 eb006a62 (e7f001f2)
[ 16.867095] ---[ end trace a877506ba0314898 ]---
/etc/rc5.d/S30pvr-init: line 42: 1413 Segmentation fault modprobe omaplfb
FATAL: Module bufferclass_ti not found.
[ 18.032562] Unhandled fault: external abort on non-linefetch (0x1018) at 0x40161014
Starting SGX fixup for ES.x
cp: can't stat '/usr/lib/ES.0/*': No such file or directory
cp: can't stat '/usr/bin/ES.0/*': No such file or directory
I saw it couldn't find the bufferclass_ti module so I tried to load it in manually:
root@am335x-evm:/opt/gfxlibraries/gfx_dbg_es8.x# insmod bufferclass_ti.ko
[ 88.301788] PVR_K:(Fatal): Debug assertion failed! [220, home/laurens/Graphics_SDK_4_10_00_01/GFX_Linux_KM/services4/system/include/syscommon.h]
[ 88.315490] ------------[ cut here ]------------
[ 88.320312] kernel BUG at /home/laurens/Graphics_SDK_4_10_00_01/GFX_Linux_KM/services4/system/include/syscommon.h:220!
[ 88.331481] Internal error: Oops - undefined instruction: 0 [#2]
[ 88.337738] Modules linked in: bufferclass_ti(O+) g_mass_storage omaplfb(O+) pvrsrvkm(O)
[ 88.346191] CPU: 0 Tainted: G D O (3.2.0-g2b92769-dirty #1)
[ 88.353271] PC is at PVRSRVRegisterBCDeviceKM+0x6c/0x330 [pvrsrvkm]
[ 88.359832] LR is at console_unlock+0x168/0x1f4
[ 88.364562] pc : [<bf006250>] lr : [<c003e568>] psr: 60000013
[ 88.364562] sp : de1d5e38 ip : de1d5c78 fp : de1d5e64
[ 88.376525] r10: bf0a6fa4 r9 : 00000000 r8 : bf00a398
[ 88.381988] r7 : df23ee40 r6 : bf0a6cac r5 : bf0a6fa4 r4 : 00000000
[ 88.388793] r3 : 20000013 r2 : 00000001 r1 : 00000000 r0 : 0000009a
[ 88.395599] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 88.403045] Control: 10c5387d Table: 9f70c019 DAC: 00000015
[ 88.409027] Process insmod (pid: 1541, stack limit = 0xde1d42f0)
[ 88.415283] Stack: (0xde1d5e38 to 0xde1d6000)
[ 88.419830] 5e20: 00000000 bf0a6fa4
[ 88.428375] 5e40: df23ee44 df23ee60 00000000 de1d5e58 00000000 de1d5e48 de1d5e9c de1d5e68
[ 88.436889] 5e60: bf0a9228 bf0061f0 bf0a6cac 00000000 00000000 bf0a6e70 bf0a6e70 c06488c0
[ 88.445434] 5e80: de1d4000 0000001c c0069754 bf0a9000 de1d5ef4 de1d5ea0 c000876c bf0a900c
[ 88.453948] 5ea0: de1d5ec4 de1d5eb0 00000002 00000000 df6c7880 e0933000 de1d5ee4 de1d5ec8
[ 88.462493] 5ec0: bf0a6e70 bf0a6e70 de32a380 bf0a6e70 bf0a6e70 de32a380 00000001 0000001c
[ 88.471008] 5ee0: c0069754 0000036f de1d5fa4 de1d5ef8 c006abec c0008650 bf0a6e7c c001a654
[ 88.479553] 5f00: 00000000 c0069854 e0934800 e09378d0 00000000 bf0a6eb8 de19fec0 c0587fd0
[ 88.488098] 5f20: 00000000 00000000 00000000 00000000 00000000 00000000 e0933000 0000619f
[ 88.496612] 5f40: e0937420 e09372f9 e0938e30 de3629c0 00000fdc 0000126c 00000000 00000000
[ 88.505157] 5f60: 0000001d 0000001e 0000000e 0000000b 00000009 00000000 00000002 44bffb08
[ 88.513671] 5f80: 00000000 00021d98 00000080 c00148e8 de1d4000 00000000 00000000 de1d5fa8
[ 88.522216] 5fa0: c0014740 c006a814 44bffb08 00000000 4016a000 0000619f 401d5230 00000002
[ 88.530731] 5fc0: 44bffb08 00000000 00021d98 00000080 00021088 0000619f 401d5230 00000000
[ 88.539276] 5fe0: 44baf5a0 be8cdbd8 401cdb24 44baf5b0 80000010 4016a000 00000000 00000000
[ 88.547790] Backtrace:
[ 88.550415] [<bf0061e4>] (PVRSRVRegisterBCDeviceKM+0x0/0x330 [pvrsrvkm]) from [<bf0a9228>] (bc_cat_init+0x228/0x2f0 [bufferclass_ti])
[ 88.562957] [<bf0a9000>] (bc_cat_init+0x0/0x2f0 [bufferclass_ti]) from [<c000876c>] (do_one_initcall+0x128/0x1a8)
[ 88.573669] [<c0008644>] (do_one_initcall+0x0/0x1a8) from [<c006abec>] (sys_init_module+0x3e4/0x1b68)
[ 88.583282] [<c006a808>] (sys_init_module+0x0/0x1b68) from [<c0014740>] (ret_fast_syscall+0x0/0x30)
[ 88.592742] Code: e3a020dc e30a3974 e34b3f04 eb006913 (e7f001f2)
[ 88.599151] ---[ end trace a877506ba0314899 ]---
Segmentation fault
root@am335x-evm:/opt/gfxlibraries/gfx_dbg_es8.x# lsmod
Module Size Used by
bufferclass_ti 8467 1
g_mass_storage 37863 0
omaplfb 13867 1
pvrsrvkm 484224 2 omaplfb,bufferclass_ti
But this didn't solve the problem and I find it weird the module is loaded. I found these posts:
http://e2e.ti.com/support/embedded/linux/f/354/t/298853.aspx , http://e2e.ti.com/support/embedded/linux/f/354/t/298853.aspx , http://e2e.ti.com/support/arm/sitara_arm/f/791/p/275648/964119.aspx
These state I have to build the drivers with the PM_RUNTIME=1 option if I have the SGX HWMOD support enabled in the kernel. I'm not sure I have this but I tried building the modules with PM_RUNTIME=1, they built without error but the problem persists when I try to load them on my board.
One of the posts stated I have to patch the kernel with:
https://gitorious.org/rowboat/kernel/commit/d3ab5e87304b45dc594351ed091a6ae451f40de7?format=patch
but I have the feeling this is not for the arago linux distro, since I don't have any of the structs or functions who are altered in the patch.
Is there another patch for the arago distro or wouldn't this solve the problem?
I don't know if this is related to my problem but another strange thing that happens is when I reboot my board after I ran the am335x-evm demo script, my lcd seems to stop working, I can't get the matrix app to show up or any other Qt application ( simple hello world ).
Thanks in advance and my apologies for the long post.