Commit b44f31c453257d93a3e94625cdf719f5fed5a34b

Authored by 남새힘
1 parent 540d18e731
Exists in fhd

buildroot: jig 변경 및 퓨징스크립트 변경

buildroot/buildroot-2016.08.1/board/falinux/prime_oven/rootfs_overlay/root/.falinux/mk-emmc-fusing.sh
... ... @@ -14,6 +14,7 @@ PART4=p4
14 14 FNAME_UBOOT="u-boot.imx"
15 15 FNAME_LOGO="init.bmp"
16 16 FNAME_DTB="imx6s-prime-oven.dtb"
  17 +FNAME_JIG="imx6s-prime-oven_jig.dtb"
17 18 FNAME_KERNEL="uImage"
18 19 FNAME_FSCPIO="ramdisk-prime_oven.uboot"
19 20 FNAME_RFS="rootfs.tar"
... ... @@ -126,6 +127,7 @@ function run_copy_image()
126 127 cp -v ${SD_MOUNT_PATH_P1}/boot/${FNAME_UBOOT} ${EMMC_MOUNT_PATH_P1}/boot/
127 128 cp -v ${SD_MOUNT_PATH_P1}/boot/${FNAME_LOGO} ${EMMC_MOUNT_PATH_P1}/boot/
128 129 cp -v ${SD_MOUNT_PATH_P1}/boot/${FNAME_DTB} ${EMMC_MOUNT_PATH_P1}/boot/
  130 + cp -v ${SD_MOUNT_PATH_P1}/boot/${FNAME_JIG} ${EMMC_MOUNT_PATH_P1}/boot/
129 131 cp -v ${SD_MOUNT_PATH_P1}/boot/${FNAME_KERNEL} ${EMMC_MOUNT_PATH_P1}/boot/
130 132 cp -v ${SD_MOUNT_PATH_P1}/boot/${FNAME_FSCPIO} ${EMMC_MOUNT_PATH_P1}/boot/
131 133 run_copy_rootfs
... ...
buildroot/buildroot-2016.08.1/board/falinux/prime_oven/rootfs_overlay/root/.falinux/prime_jig/prime_jig.sh
... ... @@ -9,14 +9,30 @@ C_BOLD='\033[1m'
9 9  
10 10  
11 11 PING_ADDR="192.168.10.1"
12   -MAC_ADDR=""
13   -ETH_NAME="eth0"
14 12 SUMMARY_PATH="/tmp/list"
15   -JIG_PATH="/root/.falinux/prime_jig/"
16   -RESULT_LOG="${JIG_PATH}result_log"
17   -THREAD_FUNC_SCRIPT="${JIG_PATH}thread_func.sh"
18   -FRAM_TEST_APP="${JIG_PATH}fram_test"
  13 +JIG_PATH="/root/.falinux/prime_jig"
  14 +RESULT_LOG="${JIG_PATH}/result_log"
  15 +THREAD_FUNC_SCRIPT="${JIG_PATH}/thread_func.sh"
  16 +FRAM_TEST_APP="${JIG_PATH}/fram_test"
  17 +
19 18 COMPLETE_TEST_NAME=""
  19 +RUN_PROC=0
  20 +
  21 +###### PRIME OVEN ######
  22 +
  23 +IFACE_ETH0="eth0"
  24 +ETH0_I2CCH="2"
  25 +MAC_ADDR=""
  26 +
  27 +USB_SDA="/dev/sda"
  28 +
  29 +USB_RS485="/dev/ttyUSB0"
  30 +SERIAL_RS485="/dev/ttymxc2"
  31 +
  32 +RTC_DEV="/dev/rtc0"
  33 +
  34 +MANUAL_TEST_LIST=()
  35 +FIRST_MENU+=("JIG MANUAL")
20 36  
21 37 function Init()
22 38 {
... ... @@ -72,21 +88,31 @@ function test_mac()
72 88 echo -e "${C_LCYAN}### [${FUNCNAME}] ###${C_NC}"
73 89 echo ""
74 90  
75   - COMPLETE_TEST_NAME=${FUNCNAME}
  91 + COMPLETE_TEST_NAME="${FUNCNAME}-${1}"
76 92  
  93 + IFACE="$1"
  94 + I2C_CH="$2"
77 95  
78 96 for i in 0xfa 0xfb 0xfc 0xfd 0xfe 0xff
79 97 do
80 98 if [ "$i" == "0xfa" ]; then
81   - EEPROM_MAC=$(i2cget -f -y 1 0x50 $i b | sed 's/0x//')
  99 + i2cget -f -y ${I2C_CH} 0x50 $i b
  100 + if [ "$?" != 0 ]; then
  101 + return -1
  102 + fi
  103 + EEPROM_MAC=$(i2cget -f -y ${I2C_CH} 0x50 $i b | sed 's/0x//')
82 104 else
83   - EEPROM_MAC+=$(i2cget -f -y 1 0x50 $i b | sed 's/0x/:/')
  105 + i2cget -f -y ${I2C_CH} 0x50 $i b
  106 + if [ "$?" != 0 ]; then
  107 + return -1
  108 + fi
  109 + EEPROM_MAC+=$(i2cget -f -y ${I2C_CH} 0x50 $i b | sed 's/0x/:/')
84 110 fi
85 111 done
86 112  
87 113 MAC_ADDR="${EEPROM_MAC^^}"
88 114  
89   - ETH_MAC=$(ifconfig | grep eth0 | awk {'print $5'})
  115 + ETH_MAC=$(ifconfig ${IFACE} | grep ${IFACE} | awk {'print $5'})
90 116  
91 117 if [ "${EEPROM_MAC^^}" = "${ETH_MAC^^}" ]; then
92 118 return $?
... ... @@ -143,7 +169,7 @@ function test_ethernet()
143 169 sleep 1
144 170 done
145 171  
146   - udhcpc -i eth0 -n -q
  172 + udhcpc -i ${IFACE} -n -q
147 173 if [ "$?" != 0 ]; then
148 174 return -1
149 175 fi
... ... @@ -205,7 +231,7 @@ function test_touch()
205 231 return 0
206 232 }
207 233  
208   -BACK_LIGHT="/sys/class/backlight/backlight_lvds.19/brightness"
  234 +BACK_LIGHT="/sys/class/backlight/backlight_lvds.21/brightness"
209 235 function test_lcd()
210 236 {
211 237 echo ""
... ... @@ -215,8 +241,9 @@ function test_lcd()
215 241 COMPLETE_TEST_NAME=${FUNCNAME}
216 242  
217 243 # TODO Test
218   -
219   - fb-test
  244 +
  245 + fb-test
  246 + fb-test -f 2
220 247 if [ "$?" != 0 ]; then
221 248 return -1
222 249 fi
... ... @@ -267,7 +294,7 @@ function test_encoder()
267 294 return $?
268 295 }
269 296  
270   -WAV_FILE="${JIG_PATH}opening.wav"
  297 +WAV_FILE="${JIG_PATH}/opening.wav"
271 298 function test_audio()
272 299 {
273 300 echo ""
... ... @@ -286,22 +313,32 @@ function test_audio()
286 313 return $?
287 314 }
288 315  
289   -function test_usb_storage()
  316 +function test_storage()
290 317 {
291 318 echo ""
292 319 echo -e "${C_LCYAN}### [${FUNCNAME}] ###${C_NC}"
293 320 echo ""
294 321  
295   - COMPLETE_TEST_NAME=${FUNCNAME}
  322 + COMPLETE_TEST_NAME="${FUNCNAME}-${1}"
296 323  
297 324 # TODO Test
298 325  
299   - ls /dev/sda
  326 + ls $1
300 327 if [ "$?" != "0" ]; then
301 328 return -1
302 329 fi
303 330  
304   - ls /dev/sdb
  331 + DEVICE_TYPE=$(readlink /sys/class/block/$(echo ${1} | cut -d'/' -f 3))
  332 + echo ${DEVICE_TYPE} | grep usb
  333 + if [ "$?" == "0" ]; then
  334 + COMPLETE_TEST_NAME="test_usb_host-${1}"
  335 + fi
  336 +
  337 + echo ${DEVICE_TYPE} | grep sata
  338 + if [ "$?" == "0" ]; then
  339 + COMPLETE_TEST_NAME="test_ssd-${1}"
  340 + fi
  341 +
305 342 return $?
306 343 }
307 344  
... ... @@ -323,69 +360,45 @@ function test_fram()
323 360 return $?
324 361 }
325 362  
326   -function test_tty()
327   -{
  363 +function write_uart() {
  364 + while [ 1 ]
  365 + do
  366 + echo "${2}" > ${1}
  367 + sleep 0.1
  368 + done
  369 +}
  370 +
  371 +function test_rs232_pair() {
328 372 echo ""
329 373 echo -e "${C_LCYAN}### [${FUNCNAME}] ###${C_NC}"
330 374 echo ""
331 375  
332   - COMPLETE_TEST_NAME=${FUNCNAME}
  376 + COMPLETE_TEST_NAME="${FUNCNAME}-${1}-${2}"
333 377 WRITE_MSG="FALINUX_TTY"
334 378  
335 379 # TODO Test
336 380  
337   - DEV_TTY_PATH="/dev/ttymxc1"
  381 + DEV_RS232_WRITE_PATH="$1"
  382 + DEV_RS232_READ_PATH="$2"
338 383  
339   - ${THREAD_FUNC_SCRIPT} tty ${DEV_TTY_PATH} ${WRITE_MSG} &
340   - read -s -t 5 READ_MSG < ${DEV_TTY_PATH}
341   - if [ "$?" != 0 ]; then
342   - return -1
343   - fi
344   - echo "Read: [${READ_MSG}]"
345   -
346   - if [ "${WRITE_MSG}" != "${READ_MSG}" ]; then
347   - return -1
348   - fi
349   -
350   - return $?
351   -}
352   -
353   -function test_rs485()
354   -{
355   - echo ""
356   - echo -e "${C_LCYAN}### [${FUNCNAME}] ###${C_NC}"
357   - echo ""
358   -
359   - COMPLETE_TEST_NAME=${FUNCNAME}
  384 + stty -F ${DEV_RS232_WRITE_PATH} speed 115200 cs8
  385 + stty -F ${DEV_RS232_READ_PATH} speed 115200 cs8
360 386  
361   - # TODO Test
  387 + write_uart ${DEV_RS232_WRITE_PATH} ${WRITE_MSG} &
362 388  
363   - DEV_RS485_PATH1="/dev/ttymxc2"
364   - DEV_RS485_PATH2="/dev/ttymxc3"
  389 + WRITE_THREAD_PID=$!
365 390  
366   - # Read : RS485_1, Write : RS485_2
367   - RS485_WRITE_MSG="FALINUX_TEST:"${DEV_RS485_PATH2}
368   - ${THREAD_FUNC_SCRIPT} rs485 ${DEV_RS485_PATH2} ${RS485_WRITE_MSG} &
369   - read -s -t 5 RS485_READ_MSG < ${DEV_RS485_PATH1}
  391 + read -s -t 5 READ_MSG < ${DEV_RS232_READ_PATH}
370 392 if [ "$?" != 0 ]; then
  393 + kill ${WRITE_THREAD_PID} > /dev/null 2>&1
371 394 return -1
372 395 fi
373   - echo "Read: [${RS485_READ_MSG}]"
374   -
375   - if [ "${RS485_WRITE_MSG}" != "${RS485_READ_MSG}" ]; then
376   - return -1
377   - fi
  396 + echo "Read: [${READ_MSG}]"
378 397  
379   - # Read : RS485_2, Write : RS485_1
380   - RS485_WRITE_MSG="FALINUX_TEST:"${DEV_RS485_PATH1}
381   - ${THREAD_FUNC_SCRIPT} rs485 ${DEV_RS485_PATH1} ${RS485_WRITE_MSG} &
382   - read -s -t 5 RS485_READ_MSG < ${DEV_RS485_PATH2}
383   - if [ "$?" != 0 ]; then
384   - return -1
385   - fi
386   - echo "Read: [${RS485_READ_MSG}]"
  398 +
  399 + kill ${WRITE_THREAD_PID} > /dev/null 2>&1
387 400  
388   - if [ "${RS485_WRITE_MSG}" != "${RS485_READ_MSG}" ]; then
  401 + if [ "${WRITE_MSG}" != "${READ_MSG}" ]; then
389 402 return -1
390 403 fi
391 404  
... ... @@ -407,60 +420,136 @@ function test_default()
407 420 return $?
408 421 }
409 422  
410   -function main()
411   -{
  423 +function jig_main() {
412 424 echo ""
413 425 echo -e " ### Start DEV Test - [${FUNCNAME}] ###"
414 426 echo ""
415 427  
416 428 Init
417 429  
418   - test_mac
419   - error_check $? ${COMPLETE_TEST_NAME}
  430 + for test_name in "${MANUAL_TEST_LIST[@]}"; do
  431 + ${test_name}
  432 + error_check $? ${COMPLETE_TEST_NAME}
  433 + done
  434 +
  435 + summary
  436 + save_result
  437 +}
420 438  
421   - test_ethernet ${ETH_NAME}
422   - error_check $? ${COMPLETE_TEST_NAME}
  439 +function init_manual() {
  440 + rm -f ${RESULT_LOG}
  441 + clear
  442 + MANUAL_TEST_LIST+=("test_mac ${IFACE_ETH0} ${ETH0_I2CCH}")
  443 + MANUAL_TEST_LIST+=("test_ethernet ${IFACE_ETH0}")
  444 + MANUAL_TEST_LIST+=("test_rtc ${RTC_DEV}")
  445 + MANUAL_TEST_LIST+=("test_rs232_pair ${SERIAL_RS485} ${USB_RS485}")
  446 + MANUAL_TEST_LIST+=("test_rs232_pair ${USB_RS485} ${SERIAL_RS485}")
  447 +
  448 + MANUAL_TEST_LIST+=("test_touch")
  449 + MANUAL_TEST_LIST+=("test_lcd")
  450 + MANUAL_TEST_LIST+=("test_encoder")
  451 + MANUAL_TEST_LIST+=("test_audio")
  452 + MANUAL_TEST_LIST+=("test_storage ${USB_SDA}")
  453 + MANUAL_TEST_LIST+=("test_fram")
  454 +}
423 455  
424   - test_rtc
425   - error_check $? ${COMPLETE_TEST_NAME}
  456 +function print_first_menu() {
  457 + TEST_NUM=1
  458 + for tests in "${FIRST_MENU[@]}"; do
  459 + echo -e "${C_LGREEN}${TEST_NUM}. ${tests}${C_NC}"
  460 + TEST_NUM=$(( ${TEST_NUM} + 1 ))
  461 + done
426 462  
427   - test_touch
428   - error_check $? ${COMPLETE_TEST_NAME}
  463 + echo -e "${C_LRED}${TEST_NUM}. EXIT${C_NC}"
429 464  
430   - test_lcd
431   - error_check $? ${COMPLETE_TEST_NAME}
  465 + read -p "Select Test : " -e TEST_NUMBER
432 466  
433   - test_encoder
434   - error_check $? ${COMPLETE_TEST_NAME}
  467 + return ${TEST_NUMBER}
  468 +}
435 469  
436   - test_audio
437   - error_check $? ${COMPLETE_TEST_NAME}
  470 +function print_manual() {
  471 + TEST_NUM=1
  472 + for names in "${MANUAL_TEST_LIST[@]}"; do
  473 + echo -e "${C_LGREEN}${TEST_NUM}. ${names}${C_NC}"
  474 + TEST_NUM=$(( ${TEST_NUM} + 1))
  475 + done
438 476  
439   - test_usb_storage
440   - error_check $? ${COMPLETE_TEST_NAME}
  477 + echo -e "${C_LRED}${TEST_NUM}. BACK${C_NC}"
  478 + TEST_NUM=$(( ${TEST_NUM} + 1))
  479 + echo -e "${C_LRED}${TEST_NUM}. EXIT${C_NC}"
441 480  
442   - test_fram
443   - error_check $? ${COMPLETE_TEST_NAME}
  481 + read -p "Select Test : " -e OUTPUT_NUM
444 482  
445   - test_tty
446   - error_check $? ${COMPLETE_TEST_NAME}
447 483  
448   - test_rs485
449   - error_check $? ${COMPLETE_TEST_NAME}
  484 + manual_test_proc ${OUTPUT_NUM}
  485 +
  486 + return 0
  487 +}
450 488  
  489 +function manual_test_proc() {
  490 + if [ "${1}" == "" ]; then
  491 + echo -e "${C_LRED} Select Correct Number ${C_NC}"
  492 + return
  493 + fi
  494 + ARRAY_NUM=$(( ${1} - 1 ))
  495 + if [ ${ARRAY_NUM} -eq ${#MANUAL_TEST_LIST[@]} ]; then
  496 + MANUAL_JIG=0
  497 + fi
  498 + if [ ${ARRAY_NUM} -eq $(( ${#MANUAL_TEST_LIST[@]} + 1)) ]; then
  499 + exit
  500 + fi
  501 + Init
  502 + ${MANUAL_TEST_LIST[${ARRAY_NUM}]}
  503 + error_check $? ${COMPLETE_TEST_NAME}
451 504 summary
452 505 save_result
453 506 }
454 507  
455   -function test_func()
456   -{
457   - echo ""
458   - echo -e " ### TEST Func - [${FUNCNAME}] ###"
459   - echo ""
460   -
461   - test_encoder
462   - error_check $? ${COMPLETE_TEST_NAME}
  508 +
  509 +function read_key_event() {
  510 + for time in $(seq 3 -1 1); do
  511 + clear
  512 + read -p "Press Any Key : ${time}" -t 1 -n 1 KEYDATA
  513 + if [ "${KEYDATA}" != "" ]; then
  514 + RUN_PROC=1
  515 + break
  516 + fi
  517 + done
  518 +}
  519 +
  520 +function proc_main() {
  521 + if [ ${RUN_PROC} -eq 0 ]; then
  522 + clear
  523 + jig_main
  524 + else
  525 + while [ true ]; do
  526 + echo -e ""
  527 + echo -e "${C_BOLD}${C_LCYAN} MANAUL TEST ${C_NC}"
  528 + print_first_menu
  529 + case "$?" in
  530 + 1)
  531 + echo -e "${C_BOLD}${C_LCYAN} MANAUL TEST ${C_NC}"
  532 + MANUAL_JIG=1
  533 + while [ true ]; do
  534 + print_manual
  535 + if [ "${MANUAL_JIG}" == "0" ]; then
  536 + break
  537 + fi
  538 + done
  539 + ;;
  540 + 2)
  541 + exit
  542 + ;;
  543 + *)
  544 + echo -e "${C_LRED} Select Correct Number ${C_NC}"
  545 + ;;
  546 +
  547 + esac
  548 + done
  549 + fi
463 550 }
464 551  
465 552  
466   -main
  553 +init_manual
  554 +read_key_event
  555 +proc_main
... ...