Commit 78cb5297 authored by Benoit Rat's avatar Benoit Rat

alpha-pts: updates for v3.3 HW, adding SFP check

parent dd955562
......@@ -105,6 +105,21 @@ load_ask2run()
fi
}
waittime()
{
timeout=$1
i=0
while [ $i -lt $timeout ]; do
printf "."
sleep 1
i=`expr $i + 1`
done
echo ""
}
#user_echoasking type question tagname
#output
# ans= is the answer selected
......
......@@ -24,20 +24,35 @@ ret0=$?
printf "MAC="$(ifconfig | grep 'eth0' | tr -s ' ' | cut -d ' ' -f5)"\n"
ret1=$?
ver="$(shw_ver -a)"
ret2=$?
printf "shw_ver=%s\n" "$ver"
printf "printing md5sum the loading file:\n"
md5sum "$(which load-virtex)"
ret2=$?
md5sum "$(which load-lm32)"
ret3=$?
md5sum /wr/lib/firmware/8ports_mb.bin
md5sum "$(which load-lm32)"
ret4=$?
md5sum /wr/lib/firmware/rt_cpu.bin
md5sum "$(which shw_ver)"
ret5=$?
md5sum "$(which shw_tool)"
ret6=$?
md5sum "$(which wrs-iftool)"
ret7=$?
md5sum ${APTS_HDL_18P}
ret8=$?
md5sum ${APTS_HDL_08P}
ret9=$?
md5sum ${APTS_FW_RTCPU}
ret10=$?
printf "printing md5sum of the binaries:\n"
md5sum bin/*
ret6=$?
ret11=$?
exit_multierr $ret0 $ret1 $ret2 $ret3 $ret4 $ret5 $ret6
exit_multierr $ret0 $ret1 $ret2 $ret3 $ret4 $ret5 $ret6 $ret7 $ret8 $ret9 $ret10 $ret11
......@@ -20,16 +20,21 @@
printf "======: $0\n"
. 000-functions.sh
exit_multierr 0
#First loading the correct firmwares:
load-virtex /wr/lib/firmware/8ports_mb.bin
load-lm32 /wr/lib/firmware/rt_cpu.bin
load-virtex ${APTS_HDL_18P}
load-lm32 ${APTS_FW_RTCPU}
led_pattern="green, orange, yellow, none"
user_echoasking "y/N" "Ready for the led pattern? (${led_pattern})" "ready"
shw_tool --led
user_echoasking "y/N" "Did you see the LEDs moving" "LEDS"
user_echoasking "y/N" "Did you see the LEDs pattern (${led_pattern})" "LEDS"
ret0=-$?
if [ $ans == "n" ]; then
read -p "Write the failing LED: " ans
echo "$ans"
fi
exit_multierr $ret0
......@@ -19,27 +19,37 @@
printf "======: $0\n"
. 000-functions.sh
pwm_module=/wr/lib/modules/at91_softpwm.ko
if [[ -f $pwm_module ]]; then
insmod $pwm_module &> /dev/null
else
echo "$pwm_module not found"
fi
#First load the correct firmwares:
load-virtex ${APTS_HDL_18P}
load-lm32 ${APTS_FW_RTCPU}
speed=100
while [ ${speed} -gt 30 ]; do
echo "$speed"
${APTS_SWITCH_DIR}/bin/shw_tool --fan ${speed}
echo "FAN1 @ $speed %"
shw_tool --fan -m 1 ${speed}
sleep 1
speed=$(expr $speed - 10)
done
shw_tool --fan -m 1 0
ans=""
user_echoasking "y/n" "Did you hear the speed of FAN 1 decrease" "fan_speed_up"
ret0=-$?
speed=100
while [ ${speed} -gt 30 ]; do
echo "FAN2 @ $speed %"
shw_tool --fan -m 2 ${speed}
sleep 1
speed=$(expr $speed - 10)
done
shw_tool --fan -m 2 0
ans=""
user_echoasking "y/n" "Did you hear the speed of FAN decrease" "fan_speed_up"
user_echoasking "y/n" "Did you hear the speed of FAN 2 decrease" "fan_speed_up"
ret0=-$?
shw_tool --fan 80
if [ $ans == "n" ]; then
user_echoasking "y/n" "Does the FAN is working?" "fan_enable"
user_echoasking "y/n" "Does one of the FAN is working?" "fan_enable"
ret1=-$?
if [ $ans == "n" ]; then
echo "WARNING: NO FAN DETECTED! YOU SHOULD STOP THIS TEST BEFORE OVERHEATING YOUR FPGA"
......
......@@ -7,8 +7,6 @@
##
## Future Improvements:
## - There are no communications between the FPGA and CPU
## - The test should be divided in first a QDRII check, then a temperature stress
#
##
##
## Authors:
......@@ -26,30 +24,32 @@
printf "======: $0\n"
. 000-functions.sh
#Check version to load or not the QDRII test
ver=$(shw_ver -p)
maxver="3.3"
res=$(echo | awk -v n1=$ver -v n2=$maxver '{if (n1<n2) printf("1\n"); else printf("0\n");}')
if [ "x${res}" == "x1" ]; then
#First loading the correct firmwares:
load-virtex ${APTS_SWITCH_DIR}/bin/fpga_qdr2temp.bit
#Setting the fan at 70%
${APTS_SWITCH_DIR}/bin/shw_tool --fan 60
#First loading the correct firmwares:
load-virtex ${APTS_SWITCH_DIR}/bin/fpga_qdr2temp.bit
timeout=10 #Timeout before reading
timeout=3 #Timeout before reading
printf "FPGA QDRII stress and temperature monitoring (${timeout}s): "
waittime $timeout
#Setting the fan at 70%
${APTS_SWITCH_DIR}/bin/shw_tool --fan 60
printf "FPGA QDRII stress and temperature monitoring (${timeout}s): "
i=0
while [ $i -lt $timeout ]; do
printf "."
sleep 1
i=`expr $i + 1`
done
echo ""
user_echoasking "y/n" "Do you see the 3 + 1 last LEDs on the miniBP?" "LED QDRII"
ret0=-$?
if [ $ans == "n" ]; then
user_echoasking "bin" "LED pattern?" "LED patterm QDRII"
fi;
exit_multierr $ret0
user_echoasking "y/n" "Do you see the 3 + 1 last LEDs on the miniBP?" "LED QDRII"
ret0=-$?
if [ $ans == "n" ]; then
user_echoasking "bin" "LED pattern?" "LED patterm QDRII"
fi;
exit_multierr $ret0
else
echo "OK: No QDRII mounted for v$ver (>=$maxver)"
exit_multierr 0
fi
\ No newline at end of file
#!/bin/sh
## Finally test the TFTP connexion and flash the default firmwares
## Test TFTP connexion and flash the default firmwares
##
## The TFTP connexion might have been used previously but with
## this test we ensure that it correctly work
## Check the tftp connection and then flash the firmware
##
## Linux devices:
## wrs# cat /proc/mtd
......@@ -29,52 +28,44 @@
printf "======: $0\n"
. 000-functions.sh
bin_dir="/tmp"
bin_dir="/alpha-pts/firmwares"
ret0=1
ret1=1
ret2=1
ret3=1
printf "Flashing at91bootstrap and barebox on dataflash: \n"
printf "Checking TFTP files...: \n"
ret=0
checkLoadTFTP at91bootstrap.bin 1 ${bin_dir}
checkLoadTFTP barebox.bin 1 ${bin_dir}
if [ $ret -eq "0" ]; then
cat ${bin_dir}/at91bootstrap.bin > /dev/mtd4
ret0=-$?
dd bs=33792 seek=1 if=${bin_dir}/barebox.bin of=/dev/mtd4 #33792<=>0x8400<=>32ePages<=>32*(1024+32) => 0x8000 without header
ret1=-$?
printf "Done\n"
fi
bin_dir="/alpha-pts/firmwares/"
printf "Flashing kernel on nandflash: \n"
if [[ -f ${bin_dir}/zImage ]]; then
# Flashing kernel (without erasing barebox env)
flash_eraseall /dev/mtd0 &> /dev/null
nandwrite --pad /dev/mtd0 ${bin_dir}/zImage
nandwrite -m -p -a /dev/mtd0 ${bin_dir}/zImage
ret2=-$?
rm ${bin_dir}/zImage
printf "Done\n"
else
printf "${bin_dir}/zImage not found\n"
fi
printf "Flashing Filesystem on nandflash: \n"
if [ -f ${bin_dir}/wrs-image.jffs2.img ]; then
rootfsjffs2=${bin_dir}/wrs-image.jffs2.img
if [ -f $rootfsjffs2 ]; then
# Flashing whole partiton for FS.
flash_eraseall /dev/mtd1 &> /dev/null
nandwrite --pad /dev/mtd1 ${bin_dir}/wrs-image.jffs2.img
flash_eraseall /dev/mtd1 &> /dev/null
nandwrite -m -p -a /dev/mtd1 $rootfsjffs2
ret3=-$?
rm ${bin_dir}/wrs-image.jffs2.img
printf "Done\n"
else
printf "${bin_dir}/wrs-image.jffs2.img not found\n"
printf "$rootfsjffs2 not found\n"
fi
......
......@@ -3,11 +3,6 @@
##
## Read the different temperature sensor at the end of the test
##
## Future Improvements:
## - There are no communications between the FPGA and CPU, the test s
## should read automatically temperature.
##
##
## Authors:
## - Benoit Rat (Seven Solutions, www.sevensols.com)
##
......@@ -23,31 +18,25 @@
printf "======: $0\n"
. 000-functions.sh
#First loading the correct firmwares:
load-virtex ${APTS_HDL_18P}
load-lm32 ${APTS_FW_RTCPU}
alarm;
${APTS_SWITCH_DIR}/bin/shw_tool --fan 40
${APTS_SWITCH_DIR}/bin/shw_tool --fan 80
user_echoasking "y/n" "Do you see temperature message on UART?" "UART temp"
echo "Display 3 times the temperatures"
shw_tool --mon -l 3
user_echoasking "y/n" "Do you see all temperature message on UART?" "UART temp"
ret0=-$?
if [ $ans == "y" ]; then
user_echoasking "num" "Number of iteration. " "num-iter"
user_echoasking "num" "System Monitor Temp. " "temp-sysmon"
user_echoasking "num" "System Monitor Temp Max. " "temp-sysmon"
user_echoasking "num" "Temp. Sensor Power PLLs & LDOs:" "tmp-plls"
user_echoasking "num" "Temp. Sensor Power Supply Left:" "tmp-powsupL"
user_echoasking "num" "Temp. Sensor Power Supply Right:" "tmp-powsupR"
user_echoasking "num" "Temp. Below FPGA:" "temp-fpga"
if [ $ans == "n" ]; then
read -p "Write the name of the sensors that doesn't work: " ans
echo "$ans"
fi
echo "Starting WhiteRabbit Switch: !!! Look at the SFP LEDs !!!"
sleep 5
##Start White Rabbit
/wr/sbin/startup-mb.sh
exit_multierr $ret0
user_echoasking "y/n" "Do you have WhiteRabbit sweeping LEDs?" "wrs-led"
ret1=-$?
user_echoasking "y/n" "Do you hear WhiteRabbit PWM you might wait 10s?" "wrs-pwm"
ret2=-$?
exit_multierr $ret0 $ret1 $ret2
#!/bin/sh
## Check if SFP are working by sending/receiving packets
##
##
##
## Authors:
## - Benoit Rat (Seven Solutions, www.sevensols.com)
##
## GNU Lesser General Public License Usage
## This file may be used under the terms of the GNU Lesser
## General Public License version 2.1 as published by the Free Software
## Foundation and appearing in the file LICENSE.LGPL included in the
## packaging of this file. Please review the following information to
## ensure the GNU Lesser General Public License version 2.1 requirements
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
#######################################################################################################
printf "======: $0\n"
. 000-functions.sh
##Start White Rabbit Service for SFP
echo "Start White Rabbit Service for SFP"
/wr/sbin/startup-mb.sh
echo "Loading WR... "
wrs-iftool -t 3 check
ret0="1"
exit_multierr $ret0 $ret1 $ret2
......@@ -42,7 +42,7 @@ the firmware you want to flash at the end of the test by copying
[^wrssetup]: A small tutorial written for Ubuntu 12.04, can be found [here](https://www.dropbox.com/s/okfjzm79y5e6bq5/wr-switch.pdf)
[^wrssetup]: A small tutorial written for Ubuntu 12.04, can be found [here](https://www.dropbox.com/s/197w9i7zx8vb7ij/wr-switch.pdf)
[^builddoc]: Read the wrs-build.pdf inside the `wrs-switch-sw/doc/` folder to build the switch binaries.
[^clean]: You can use the `--clean` flag to make sure to rebuild everything.
......
......@@ -9,6 +9,10 @@ cd $(dirname $0)
setupGlobalVar "APTS_SWITCH_DIR" "$(dirname $0)"
setupGlobalVar "APTS_HOST_DIR" "."
setupGlobalVar "APTS_HOST_IP" "$(netstat | grep nfsd | sed 's/.* \([0-9.]*\):nfsd.*/\1/')"
setupGlobalVar "APTS_HDL_18P" "/wr/lib/firmware/18p_mb-LX130T.bin"
setupGlobalVar "APTS_HDL_08P" "/wr/lib/firmware/8p_mb-LX130T.bin"
setupGlobalVar "APTS_FW_RTCPU" "/wr/lib/firmware/rt_cpu.bin"
## Creating directories structure
mkdir ${APTS_SWITCH_DIR}/bin &> /dev/null
......@@ -22,7 +26,7 @@ run()
if [ x"$1" != x ]; then
numseq="$1"
else
numseq="01 02 03 05 06 07 08 09 10"
numseq="01 02 03 05 06 07 08 09 10 11"
fi
for itest in $numseq; do
load_ask2run $(ls *${itest}-*.sh) $ask $update $inlog
......
......@@ -13,7 +13,7 @@ check_vars () {
}
SCRIPTDIR=$(dirname $0)
NFSROOT=$1
NFSROOT=${1:-${WR_INSTALL_ROOT}/../}
if [ -d ${NFSROOT} ]; then
......@@ -25,10 +25,26 @@ if [ -d ${NFSROOT} ]; then
cp -Rvf ${SCRIPTDIR}/alpha-pts/ ${NFSROOT}/
echo "..."
cp -v ${SCRIPTDIR}/S70apts ${NFSROOT}/etc/init.d/
cp -v ${SCRIPTDIR}/shw_tool/shw_tool ${NFSROOT}/wr/bin/
cp -v ${SCRIPTDIR}/wrs-iftool/wrs-iftool ${NFSROOT}/wr/bin/
echo "Reflashing firmware..."
cp -v /tftpboot/zImage ${NFSROOT}/alpha-pts/firmwares/
cp -v /tftpboot/wrs-image.jffs2.img ${NFSROOT}/alpha-pts/firmwares/
rootfsgz=/tftpboot/wrs-image.tar.gz
rootfsjffs2=/tmp/wrs-image.jffs2.img
TMPFS=$(mktemp -d /tmp/wrsfs-tgz.XXXXXXX)
sudo tar --directory $TMPFS -xzf $rootfsgz
sudo mkfs.jffs2 --little-endian --eraseblock=0x20000 -n --pad -d $TMPFS -o $rootfsjffs2
cp -v ${rootfsjffs2} ${NFSROOT}/alpha-pts/firmwares/
echo "Creating DF flash node"
sudo mknod ${NFSROOT}/dev/mtd4 c 90 8
echo "Changing permission..."
sudo chmod -x ${NFSROOT}/etc/init.d/S60wr
sudo chmod +x ${NFSROOT}/etc/init.d/S70apts
exit 0
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment