Permalink
Browse files

Initial commit of all the factory test scripts

This commit doesn't include the messy bitbake recipes, those will
be going through migration pains to OE current soon.
  • Loading branch information...
0 parents commit b2428d24641fbea6cbdb323379271d540044e748 mgrundy committed Jul 12, 2011
Showing with 8,915 additions and 0 deletions.
  1. +224 −0 bugprog-bmi/eeprom-rcS
  2. BIN bugtest-cam/files/camera-images/insertcamera.fb
  3. BIN bugtest-cam/files/camera-images/removecamera.fb
  4. BIN bugtest-cam/files/camera-images/startingcamera.fb
  5. BIN bugtest-cam/files/camera-images/startingtests.fb
  6. BIN bugtest-cam/files/camera-images/testingflash.fb
  7. BIN bugtest-cam/files/camera-images/testingleds.fb
  8. BIN bugtest-cam/files/camera/bugv4l.so
  9. +51 −0 bugtest-cam/files/camera/camtest.py
  10. +19 −0 bugtest-cam/files/camera/parse_videodev2.py
  11. +568 −0 bugtest-cam/files/camera/py_bugv4l.c
  12. BIN bugtest-cam/files/camera/py_bugv4l.o
  13. +392 −0 bugtest-cam/files/camera/py_eeprom.py
  14. +542 −0 bugtest-cam/files/camera/py_videodev2.c
  15. +31 −0 bugtest-cam/files/camera/test.py
  16. +194 −0 bugtest-cam/files/camtest.rcS
  17. BIN bugtest-lcd/files/lcdimages/blue.fb
  18. BIN bugtest-lcd/files/lcdimages/colorbars.fb
  19. BIN bugtest-lcd/files/lcdimages/green.fb
  20. BIN bugtest-lcd/files/lcdimages/red.fb
  21. +194 −0 bugtest-lcd/files/lcdtest.rcS
  22. +232 −0 bugtest-mem/files/memtest.rcS
  23. +12 −0 bugtest-vft/host/OTG Test Host Process.desktop
  24. +1 −0 bugtest-vft/host/README
  25. BIN bugtest-vft/host/buglabs.db
  26. +366 −0 bugtest-vft/host/bugmacprog
  27. +232 −0 bugtest-vft/host/bugtestmon
  28. +325 −0 bugtest-vft/host/miniterm.py
  29. +20 −0 bugtest-vft/host/otgmountwatch
  30. +5 −0 bugtest-vft/host/test.py
  31. +81 −0 bugtest-vft/host/verificationtest
  32. +1,344 −0 bugtest-vft/ramdisk/bugtest.sh
  33. +1,232 −0 bugtest-vft/ramdisk/campim.sh
  34. +1,225 −0 bugtest-vft/ramdisk/docktest.sh
  35. +1,234 −0 bugtest-vft/ramdisk/lcdpim.sh
  36. +192 −0 bugtest-vft/ramdisk/videopim.sh
  37. +199 −0 bugtest-vid/files/videotest.rcS
@@ -0,0 +1,224 @@
+#!/bin/sh
+
+# comment_block() {
+# ---------------------------------------------
+# Common settings
+# ---------------------------------------------
+HOSTNAME=PIM-PROGRAMMING
+VERSION=1.0
+
+hostname $HOSTNAME
+
+# ---------------------------------------------
+# Prints execution status.
+#
+# arg1 : Execution status
+# arg2 : Continue (0) or Abort (1) on error
+# ---------------------------------------------
+status ()
+{
+ if [ $1 -eq 0 ] ; then
+ echo "[SUCCESS]"
+ else
+ echo "[FAILED]"
+
+ if [ $2 -eq 1 ] ; then
+ echo "... System init aborted."
+ exit 1
+ fi
+ fi
+
+}
+
+# ---------------------------------------------
+# Get verbose
+# ---------------------------------------------
+echo ""
+echo " System initialization..."
+echo ""
+echo " Hostname : $HOSTNAME"
+echo " Filesystem : v$VERSION"
+echo ""
+echo " Kernel release : `uname -s` `uname -r`"
+echo " Kernel version : `uname -v`"
+echo ""
+
+
+# ---------------------------------------------
+# MDEV Support
+# (Requires sysfs support in the kernel)
+# ---------------------------------------------
+echo -n " Mounting /proc : "
+mount -n -t proc /proc /proc
+status $? 1
+
+echo -n " Mounting /sys : "
+mount -n -t sysfs sysfs /sys
+status $? 1
+
+echo -n " Mounting /dev : "
+mount -n -t tmpfs mdev /dev
+status $? 1
+
+echo -n " Mounting /dev/pts : "
+mkdir /dev/pts
+mount -t devpts devpts /dev/pts
+status $? 1
+
+echo -n " Enabling hot-plug : "
+echo "/sbin/mdev" > /proc/sys/kernel/hotplug
+status $? 0
+
+echo -n " Populating /dev : "
+#mkdir -p /dev/input
+#mkdir -p /dev/snd
+#mkdir -p /dev/shm
+/etc/init.d/udev start
+mdev -s
+status $? 0
+
+
+# ---------------------------------------------
+# Mount the default file systems
+# ---------------------------------------------
+echo -n " Mounting other filesystems : "
+mount -a
+status $? 0
+umount /media/mm*
+
+# ---------------------------------------------
+# Set PATH
+# ---------------------------------------------
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
+
+# end comment block}
+
+# ---------------------------------------------
+# Done!
+# ---------------------------------------------
+echo ""
+echo "System initialization complete."
+
+#mount -t vfat /dev/mmcblk0p1 /mnt/mmc1
+#mount -t vfat /dev/mmcblk1p1 /mnt/mmc2
+
+#echo "----------------------------------------"
+#echo " Making device nodes for EEPROMs"
+#mknod /dev/at24c_eeprom c 249 0
+#mknod /dev/at25_eeprom c 250 0
+#echo "----------------------------------------"
+#echo " Disabling FB Timeout."
+#echo "----------------------------------------"
+#echo 0 > /sys/devices/platform/omapfb/sleep_timeout
+
+
+prompt()
+{
+ tvar=L
+ while [ "$tvar" != "y" ] &&
+ [ "$tvar" != "Y" ] &&
+ [ "$tvar" != "n" ] &&
+ [ "$tvar" != "N" ] &&
+ [ "$tvar" != "r" ] &&
+ [ "$tvar" != "R" ]; do
+
+ read -n1 tvar
+
+done
+export $1=$tvar
+}
+# main while loop
+while [ 1 ]
+do
+ echo ===========================================================
+ echo Select the module type you would like to program
+ echo
+ echo "1) Video Module"
+ echo "2) LCD Module"
+ echo "3) Camera Module"
+ echo
+ echo ===========================================================
+ read modtype
+
+ if [ "$modtype" == "1" ]; then
+ modargs="1 0x01 0x0D"
+ slot=1
+ elif [ "$modtype" == "2" ]; then
+ modargs="1 0x01 0x03"
+ slot=1
+ elif [ "$modtype" == "3" ]; then
+ modargs="0 0x01 0x0F"
+ slot=0
+ else
+ continue
+ fi
+
+
+ while [ 1 ]
+ do
+
+ echo ============================================================
+ echo Place the next module into the slot for programming
+ echo ============================================================
+ # wait for them to insert the module
+ while [ 1 ]
+ do
+ if [ ! -e /sys/class/bmi/bmi-${slot}/bmi-dev-${slot} ]; then
+ sleep 1;
+ else
+ break;
+ fi
+ done
+
+ #When you believe in things that you don't understand
+ #Then you suffer, Superstition ain't the way
+ # but we'll sleep for a second here anyway
+ sleep 1
+
+ # eeprom-update gets passed the slot number vendor and mod type
+ python /usr/bin/eeprom-update $modargs
+ ret=$?
+ if [ "$ret" == "2" ];then
+ echo ===========================================================
+ echo " eeprom programming failed!"
+ echo
+ echo The module might not be plugged in all the way. If this
+ echo continues, then reboot the bug and try programming again
+ echo
+ echo " Press Enter to continue"
+ echo ===========================================================
+ read msg
+ elif [ "$ret" == "1" ];then
+ echo ===========================================================
+ echo Argh, some stupid programming error happened. Call Grundy
+ echo ===========================================================
+ read msg
+ exit
+ fi
+ echo ============================================================
+ echo Module eeprom programming complete. Please remove the module
+ echo ============================================================
+ # wait for them to pull the module
+ while [ 1 ]
+ do
+ if [ -e /sys/class/bmi/bmi-${slot}/bmi-dev-${slot} ]; then
+ sleep 1;
+ else
+ break;
+ fi
+ done
+
+
+# echo ===========================================================
+# echo " Do you want to program another module of this type? (y/n)"
+# echo ===========================================================
+# prompt user
+# if [ "$user" = "y" ];then
+# continue
+# else
+# break
+# fi
+
+ done
+done
+
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,51 @@
+import bugv4l as bg
+import os
+
+
+os.system("cp /usr/images/testingflash.fb /dev/fb0")
+
+# open the bug camera as a 640x480 image
+bg.open(dev_code=bg.V4L2_DEVNODE_RESIZER,
+ raw_fmt=bg.format(2048,1536, bg.V4L2_PIX_FMT_YUYV),
+ resizer_fmt=bg.format(640, 480))
+
+bg.set_red_led(False)
+
+bg.set_ctrl(bg.V4L2_CID_FLASH_STROBE, 1) # turn on flash LED strobe
+os.system("sleep 3")
+
+bg.set_ctrl(bg.V4L2_CID_FLASH_STROBE, 0) # turn off flash LED strobe
+
+os.system("cp /usr/images/testingleds.fb /dev/fb0")
+
+bg.set_red_led(True)
+os.system("sleep 2")
+bg.set_red_led(False)
+bg.set_green_led(True)
+os.system("sleep 2")
+bg.set_green_led(False)
+
+
+os.system("cp /usr/images/startingcamera.fb /dev/fb0")
+
+# start the image stream
+bg.start()
+
+# capture some image
+for i in range(50):
+ yuv_img = bg.grab()
+ rgb_img = bg.yuv2rgba(yuv_img, downby2=True);
+ filename = "fb.raw"
+ f = open(filename, "w");
+ f.write(rgb_img);
+ f.close()
+ os.system("cp fb.raw /dev/fb0")
+
+
+ print("Wrote image %d" % i)
+
+# switch to full res
+
+bg.stop()
+bg.close()
+
@@ -0,0 +1,19 @@
+import sys
+
+f= open(sys.argv[1], "r")
+g= open("py_videodev2.c", "w")
+
+g.write("void add_videodev2_defines(PyObject *m) {\n")
+
+for line in f:
+ words = line.split()
+ if(len(words) > 1 and words[0] == "#define"):
+ if(words[1][0] == "_"): continue
+ if(words[1].find("(")>=0): continue
+ if(words[1].find("OLD")>=0): continue
+
+ g.write(' PyModule_AddObject(m, "%s", (PyObject *) PyInt_FromLong(%s));\n' % (words[1], words[1]))
+
+g.write("}\n")
+g.close()
+f.close()
Oops, something went wrong.

0 comments on commit b2428d2

Please sign in to comment.