libgles-omap3: fixup ti816x
authorKoen Kooi <k-kooi@ti.com>
Thu, 7 Oct 2010 10:42:13 +0000 (12:42 +0200)
committerKoen Kooi <koen@openembedded.org>
Thu, 7 Oct 2010 10:47:16 +0000 (12:47 +0200)
* needs a better fix in cputype, but this will do for now

Signed-off-by: Koen Kooi <k-kooi@ti.com>
recipes/powervr-drivers/libgles-omap3.inc
recipes/powervr-drivers/libgles-omap3/cputype
recipes/powervr-drivers/libgles-omap3/rc.pvr

index 938b59b..d2ab460 100644 (file)
@@ -1,7 +1,7 @@
 DESCRIPTION = "libGLES for the omap3"
 LICENSE = "proprietary-binary"
 
-PR = "r7"
+PR = "r8"
 
 COMPATIBLE_MACHINE = "(omap3|ti816x)"
 
index 9dc2b49..e34a5f2 100755 (executable)
@@ -1,5 +1,11 @@
 #!/bin/sh
-devmem2 0x4800244c | \
-grep 'Value at address' | \
-sed -e 's/.*): //' | \
-sed -e 's/0x5C00/OMAP3503/' -e 's/0x1C00/OMAP3515/' -e 's/0x4C00/OMAP3525/' -e 's/0xC00/OMAP3530/'
+. /etc/init.d/functions
+
+if [ "$(machine_id)" = "ti8168evm" ] ; then
+       echo TI816x
+else
+       devmem2 0x4800244c | \
+       grep 'Value at address' | \
+       sed -e 's/.*): //' | \
+       sed -e 's/0x5C00/OMAP3503/' -e 's/0x1C00/OMAP3515/' -e 's/0x4C00/OMAP3525/' -e 's/0xC00/OMAP3530/'
+fi
index b84225e..6513102 100755 (executable)
@@ -30,7 +30,8 @@ fi
 # Try to enable triple buffering when there's enough VRAM
 fbset -vyres $(expr $YRES \* 3) 
 
-if [ $CPUTYPE = "OMAP3530" ]; then
+case $CPUTYPE in
+"OMAP3530")
        echo Starting PVR
        insmod $(busybox find /lib/modules/$(uname -r) -name "pvrsrvkm.ko")
        modprobe omaplfb
@@ -64,7 +65,44 @@ if [ $CPUTYPE = "OMAP3530" ]; then
                echo "${ES_REVISION}" > /etc/powervr-esrev
        fi
        /usr/bin/pvrsrvinit
-else
-       echo No SGX hardware, not starting PVR
-fi
+       ;;
+"TI816x")
+       echo Starting PVR
+       insmod $(busybox find /lib/modules/$(uname -r) -name "pvrsrvkm.ko")
+       modprobe omaplfb
+       modprobe bufferclass_ti
+
+       pvr_maj=`grep "pvrsrvkm$" /proc/devices | cut -b1,2,3`
+        bc_maj=`grep "bc" /proc/devices | cut -b1,2,3`
+
+       if [ -e /dev/pvrsrvkm ] ; then 
+               rm -f /dev/pvrsrvkm
+       fi
+
+       mknod /dev/pvrsrvkm c $pvr_maj 0 
+       chmod 666 /dev/pvrsrvkm
 
+       touch /etc/powervr-esrev
+
+       SAVED_ESREVISION="$(cat /etc/powervr-esrev)"
+
+       devmem2 0x48180F04 w 0x0
+       devmem2 0x48180900 w 0x2
+       devmem2 0x48180920 w 0x2
+
+       ES_REVISION="$(devmem2 0x56000014 | sed -e s:0x10205:6: -e s:0x10201:3: -e s:0x10003:2: | tail -n1 | awk -F': ' '{print $2}')"
+
+       if [ "${ES_REVISION}" != "${SAVED_ESREVISION}" ] ; then
+               echo -n "Starting SGX fixup for"
+               echo " ES${ES_REVISION}.x"
+               cp -a /usr/lib/ES${ES_REVISION}.0/* /usr/lib
+               cp -a /usr/bin/ES${ES_REVISION}.0/* /usr/bin    
+               echo "${ES_REVISION}" > /etc/powervr-esrev
+       fi
+       /usr/bin/pvrsrvinit
+
+       ;;
+*)
+       echo No SGX hardware, not starting PVR
+       ;;
+esac