[Armadeus-commitlog] SF.net SVN: armadeus:[1346] trunk/target/test/test_fpga.sh
Brought to you by:
sszy
|
From: <ar...@us...> - 2009-06-16 13:30:01
|
Revision: 1346
http://armadeus.svn.sourceforge.net/armadeus/?rev=1346&view=rev
Author: artemys
Date: 2009-06-16 13:29:42 +0000 (Tue, 16 Jun 2009)
Log Message:
-----------
[TEST] Add interrupt test for FPGA
Modified Paths:
--------------
trunk/target/test/test_fpga.sh
Modified: trunk/target/test/test_fpga.sh
===================================================================
--- trunk/target/test/test_fpga.sh 2009-06-16 13:26:49 UTC (rev 1345)
+++ trunk/target/test/test_fpga.sh 2009-06-16 13:29:42 UTC (rev 1346)
@@ -15,23 +15,34 @@
source ./test_env.sh
FPGA_LOAD_DEV="/dev/fpgaloader"
-TEST_BITFILE=/tmp/led.bit
-load_apf9328()
+load_led_apf9328()
{
dd if=./data/fpga/blinking_led_apf9328_200k.bit of=$FPGA_LOAD_DEV
}
-load_apf27()
+load_led_apf27()
{
echo "I hope you have connected Pins 1 & 39 of J20 (power)"
dd if=./data/fpga/blinking_led_apf27_200k.bit of=$FPGA_LOAD_DEV
}
+load_button_apf9328()
+{
+ dd if=./data/fpga/wishbone_example_apf9328_200k.bit of=$FPGA_LOAD_DEV
+}
+
+load_button_apf27()
+{
+ echo "I hope you have connected Pins 1 & 39 of J20 (power)"
+ dd if=./data/fpga/wishbone_example_apf27_200k.bit of=$FPGA_LOAD_DEV
+}
+
+
test_fpga_load()
{
- show_test_banner "FPGA"
+ show_test_banner "FPGA loading"
modprobe fpgaloader
RES=$?
@@ -43,10 +54,10 @@
cat /proc/driver/fpga/loader
- execute_for_target load_apf9328 load_apf27
+ execute_for_target load_led_apf9328 load_led_apf27
if [ "$?" == 0 ]; then
- ask_user "Did you see the LED on FPGA ? (y/n)"
+ ask_user "Did you see the FPGA's LED blinking ? (y/n)"
if [ "$response" == "y" ]; then
echo_test_ok
fi
@@ -54,5 +65,34 @@
rm -f $TEST_BITFILE
}
+test_fpga_it()
+{
+ show_test_banner "FPGA interrupts"
+
+ execute_for_target load_button_apf9328 load_button_apf27
+ modprobe irq_ocore
+ modprobe gbutton
+ modprobe board_buttons
+
+ if [ "$?" != 0 ] ; then
+ echo "Some Modules failed to load"
+ exit_failed
+ fi
+ mknod /dev/button0 c 251 0
+
+ /usr/bin/testsuite/testbutton /dev/button0 &
+ PID=$!
+
+ if [ "$?" == 0 ]; then
+ ask_user "Please press FPGA button. Did you see something on the console ? (y/n)"
+ if [ "$response" == "y" ]; then
+ echo_test_ok
+ fi
+ fi
+ kill $PID
+ rm -f $TEST_BITFILE
+}
+
test_fpga_load
+test_fpga_it
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|