Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 477 lines (409 sloc) 15.807 kB
4bc042b initial public release v1.50
Patrick Titiano authored
1 #!/data/busybox/bin/bash
2 #===================================================================================
3 # FILE: regression_test_suite54xx.sh
4 #
5 # USAGE: regression_test_suite54xx.sh ref_version new_version
6 #
7 # DESCRIPTION: OMAPCONF No Regression Test Suite for OMAP5 platform.
8 # Compare omapconf output from reference and new versions.
9 # Report any discrepency.
10 #
11 # OPTIONS:
12 # ref_version: name of the reference binary, INCLUDING PATH.
13 # new_version: name of the new binary to be tested, INCLUDING PATH.
14 # REQUIREMENTS: TO BE RUN ON OMAP5 PLATFORM ONLY
15 # BUGS: ---
16 # NOTES: ---
17 # AUTHOR: Patrick Titiano
18 # COMPANY: Texas Instruments France
19 VERSION=0.30
20 # CREATED: 2011-12-22
21 # REVISION: ---
22 #===================================================================================
23
24
25 #=== FUNCTION ==================================================================
26 # NAME: compare
27 # DESCRIPTION: compare command result of 2 versions of omapconf
28 # Save log in file.
29 # PARAMETER
30 # 1: omapconf command to be tested (including all parameters
31 # 2: test identification string
32 # 3: display new line at end of function (0: no, 1: yes)
33 # CREATED: 2011-12-16 / AUTHOR: Patrick Titiano
34 #===============================================================================
35 # Function
36 function compare {
37 if [ $DEBUG = 1 ]; then
38 echo "compare: arg1 = $1"
39 echo "compare: arg2 = $2"
40 echo "compare: arg3 = $3"
41 fi
42
43 # Generate names for log files based on omapconf revision and command tested
44 logfile_ref=omapconf_"$(echo $2 | tr ' ' '_')"_ref_v"$ref_rev".log
45 logfile_new=omapconf_"$(echo $2 | tr ' ' '_')"_new_v"$new_rev".log
46 if [ $DEBUG = 1 ]; then
47 echo "compare: logfile_ref = $logfile_ref"
48 echo "compare: logfile_new = $logfile_new"
49 fi
50
51 # Execute the command with reference and new omapconf,
52 # saving printed data into log files
53 if [ $DEBUG = 1 ]; then
54 echo "compare: $ref_omapconf_bin $1 > $logfile_ref"
55 echo "compare: $new_omapconf_bin $1 > $logfile_new"
56 fi
57
58 $ref_omapconf_bin --force omap5430 --norw --import regression_test_suite54xx_ref_settings.xml $1 > $logfile_ref
59 $new_omapconf_bin --force omap5430 --norw --import regression_test_suite54xx_ref_settings.xml $1 > $logfile_new
60
61 # First line of log file will always be different (contains OMAPCONF/CHIPS/BUILD revision numbers).
62 # busybox diff doesn't support -I option.
63 # Use sed to remove first lines of log files before doing the diff.
64 sed -i '1d' $logfile_ref
65 sed -i '1d' $logfile_new
66 sed -i '1d' $logfile_ref
67 sed -i '1d' $logfile_new
68 sed -i '1d' $logfile_ref
69 sed -i '1d' $logfile_new
70 sed -i '1d' $logfile_ref
71 sed -i '1d' $logfile_new
72 sed -i '1d' $logfile_ref
73 sed -i '1d' $logfile_new
74 sed -i '1d' $logfile_ref
75 sed -i '1d' $logfile_new
76
77 # Check if both log files are identical, indicating no regression occured.
78 diff $logfile_ref $logfile_new > diff.log
79 rm $logfile_ref $logfile_new
80
81 # Increment counters depending on test results
82 test_cpt=$[$test_cpt+1]
83 if [ -s diff.log ]; then
84 echo "$2 function regression test FAILED!" | tee -a $logfile
85 cat diff.log >> $logfile
86 cat diff.log
87 test_fail_cpt=$[$test_fail_cpt+1]
88 else
89 echo "$2 function regression test passed." | tee -a $logfile
90 test_pass_cpt=$[$test_pass_cpt+1]
91 fi
92
93 # Delete diff file
94 rm diff.log
95
96 if [ $3 = 1 ]; then
97 echo | tee -a $logfile
98 fi
99 }
100
101 rm -f $logfile
102 echo
103 echo OMAPCONF Non-Regression Test Suite v$VERSION | tee $logfile
104 echo | tee -a $logfile
105
106 #---------------------------------------------------------------------------------
107 # Init Variables
108 #---------------------------------------------------------------------------------
109 DEBUG=0
110 test_cpt=0
111 test_pass_cpt=0
112 test_fail_cpt=0
113 tests_list="rw pwst opp dpll prcm sr mpu dep abb abe emif temp export pmic audioic audit uc_audit trace camera display hwobs ctrlmod"
114
115 ref_omapconf_bin=$1
116 new_omapconf_bin=$2
117 if [ $DEBUG = 1 ]; then
118 echo "ref_omapconf_bin = $ref_omapconf_bin"
119 echo "new_omapconf_bin = $new_omapconf_bin"
120 fi
121
122 # Check number of arguments is ok
123 if [ $# = 2 ]; then
124 all_tests=1
125 elif [ $# = 3 ]; then
126 all_tests=0
127 tests=$3
128 tests_ok=0
129 for t in $tests_list
130 do
131 if [ $t = $tests ]; then
132 tests_ok=1
133 fi
134 done
135 if [ $tests_ok = 0 ]; then
136 echo "Invalid 'item'! ($tests)"
137 echo "'item' can only be: $tests_list"
138 exit 3
139 fi
140 else
141 echo "Usage: regression_test_suite54xx.sh reference_binary new_binary [item]"
142 echo " Use 'item' (optional) to select a specific set of test(s)."
143 echo " 'item' can be: $tests_list"
144 echo " If omitted, full suite will be run by default."
145 echo
146 exit 3
147 fi
148
149 # Check reference and new omapconf binaries found
150 if [ ! -s $ref_omapconf_bin ]; then
151 echo "Reference binary not found! ($ref_omapconf_bin)"
152 echo
153 exit 1
154 fi
155 if [ ! -s $new_omapconf_bin ]; then
156 echo "New binary not found! ($new_omapconf_bin)"
157 echo
158 exit 2
159 fi
160
161 # Check reference register file is present
162 if [ ! -s regression_test_suite54xx_ref_settings.xml ]; then
163 echo "Reference Register XML file ('regression_test_suite54xx_ref_settings.xml') not found!"
164 echo "To generate it, type: # omapconf export xml regression_test_suite54xx_ref_settings.xml"
165 echo
166 exit 1
167 fi
168
169 ref_rev=$($ref_omapconf_bin --version | grep OMAPCONF | awk '{print $3}')
170 new_rev=$($new_omapconf_bin --version | grep OMAPCONF | awk '{print $3}')
171 if [ $DEBUG = 1 ]; then
172 echo "ref_rev = $ref_rev"
173 echo "new_rev = $new_rev"
174 fi
175
176 omap_cpu=$($new_omapconf_bin --cpuinfo | grep perf | awk '{print $1}')
177 opp_list_5430="400000 800000 1100000"
178
179 if [ $omap_cpu = OMAP5430 ]; then
180 opp_list=$opp_list_5430
181 fi
182 logfile=omapconf_from_v"$ref_rev"_to_v"$new_rev"_no_reg_test.log
183 cpufreq_gov=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
184 #---------------------------------------------------------------------------------
185
186
187 echo Comparing OMAPCONF revision $new_rev against revision $ref_rev | tee -a $logfile
188 echo Running on $omap_cpu
189 echo omapconf_no_reg_test > /sys/power/wake_lock
190
191 # Force userspace governor to control OPP and not alter diff results
192 echo Current CPUFreq governor is $cpufreq_gov, switching to userspace instead.
193 echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
194 echo Switch to max OPP with 2 CPUs to speed up regression tests
195 echo 1500000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
196
197
198 # Test RW function(s)
199 if [ $all_tests = 1 ] || [ $tests = rw ]; then
200 compare "read 0x4A307300" "READ ADDRESS" 0
201 # compare "read PM_L3INIT_PWRSTCTRL" "READ TRM NAME" 0
202 compare "write 0x4A307300 0xDEADBEEF" "WRITE ADDRESS" 0
203 # compare "write PM_L3INIT_PWRSTST 0xDEADBEEF" "WRITE TRM NAME" 0
204 compare "dump 0x48243400 0x4824340C" "DUMP RANGE" 0
205 # compare "set bit PM_L3INIT_PWRSTST 0x0" "SET BIT NAME" 0
206 # compare "clear bit PM_L3INIT_PWRSTST 0x0" "CLEAR BIT NAME" 0
207 compare "read i2c 1 0x4A 0x87" "I2C READ" 0
208 compare "write i2c 1 0x49 0x02 0xAA" "I2C WRITE" 1
209 fi
210
211
212 # Test PWST function(s)
213 if [ $all_tests = 1 ] || [ $tests = pwst ]; then
214 compare "show pwst" "SHOW PWST" 1
215 fi
216
217
218 # Test OPP function(s) at each possible OPP
219 if [ $all_tests = 1 ] || [ $tests = opp ]; then
220 for opp in $opp_list
221 do
222 echo $opp > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
223 compare "show opp" "SHOW OPP $opp" 0
224 done
225 echo | tee -a $logfile
226 fi
227
228
229 # Test DPLLS function(s)
230 if [ $all_tests = 1 ] || [ $tests = dpll ]; then
231 compare "dump dpll" "DUMP DPLL" 0
232 compare "dump dpll mpu" "DUMP DPLL MPU" 0
233 compare "dump dpll iva" "DUMP DPLL IVA" 0
234 compare "dump dpll core" "DUMP DPLL CORE" 0
235 compare "dump dpll per" "DUMP DPLL PER" 0
236 compare "dump dpll abe" "DUMP DPLL ABE" 0
237 compare "dump dpll usb" "DUMP DPLL USB" 0
238 compare "dump dpll unipro1" "DUMP DPLL UNIPRO1" 0
239 compare "dump dpll unipro2" "DUMP DPLL UNIPRO2" 0
240
241 for opp in $opp_list
242 do
243 echo $opp > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
244 compare "show dpll cfg" "SHOW DPLL CFG $opp" 0
245 compare "show dpll" "SHOW DPLL $opp" 0
246 done
247 echo | tee -a $logfile
248 fi
249
250 # Test PRCM DUMP function(s)
251 if [ $all_tests = 1 ] || [ $tests = prcm ]; then
252 for pwrdm in MPU CORE DSP DSS CAM GPU IVA L4PER ABE L3INIT DEV EMU INSTR CKGEN WKUPAON COREAON ALL
253 do
254 compare "dump prcm $pwrdm" "DUMP PRCM $pwrdm" 0
255 done
256 compare "dump prcm" "DUMP PRCM" 0
257 echo | tee -a $logfile
258
259 # Test PRCM SHOW function
260 for pwrdm in MPU CORE DSP DSS CAM GPU IVA L4PER ABE L3INIT EMU WKUPAON COREAON ALL
261 do
262 compare "show prcm $pwrdm" "SHOW PRCM $pwrdm" 0
263 compare "show prcm $pwrdm cfg" "SHOW PRCM $pwrdm CFG" 0
264 done
265 echo | tee -a $logfile
266
267 for clkdm in L4CFG EMIF IPU L3MAIN1 L3MAIN2 L3INSTR C2C DMA MIPIEXT
268 do
269 compare "show prcm core $clkdm" "SHOW PRCM CORE $clkdm" 0
270 compare "show prcm core $clkdm cfg" "SHOW PRCM CORE $clkdm CFG" 0
271 done
272
273 compare "show prcm" "SHOW PRCM" 0
274 compare "show prcm cfg" "SHOW PRCM CFG" 1
275 fi
276
277
278 if [ $all_tests = 1 ] || [ $tests = prcm ] || [ $tests = dep ]; then
279 # Test Static Dependency function(s)
280 CM_CAM_STATICDEP=`$1 read 0x4A009004`
281 CM_IPU_STATICDEP=`$1 read 0x4A008904`
282 CM_C2C_STATICDEP=`$1 read 0x4A008C04`
283 CM_DMA_STATICDEP=`$1 read 0x4A008A04`
284 CM_MIPIEXT_STATICDEP=`$1 read 0x4A008C84`
285 CM_DSS_STATICDEP=`$1 read 0x4A009104`
286 CM_L3INIT_STATICDEP=`$1 read 0x4A009304`
287 CM_DSP_STATICDEP=`$1 read 0x4A004404`
288 CM_GPU_STATICDEP=`$1 read 0x4A009204`
289 CM_IVA_STATICDEP=`$1 read 0x4A008F04`
290 CM_MPU_STATICDEP=`$1 read 0x4A004304`
291
292 compare "dump prcm dep" "DUMP PRCM DEP" 0
293 compare "show prcm dep" "SHOW PRCM DEP" 0
294 compare "show prcm dep cfg" "SHOW PRCM DEP CFG" 0
295 compare "show prcm statdep" "SHOW PRCM STATDEP" 0
296 compare "show prcm statdep cfg" "SHOW PRCM STATDEP CFG" 0
297 compare "show prcm dyndep" "SHOW PRCM DYNDEP" 0
298 compare "show prcm dyndep cfg" "SHOW PRCM DYNDEP CFG" 0
299
300
301 # for clkdm_from in EMU WKUPAON COREAON CAM L4CFG EMIF IPU L3MAIN2 L3INSTR L3MAIN1 C2C DMA MIPIEXT DSS CUSTEFUSE L3INIT L4PER L4SEC ABE DSP GPU IVA MPU
302 for clkdm_from in WKUPAON CAM EMIF L3MAIN2 L3MAIN1 DMA DSS L3INIT DSP MPU
303 do
304 # for clkdm_to in EMU WKUPAON COREAON CAM L4CFG EMIF IPU L3MAIN2 L3INSTR L3MAIN1 C2C DMA MIPIEXT DSS CUSTEFUSE L3INIT L4PER L4SEC ABE DSP GPU IVA MPU ALL
305 for clkdm_to in EMU COREAON L4CFG IPU L3INSTR C2C MIPIEXT CUSTEFUSE L4PER ABE IVA MPU ALL
306 do
307 compare "set prcm statdep $clkdm_from $clkdm_to" "SET PRCM STATDEP $clkdm_from $clkdm_to" 0
308 compare "clear prcm statdep $clkdm_from $clkdm_to" "CLEAR PRCM STATDEP $clkdm_from $clkdm_to" 0
309 done
310 done
311
312 $1 write 0x4A009004 0x$CM_CAM_STATICDEP
313 $1 write 0x4A008904 0x$CM_IPU_STATICDEP
314 $1 write 0x4A008C04 0x$CM_C2C_STATICDEP
315 $1 write 0x4A008A04 0x$CM_DMA_STATICDEP
316 $1 write 0x4A008C84 0x$CM_MIPIEXT_STATICDEP
317 $1 write 0x4A009104 0x$CM_DSS_STATICDEP
318 $1 write 0x4A009304 0x$CM_L3INIT_STATICDEP
319 $1 write 0x4A004404 0x$CM_DSP_STATICDEP
320 $1 write 0x4A009204 0x$CM_GPU_STATICDEP
321 $1 write 0x4A008F04 0x$CM_IVA_STATICDEP
322 $1 write 0x4A004304 0x$CM_MPU_STATICDEP
323
324 echo | tee -a $logfile
325 fi
326
327
328 # Test SR functions
329 if [ $all_tests = 1 ] || [ $tests = sr ]; then
330 for mod in MPU CORE MM
331 do
332 compare "dump sr $mod" "DUMP SR $mod" 0
333 done
334 compare "dump sr" "DUMP SR" 0
335 compare "show sr" "SHOW SR" 0
336 compare "show sr cfg" "SHOW SR CFG" 0
337 compare "show sr status" "SHOW SR STATUS" 1
338 fi
339
340
341 # Test CONTROL MODULE DUMP function(s)
342 if [ $all_tests = 1 ] || [ $tests = ctrlmod ]; then
343 for mod in ALL CORE CORE_PAD WKUP WKUP_PAD
344 do
345 compare "dump ctrlmod $mod" "DUMP CTRLMOD $mod" 0
346 done
347 compare "dump ctrlmod" "DUMP CTRLMOD" 0
348 echo | tee -a $logfile
349 fi
350
351
352 # Test TEMPERATURE function(s)
353 if [ $all_tests = 1 ] || [ $tests = temp ]; then
354 compare "show temp" "SHOW TEMP" 0
355 compare "show temp cpu" "SHOW TEMP CPU" 0
356 compare "show temp gpu" "SHOW TEMP GPU" 0
357 compare "show temp core" "SHOW TEMP CORE" 0
358 compare "show temp emif1" "SHOW TEMP EMIF1" 0
359 compare "show temp emif2" "SHOW TEMP EMIF2" 0
360 compare "show temp pcb" "SHOW TEMP PCB" 0
361 compare "show temp case" "SHOW TEMP CASE" 1
362 fi
363
364 # Test EXPORT function(s)
365 if [ $all_tests = 1 ] || [ $tests = export ]; then
366 compare "export ctt" "CTT DUMP" 0
367 compare "export ctt ctt.rd1" "CTT RD1" 1
368 rm -f *.rd1
369 fi
370
371 # Test ABB function(s)
372 if [ $all_tests = 1 ] || [ $tests = prcm ] || [ $tests = abb ]; then
373 compare "dump prcm abb" "DUMP PRCM ABB" 0
374 compare "show prcm abb" "SHOW PRCM ABB" 0
375 compare "show prcm abb cfg" "SHOW PRCM ABB CFG" 1
376 fi
377
378
379 # Test ABE function(s)
380 if [ $all_tests = 1 ] || [ $tests = abe ]; then
381 compare "dump abe" "ABE DUMP" 0
382 compare "show abe atc" "SHOW ABE ATC" 0
383 compare "show abe cfg" "SHOW ABE CFG" 0
384 compare "show abe" "SHOW ABE" 1
385 fi
386
387
388 # Test AUDIOIC function(s)
389 if [ $all_tests = 1 ] || [ $tests = audioic ]; then
390 compare "dump audioic" "DUMP AUDIOIC" 0
391 compare "show audioic cfg" "SHOW AUDIOIC CFG" 0
392 compare "show audioic gains" "SHOW AUDIOIC GAINS" 0
393 compare "read audioic 0x01" "READ AUDIOIC 0x01" 0
394 compare "read audioic ASICID" "READ AUDIOIC ASICID" 0
395 compare "write audioic 0x01 0x01" "WRITE AUDIOIC 0x01" 0
396 compare "write audioic ASICID 0x01" "WRITE AUDIOIC ASICID 0x01" 1
397 fi
398
399
400 # Test PMIC function(s)
401 if [ $all_tests = 1 ] || [ $tests = pmic ]; then
402 compare "dump pmic" "DUMP PMIC" 1
403 fi
404
405
406 # Test AUDIT function(s)
407 if [ $all_tests = 1 ] || [ $tests = audit ]; then
408 for opp in $opp_list
409 do
410 echo $opp > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
411 compare "audit dpll" "AUDIT DPLL $opp" 0
412 compare "audit dpll -d core" "AUDIT DPLL $opp CORE" 0
413 compare "audit dpll -o nom" "AUDIT DPLL $opp FORCED OPP NOM" 0
414 compare "audit dpll -o nom -d core" "AUDIT DPLL $opp CORE FORCED OPP NOM" 0
415 compare "audit dpll -o all -d all" "AUDIT DPLL $opp ALL" 0
416 compare "audit clkspeed" "AUDIT CLKSPEED $opp" 0
417 compare "audit clkspeed -k" "AUDIT CLKSPEED & KERNEL $opp" 0
418 done
419
420 compare "audit sysconfig" "AUDIT SYSCONFIG" 0 "audit sysconfig"
421 compare "audit io" "AUDIT IO" 0 "audit io"
422 compare "audit statdep" "AUDIT STATDEP" 0 "audit statdep"
423 compare "audit full" "AUDIT FULL" 0 "audit full"
424 compare "audit perf 2" "AUDIT PERF" 1 "audit perf 2"
425 rm -f performance_audit_summary.txt
426 fi
427
428
429 # Test TRACE function(s)
430 if [ $all_tests = 1 ] || [ $tests = trace ]; then
431 compare "trace perf -t 2 -s 1 -d 1" "TRACE PERF" 1
432 rm -f omap_performance_trace.dat
433 rm -f omap_performance_stats.txt
434 rm -f gnuplot_draw_perf_charts.plt
435 rm -f gnuplot_create_perf_jpg.plt
436 rm -f omap_performances_trace.jpg
437 fi
438
439
440 # Test HWOBS function(s)
441 if [ $all_tests = 1 ] || [ $tests = hwobs ]; then
442 compare "test hwobs zero" "HWOBS TEST ZERO (UNITIALIZED)" 0
443 compare "test hwobs one" "HWOBS TEST ONE (UNITIALIZED)" 0
444 compare "enable hwobs" "HWOBS TEST ENABLE (UNITIALIZED)" 0
445 compare "show hwobs cfg" "HWOBS CFG (UNITIALIZED)" 0
446 compare "setup hwobs prcm 0 CM2 0x10" "HWOBS SETUP PRCM 0 CM2 0X10 (UNITIALIZED)" 1
447 compare "setup hwobs pinmux WKUP" "HWOBS SETUP PINMUX WKUP" 0
448 compare "setup hwobs pinmux CORE_C2C" "HWOBS SETUP PINMUX CORE_C2C" 0
449 compare "setup hwobs pinmux ALL" "HWOBS SETUP PINMUX ALL" 0
450 compare "enable hwobs" "HWOBS TEST ENABLE" 1
451 compare "setup hwobs prcm 0 CM2 0x10" "HWOBS SETUP PRCM 0 CM2 0X10" 0
452 compare "setup hwobs mpuss 0x3" "HWOBS SETUP MPU 0x3" 0
453 compare "show hwobs cfg" "HWOBS CFG" 1
454 fi
455
456
457 echo | tee -a $logfile
458 echo "OMAPCONF Regression Test Results:" | tee -a $logfile
459 echo " Number of tests: $test_cpt" | tee -a $logfile
460 pct=$[$[$test_pass_cpt*100]/$test_cpt]
461 echo " Number of passing test(s): $test_pass_cpt ($pct%)" | tee -a $logfile
462 pct=$[100-$pct]
463 echo " Number of failing test(s): $test_fail_cpt ($pct%)" | tee -a $logfile
464 echo | tee -a $logfile
465 if [ $test_pass_cpt = $test_cpt ]; then
466 echo "All regression tests passed, congrats!!! :-)" | tee -a $logfile
467 else
468 echo "Boooh, $test_fail_cpt regression(s) detected!" | tee -a $logfile
469 fi
470 echo "cat $logfile for detailed log." | tee -a $logfile
471 echo
472
473 # Restore CPUFreq governor
474 echo $cpufreq_gov > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
475 echo omapconf_no_reg_test > /sys/power/wake_unlock
476
Something went wrong with that request. Please try again.