# @name DMTIMERTEST
# @desc DMTIMERTEST uses dmtimer-test module and runs request/release 
#	and context save/restore tests on timer nodes available to be requested
# 	Some of the timers might be disabled in the dts file.
#	Some others might be reserved by other IPs - for example, by IPUs
#	Yet others like timer1 might be reserved to be always on
#	Modify the dts file to be able to run maximum number of tests below.
#	The individual TIMER1/TIMER2/... tests are useful for debug of observations with a 
#	particular timer.

DMTIMER_S_FUNC_REQUEST-FREE-AVAILABLE-TIMERS-10-TIMES source 'common.sh'; dmtimer_list=`get_dmtimer_list.sh`; dmtimer_block_list=`get_dmtimer_blocked_list.sh`; for timer_element in ${dmtimer_list[@]}; do inblocklist=$(echo ${dmtimer_block_list[@]} | grep -o "$timer_element" | wc -w); echo "INBLOCK for $timer_element is $inblocklist"; if [ $inblocklist -ne 0 ]; then die "Timer $timer_element is blocked from testing."; fi; do_cmd "insmod ddt/dmtimer-test.ko timer_num=$timer_element test_loop=10 test_period=100 test_type=1"; do_cmd "rmmod -f dmtimer-test.ko"; done
DMTIMER_M_FUNC_REQUEST-FREE-AVAILABLE-TIMERS-100-TIMES source 'common.sh'; dmtimer_list=`get_dmtimer_list.sh`; dmtimer_block_list=`get_dmtimer_blocked_list.sh`; for timer_element in ${dmtimer_list[@]}; do inblocklist=$(echo ${dmtimer_block_list[@]} | grep -o "$timer_element" | wc -w); echo "INBLOCK for $timer_element is $inblocklist"; if [ $inblocklist -ne 0 ]; then die "Timer $timer_element is blocked from testing."; fi; do_cmd "insmod ddt/dmtimer-test.ko timer_num=$timer_element test_loop=100 test_period=100 test_type=1"; do_cmd "rmmod -f dmtimer-test.ko"; done

DMTIMER_S_FUNC_100ms-REQUEST-VALIDATE-AVAILABLE-TIMERS-1-TIME source 'common.sh'; dmtimer_list=`get_dmtimer_list.sh`; dmtimer_block_list=`get_dmtimer_blocked_list.sh`; for timer_element in ${dmtimer_list[@]}; do inblocklist=$(echo ${dmtimer_block_list[@]} | grep -o "$timer_element" | wc -w); echo "INBLOCK for $timer_element is $inblocklist"; if [ $inblocklist -ne 0 ]; then die "Timer $timer_element is blocked from testing."; fi; do_cmd "insmod ddt/dmtimer-test.ko timer_num=$timer_element test_loop=1 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"; done
DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-AVAILABLE-TIMERS-10-TIMES source 'common.sh'; dmtimer_list=`get_dmtimer_list.sh`; dmtimer_block_list=`get_dmtimer_blocked_list.sh`; for timer_element in ${dmtimer_list[@]}; do inblocklist=$(echo ${dmtimer_block_list[@]} | grep -o "$timer_element" | wc -w); echo "INBLOCK for $timer_element is $inblocklist"; if [ $inblocklist -ne 0 ]; then die "Timer $timer_element is blocked from testing."; fi; do_cmd "insmod ddt/dmtimer-test.ko timer_num=$timer_element test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"; done

DMTIMER_S_FUNC_500ms-REQUEST-VALIDATE-AVAILABLE-TIMERS-1-TIME source 'common.sh'; dmtimer_list=`get_dmtimer_list.sh`; dmtimer_block_list=`get_dmtimer_blocked_list.sh`; for timer_element in ${dmtimer_list[@]}; do inblocklist=$(echo ${dmtimer_block_list[@]} | grep -o "$timer_element" | wc -w); echo "INBLOCK for $timer_element is $inblocklist"; if [ $inblocklist -ne 0 ]; then die "Timer $timer_element is blocked from testing."; fi; do_cmd "insmod ddt/dmtimer-test.ko timer_num=$timer_element test_loop=1 test_period=500 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"; done
DMTIMER_M_FUNC_500ms-REQUEST-VALIDATE-AVAILABLE-TIMERS-10-TIMES source 'common.sh'; dmtimer_list=`get_dmtimer_list.sh`; dmtimer_block_list=`get_dmtimer_blocked_list.sh`; for timer_element in ${dmtimer_list[@]}; do inblocklist=$(echo ${dmtimer_block_list[@]} | grep -o "$timer_element" | wc -w); echo "INBLOCK for $timer_element is $inblocklist"; if [ $inblocklist -ne 0 ]; then die "Timer $timer_element is blocked from testing."; fi; do_cmd "insmod ddt/dmtimer-test.ko timer_num=$timer_element test_loop=10 test_period=500 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"; done

DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-TIMER2-TIMERS-10-TIMES source 'common.sh'; do_cmd "insmod ddt/dmtimer-test.ko timer_num=2 test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"
DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-TIMER3-TIMERS-10-TIMES source 'common.sh'; do_cmd "insmod ddt/dmtimer-test.ko timer_num=3 test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"
DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-TIMER4-TIMERS-10-TIMES source 'common.sh'; do_cmd "insmod ddt/dmtimer-test.ko timer_num=4 test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"
DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-TIMER5-TIMERS-10-TIMES source 'common.sh'; do_cmd "insmod ddt/dmtimer-test.ko timer_num=5 test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"
DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-TIMER6-TIMERS-10-TIMES source 'common.sh'; do_cmd "insmod ddt/dmtimer-test.ko timer_num=6 test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"
DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-TIMER7-TIMERS-10-TIMES source 'common.sh'; do_cmd "insmod ddt/dmtimer-test.ko timer_num=7 test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"
DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-TIMER8-TIMERS-10-TIMES source 'common.sh'; do_cmd "insmod ddt/dmtimer-test.ko timer_num=8 test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"
DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-TIMER9-TIMERS-10-TIMES source 'common.sh'; do_cmd "insmod ddt/dmtimer-test.ko timer_num=9 test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"
DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-TIMER10-TIMERS-10-TIMES source 'common.sh'; do_cmd "insmod ddt/dmtimer-test.ko timer_num=10 test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"
DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-TIMER11-TIMERS-10-TIMES source 'common.sh'; do_cmd "insmod ddt/dmtimer-test.ko timer_num=11 test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"
DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-TIMER12-TIMERS-10-TIMES source 'common.sh'; do_cmd "insmod ddt/dmtimer-test.ko timer_num=12 test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"
DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-TIMER13-TIMERS-10-TIMES source 'common.sh'; do_cmd "insmod ddt/dmtimer-test.ko timer_num=13 test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"
DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-TIMER14-TIMERS-10-TIMES source 'common.sh'; do_cmd "insmod ddt/dmtimer-test.ko timer_num=14 test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"
DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-TIMER15-TIMERS-10-TIMES source 'common.sh'; do_cmd "insmod ddt/dmtimer-test.ko timer_num=15 test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"
DMTIMER_M_FUNC_100ms-REQUEST-VALIDATE-TIMER16-TIMERS-10-TIMES source 'common.sh'; do_cmd "insmod ddt/dmtimer-test.ko timer_num=16 test_loop=10 test_period=100 test_type=2"; do_cmd "rmmod -f dmtimer-test.ko"
