summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Sakoman <steve@sakoman.com>2009-09-02 22:34:51 -0700
committerKoen Kooi <koen@openembedded.org>2009-09-03 10:33:47 +0200
commit94c2e1f513e1571e56f3729d1439d71eb4d7148b (patch)
tree4fdfd677bcf88ea3967fbea9623eba443b8fcec4
parentae751ce3cd3e186aa0b167de1c5634e1ee98ef7a (diff)
libgles-omap3: detect cpu type and don't load modules if no SGX hardware
-rw-r--r--recipes/powervr-drivers/libgles-omap3.inc5
-rwxr-xr-xrecipes/powervr-drivers/libgles-omap3/cputype5
-rwxr-xr-xrecipes/powervr-drivers/libgles-omap3/rc.pvr36
3 files changed, 31 insertions, 15 deletions
diff --git a/recipes/powervr-drivers/libgles-omap3.inc b/recipes/powervr-drivers/libgles-omap3.inc
index d7f655dc1d..c66309e827 100644
--- a/recipes/powervr-drivers/libgles-omap3.inc
+++ b/recipes/powervr-drivers/libgles-omap3.inc
@@ -1,6 +1,8 @@
DESCRIPTION = "libGLES for the omap3"
LICENCE = "proprietary-binary"
+RDEPENDS_${PN} += "devmem2"
+
#HACK! These are binaries, so we can't guarantee that LDFLAGS match :(
INSANE_SKIP_${PN} = True
INSANE_SKIP_${PN}-tests = True
@@ -25,6 +27,7 @@ PROVIDES += "virtual/egl"
# voila!
SRC_URI = "file://OMAP35x_Graphics_SDK_setuplinux_${SGXPV}.bin \
+ file://cputype \
file://rc.pvr \
file://chameleonman.desktop \
file://evilskull.desktop \
@@ -83,6 +86,8 @@ do_install () {
cp -pP ${BINLOCATION}/*.so* ${D}${libdir}
install -d ${D}${bindir}/
+ install -m 0755 ${WORKDIR}/cputype ${D}${bindir}/
+
cp -pP ${BINLOCATION}/*_test ${D}${bindir}/
cp -pP ${BINLOCATION}/gl2info ${D}${bindir}/
cp -pP ${BINLOCATION}/gles1test1 ${D}${bindir}/
diff --git a/recipes/powervr-drivers/libgles-omap3/cputype b/recipes/powervr-drivers/libgles-omap3/cputype
new file mode 100755
index 0000000000..31fc89b8e1
--- /dev/null
+++ b/recipes/powervr-drivers/libgles-omap3/cputype
@@ -0,0 +1,5 @@
+#!/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/0x0C00/OMAP3530/'
diff --git a/recipes/powervr-drivers/libgles-omap3/rc.pvr b/recipes/powervr-drivers/libgles-omap3/rc.pvr
index 244f480f2c..20b5167b4c 100755
--- a/recipes/powervr-drivers/libgles-omap3/rc.pvr
+++ b/recipes/powervr-drivers/libgles-omap3/rc.pvr
@@ -1,24 +1,30 @@
#!/bin/sh
-#rmmod bc_example
-rmmod omaplfb
-rmmod pvrsrvkm
+CPUTYPE="$(cputype)"
-insmod $(busybox find /lib/modules/$(uname -r) -name "pvrsrvkm.ko")
-#modprobe bc_example
-modprobe omaplfb
+if ( $CPUTYPE == "OMAP3530"); then
-pvr_maj=`grep "pvrsrvkm$" /proc/devices | cut -b1,2,3`
+ rmmod omaplfb
+ rmmod pvrsrvkm
-if [ -e /dev/pvrsrvkm ] ; then
- rm -f /dev/pvrsrvkm
-fi
+ insmod $(busybox find /lib/modules/$(uname -r) -name "pvrsrvkm.ko")
+
+ modprobe omaplfb
+
+ pvr_maj=`grep "pvrsrvkm$" /proc/devices | cut -b1,2,3`
-mknod /dev/pvrsrvkm c $pvr_maj 0
-chmod 666 /dev/pvrsrvkm
+ if [ -e /dev/pvrsrvkm ] ; then
+ rm -f /dev/pvrsrvkm
+ fi
-/usr/bin/pvrsrvinit
+ mknod /dev/pvrsrvkm c $pvr_maj 0
+ chmod 666 /dev/pvrsrvkm
-# Set SGX to full speed
-devmem2 0x48004b40 w 0
+ /usr/bin/pvrsrvinit
+
+ # Set SGX to full speed
+ devmem2 0x48004b40 w 0
+else
+ echo No SGX hardware, not starting pvrsinit
+fi