index 2e2cd64eaab296948f006779409fb11c79fecd89..a99f3d6d25e01667d918163c8efa0467e67fb8a8 100755 (executable)
--- a/debug/dss_clockdumps.sh
+++ b/debug/dss_clockdumps.sh
#!/bin/bash
-#Author:- Nikhil Devshatwar
+# Author:- Nikhil Devshatwar
+# Modified by Venkateswara Rao Mandela for HDMI PLL support
+# and ADB support
+
#This script is used for debugging issues with DSS and LCD panels.
#It dumps all the clocks and muxes.
#For any queries, contact http://e2e.ti.com/support/omap/f/885
+# Modify this string to --force <platname> if platform detection fails
+FORCE_PLAT=""
+
+# Set this variable to 1 when running against an Android Build
+# The android shell has limited functionality. So this script runs
+# omapconf via adb and parses the output on the host.
+USE_ADB=0
+
+# Define a function that wraps omapconf calls and removes the usual warning
+# messages
+oc_func() {
+
+ if [ "$USE_ADB" -eq 1 ]; then
+ OMAPCONF1="adb shell omapconf $FORCE_PLAT"
+ else
+ OMAPCONF1="omapconf $FORCE_PLAT"
+ fi
+ out_str=$($OMAPCONF1 "$@" 2>&1 | sed -e '/powerdm_deinit/d' -e '/clockdm_deinit/d' -e 's/[[:space:]]*$//')
+ echo "$out_str"
+}
+OMAPCONF=oc_func
+
check_field() {
val=$1
shift=$2
shift=$3
mask=$4
addr=`printf "0x%08x" $(( $start + $offset ))`
- val=0x`omapconf read $addr 2>/dev/null`
+ val=0x$($OMAPCONF read "$addr")
fld=`printf "0x%08x" $(( $val >> $shift ))`
fld=`printf "%d" $(( $fld & $mask ))`
echo $fld
echo "========================================================"
end=`printf "0x%08x" $(( $base + 0x20 ))`
echo "Register dump for DPLL $inst"
- omapconf dump $base $end 2>/dev/null
+ $OMAPCONF dump $base $end
#Interprete the regdump
addr=`printf "0x%08x" $(( $base + 0x4 ))`
- val=0x`omapconf read $addr 2>/dev/null`
+ val=0x$($OMAPCONF read "$addr")
echo "Details for DPLL $inst"
pllstat=`check_field $val 1 1 "inactive" "Locked"`
m4stat=`check_field $val 7 1 "inactive" "Active"`
dump_dss_clk_mux() {
dss_pll=0x4a002538
- val=0x`omapconf read $dss_pll 2>/dev/null`
+ val=0x$($OMAPCONF read "$dss_pll")
echo "CTRL_CORE_DSS_PLL_CONTROL ($dss_pll) = $val"
echo "video1 PLL : " `check_field $val 0 1 "Enabled" "Disabled"`
echo "video2 PLL : " `check_field $val 1 1 "Enabled" "Disabled"`
echo "DSI1_C_CLK mux : "`check_field $val 7 2 "DPLL Video2" "DPLL Video1" "DPLL HDMI"`
echo
- dss_ctrl=0x58000040
- val=0x`omapconf read $dss_ctrl 2>/dev/null`
- echo "DSS_CTRL ($dss_ctrl) = $val"
+ dss_ctrl=0x58000040
+ val=0x$($OMAPCONF read "$dss_ctrl")
+ echo "DSS_CTRL ($dss_ctrl) = $val"
echo " 2: LCD1 clk switch : " `check_field $val 0 1 "DSS clk" "DSI1_A_CLK"`
echo " 3: LCD2 clk switch : " `check_field $val 12 1 "DSS clk" "DSI1_B_CLK"`
echo "10: LCD3 clk switch : " `check_field $val 19 1 "DSS clk" "DSI1_C_CLK"`
dss_clk_print() {
echo "========================================================"
echo "Clock O/P of MUXes"
- dss_clk=`omapconf show dpll 2>/dev/null | grep -A3 "H12 Output" | grep Speed | head -1 | cut -d '|' -f6`
+ dss_clk=$($OMAPCONF show dpll | grep -A3 "H12 Output" | grep Speed | head -1 | cut -d '|' -f6)
dss_clk=$(( $dss_clk * 1000000 ))
- dss_pll=0x4a002538
- val=0x`omapconf read $dss_pll 2>/dev/null`
- dsia_clk=`check_field $val 3 3 $video1_m4 $hdmi_pll`
+ dss_pll=0x4a002538
+ val=0x$($OMAPCONF read "$dss_pll")
+ dsia_clk=`check_field $val 3 3 $video1_m4 $hdmi_pll`
dsib_clk=`check_field $val 5 3 $video1_m6 $video2_m6 $hdmi_pll "DPLL ABE"`
dsic_clk=`check_field $val 7 3 $video2_m4 $video1_m6 $hdmi_pll`
echo "DSI1_A_CLK : " $dsia_clk
echo "DSI1_C_CLK : " $dsic_clk
echo
- dss_ctrl=0x58000040
- val=0x`omapconf read $dss_ctrl 2>/dev/null`
- lcd1_clk=`check_field $val 0 1 $dss_clk $dsia_clk`
+ dss_ctrl=0x58000040
+ val=0x$($OMAPCONF read "$dss_ctrl")
+ lcd1_clk=`check_field $val 0 1 $dss_clk $dsia_clk`
lcd2_clk=`check_field $val 12 1 $dss_clk $dsib_clk`
lcd3_clk=`check_field $val 19 1 $dss_clk $dsic_clk`
hdmi_clk=`check_field $val 7 3 $dss_clk $dsia_clk $dsib_clk $hdmi_clk $dsic_clk`