demo_apps: Update ipc and imageproc script to use num dsps DEV.MATRIX.APPS.01.00.00.03
authorSam Nelson <sam.nelson@ti.com>
Thu, 10 Jul 2014 14:03:29 +0000 (10:03 -0400)
committerSam Nelson <sam.nelson@ti.com>
Tue, 15 Jul 2014 03:10:47 +0000 (23:10 -0400)
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
demo_apps/demo_imageproc/run_dsp.sh
demo_apps/demo_ipc/demo_ipc.sh

index f89be14c3f0bf8f5ec4ef5365ca4f0447ac47062..8419daeacaceead98d74719cb1a0f09ad70a9a46 100644 (file)
@@ -1,27 +1,35 @@
+#!/bin/sh
+
 export SLAVE_DIR=/usr/share/matrix-gui-2.0/apps/demo_imageproc/bin
 
-mpmcl reset dsp0
-mpmcl reset dsp1
-mpmcl reset dsp2
-mpmcl reset dsp3
-mpmcl reset dsp4
-mpmcl reset dsp5
-mpmcl reset dsp6
-mpmcl reset dsp7
-mpmcl load dsp0 $SLAVE_DIR/image_processing_evmtci6638k2k_slave.out
-mpmcl load dsp1 $SLAVE_DIR/image_processing_evmtci6638k2k_slave.out
-mpmcl load dsp2 $SLAVE_DIR/image_processing_evmtci6638k2k_slave.out
-mpmcl load dsp3 $SLAVE_DIR/image_processing_evmtci6638k2k_slave.out
-mpmcl load dsp4 $SLAVE_DIR/image_processing_evmtci6638k2k_slave.out
-mpmcl load dsp5 $SLAVE_DIR/image_processing_evmtci6638k2k_slave.out
-mpmcl load dsp6 $SLAVE_DIR/image_processing_evmtci6638k2k_slave.out
-mpmcl load dsp7 $SLAVE_DIR/image_processing_evmtci6638k2k_slave.out
-mpmcl run dsp0
-mpmcl run dsp1
-mpmcl run dsp2
-mpmcl run dsp3
-mpmcl run dsp4
-mpmcl run dsp5
-mpmcl run dsp6
-mpmcl run dsp7
+compatible=$(cat /proc/device-tree/compatible)
+case "$compatible" in
+  *k2hk-evm*) 
+       platform=k2hk-evm
+       num_dsps=8
+       dsp_image=image_processing_evmtci6638k2k_slave.out
+       ;;
+  *k2l-evm*)  
+       platform=k2l-evm
+       num_dsps=4
+       dsp_image=image_processing_evmtci6630k2l_slave.out
+       ;;
+  *k2e-evm*)  
+       platform=k2e-evm
+       num_dsps=1
+       dsp_image=image_processing_evm66ak2e_slave.out
+       ;;
+  *)   
+       platform=unknown
+       num_dsps=0
+       ;;
+esac
+echo platform : $platform num_dsps:  $num_dsps
+max_dsp_num=$((num_dsps-1))
 
+for i in `seq 0 $max_dsp_num`
+do
+mpmcl reset dsp$i
+mpmcl load dsp$i $SLAVE_DIR/${dsp_image}
+mpmcl run dsp$i
+done
index 8d20f8f31a3b5ee879dd133cce296ae091f74056..bb4914f289295885b3743d0e0a11461ef8c5ec8c 100644 (file)
 #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
+# Check platform type based on device tree compatible entry
+compatible=$(cat /proc/device-tree/compatible)
+case "$compatible" in
+  *k2hk-evm*) 
+       platform=k2hk-evm
+       num_dsps=8
+       dsp_image=messageq_single.xe66
+       ;;
+  *k2l-evm*)  
+       platform=k2l-evm
+       num_dsps=4
+       dsp_image=messageq_single.k2l.xe66
+       ;;
+  *k2e-evm*)  
+       platform=k2e-evm
+       num_dsps=1
+       dsp_image=messageq_single.k2e.xe66
+       ;;
+  *)   
+       platform=unknown
+       num_dsps=0
+       ;;
+esac
+echo platform : $platform num_dsps:  $num_dsps
+
+max_dsp_num=$((num_dsps-1))
 echo Loading DSP Images
-for i in 0 1 2 3 4 5 6 7
+for i in `seq 0 $max_dsp_num`
 do
 echo "Resetting core $i..."
 mpmcl reset dsp$i
@@ -43,9 +69,10 @@ mpmcl status dsp$i
 done
 echo "Done"
 echo "Loading and Running " $1 "..."
-for i in 0 1 2 3 4 5 6 7
+for i in `seq 0 $max_dsp_num`
 do
-mpmcl load dsp$i "/lib/firmware/messageq_single.xe66"
+echo "/lib/firmware/$dsp_image"
+mpmcl load dsp$i "/lib/firmware/$dsp_image"
 mpmcl run dsp$i
 done