demo: Fix the timeout command usage
[glsdk/util-scripts.git] / debug / vip_diagnostic.sh
index 3143440cae38c6a836975b949891032375f8b484..5c9c8f956c249d026edf76d57dde85e7eb849d0d 100755 (executable)
@@ -34,7 +34,7 @@ resolve_port()
                i2cbus=15
                desAddr=0x61
                crossbar=VIP2_IRQ_2
-               echo "VIP 2 Slice 1 Port B <--> LVDS cam4"
+               echo "VIP 2 Slice 1 Port B <--> LVDS cam5"
        elif [ $port = "vin5a" ]; then
                inst=0x489b0000
                slice=0x5500
@@ -68,18 +68,40 @@ parser_reg()
 
 vpdma_dumpdesc()
 {
-       echo 
+       echo
        echo "VPDMA descriptor dump"
        listAddr=`printf "0x%x" $(( $inst + 0xd004 ))`
        startAddr=0x`omapconf read $listAddr 2>/dev/null`
        endAddr=`printf "0x%x" $(( $startAddr + 0x40 ))`
        omapconf dump $startAddr $endAddr 2>/dev/null
 
-       #Print the channel number TODO: print size written
+       #Print the data type
+       w0Addr=`printf "0x%x" $(( $startAddr + 0x0 ))`
+       word0=`omapconf read $w0Addr 2>/dev/null`
+       dtype=`printf "0x%x" $(( 0x$word0 >> 26 & 0x3f))`
+       echo "VPDMA data type:- $dtype"
+
+       #Print the channel number
        w4Addr=`printf "0x%x" $(( $startAddr + 0xc ))`
        word4=`omapconf read $w4Addr 2>/dev/null`
        chan=`printf "%d" $(( 0x$word4 >> 16 & 0xff))`
        echo "VPDMA channel number used:- $chan" 
+
+       #Print write descriptor
+       echo
+       echo "VPDMA write descriptor dump"
+       w5Addr=`printf "0x%x" $(( $startAddr + 0x10 ))`
+       word4=0x`omapconf read $w5Addr 2>/dev/null`
+       wrst=`printf "0x%x" $(( $word4 & ~0x7))`
+       wrend=`printf "0x%x" $(( $wrst + 0x20 ))`
+       omapconf dump $wrst $wrend 2>/dev/null
+
+       #Print size written
+       fraddr=`printf "0x%x" $(( $wrst + 0x10 ))`
+       frval=0x`omapconf read $fraddr 2>/dev/null`
+       width=`printf "%d" $(( $frval >> 16 ))`
+       height=`printf "%d" $(( $frval & 0xff ))`
+       echo "Frame size written:- $width x $height"
 }
 
 ovcam() {