diff --git a/test_ADRV9371-N.sh b/test_ADRV9371-N.sh deleted file mode 100755 index b1ec411..0000000 --- a/test_ADRV9371-N.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -#rsync the files in the background -rsync -azr -e "ssh -i /root/.ssh/id_rsa" /root/osc-logs test_results@romlx1:~/AD9371-N & - -OSC_FORCE_PLUGIN=scpi /usr/local/bin/osc -p /usr/local/lib/osc/profiles/ADRV9371_test.ini 2&>1 > osc_run.txt -rc=$? - -# save marker logs & pngs -serial=$(find /sys -name eeprom -size 256c | while read eeprom -do - ser=$(fru-dump "${eeprom}" -b 2>&1 | awk '/^Serial Number/ {print $NF}') - if [ ! -z {$ser} ] ; then - echo ${ser} - break; - fi -done;) - -if [[ ${rc} -eq 0 ]] ; then - serial=${serial}-PASS -else - serial=${serial}-FAIL -fi - -# Make sure the directory exists -[[ -d /root/osc-logs ]] || mkdir -p /root/osc-logs - -#Is this the first time we tested this board? -if [[ -f /root/osc-logs/AD9371-N-"${serial}"-00.tar.gz ]] ; then - num=$(ls -l /root/osc-logs/AD9371-N-${serial}* | sort -g | sed -n 1p | awk -F "-" '{print $NF}' | awk -F "." '{print $1}') - new=`printf "%02d" $(expr $num + 1)` -else - new='00' -fi -serial=${serial}-${new} - -#stick everything into a tar file -tar -czf /root/osc-logs/AD9371-N-"${serial}".tar.gz osc_run.txt markers.log ADRV*.png -rm -f markers.log ADRV*.png osc_run.txt - - -/sbin/shutdown -h now diff --git a/test_ADRV9371-W.sh b/test_ADRV9371-W.sh deleted file mode 100755 index cdda594..0000000 --- a/test_ADRV9371-W.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -#rsync the files in the background -rsync -azr -e "ssh -i /root/.ssh/id_rsa" /root/osc-logs test_results@romlx1:~/AD9371-W & - -OSC_FORCE_PLUGIN=scpi /usr/local/bin/osc -p /usr/local/lib/osc/profiles/ADRV9371_test.ini 2&>1 > osc_run.txt -rc=$? - -# save marker logs & pngs -serial=$(find /sys -name eeprom -size 256c | while read eeprom -do - ser=$(fru-dump "${eeprom}" -b 2>&1 | awk '/^Serial Number/ {print $NF}') - if [ ! -z {$ser} ] ; then - echo ${ser} - break; - fi -done;) - -if [[ ${rc} -eq 0 ]] ; then - serial=${serial}-PASS -else - serial=${serial}-FAIL -fi - -# Make sure the directory exists -[[ -d /root/osc-logs ]] || mkdir -p /root/osc-logs - -#Is this the first time we tested this board? -if [[ -f /root/osc-logs/AD9371-W-"${serial}"-00.tar.gz ]] ; then - num=$(ls -l /root/osc-logs/AD9371-W-${serial}* | sort -g | sed -n 1p | awk -F "-" '{print $NF}' | awk -F "." '{print $1}') - new=`printf "%02d" $(expr $num + 1)` -else - new='00' -fi -serial=${serial}-${new} - -#stick everything into a tar file -tar -czf /root/osc-logs/AD9371-W-"${serial}".tar.gz osc_run.txt markers.log ADRV*.png -rm -f markers.log ADRV*.png osc_run.txt - - -/sbin/shutdown -h now diff --git a/test_adrv9002_fh.sh b/test_adrv9002_fh.sh deleted file mode 100755 index 5abbc66..0000000 --- a/test_adrv9002_fh.sh +++ /dev/null @@ -1,395 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: BSD-3-Clause -# -# This is a test script for testing fast frequency hopping in ADRV9002 designs. -# It depends on libiio (and tools) and realpath (which is installed by default in almost every distribution). -# The script provides some configurability but also enforces some defaults: -# * HOP signal 1 will control RX1/TX1. -# * HOP signal 2 will control RX2/TX2. -# * If HOP1 is given we default to Frequency Hopping mode: LO_RETUNE_REALTIME_PROCESS -# * If HOP2 is given we default to Frequency Hopping mode: LO_RETUNE_REALTIME_PROCESS_DUAL_HOP -# * As a consequence of the above item, the max table size is 32. -# * DGPIO_2 will be used to control the hop signal. -# * DGPIO_3 is the base for the gpio's used when the index table control is set to gpio. -# * The script only tests one port on each call and the port to test is deduced from the hop signal and --rx -# flag parameter (eg: hop signal 1 without --rx will run the test on TX1). -set -euo pipefail - -profile="" -stream="" -tbl_a="" -tbl_b="" -tbl_sz_a=0 -tbl_sz_b=0 -tbl_ctl="gpio" -tbl_ngpio=0 -max_tbl_sz=64 -# start of gpios for index table control -dgpio_3=0 -rx="false" -hop=1 -hop_en=0 -dev_name="adrv9002-phy" -iio_dev="" -port_en=0 -verbose="n" -# number of times we loop through the hopping tables -n_run=5 - -usage() { - printf "Usage: $0 [options] TABLE_A [TABLE_B] -Script to test fast frequency hopping for ADRV9002 devices. At least -one table must be given. The second one is optional. - -Options: - -n, --n-run number of times we loop through the hopping tables [defaults to 5]. - -p, --profile profile to load on the device. it takes two arguments being the - first the stream file and the second the profile. - [only mandatory if a FH enabled profile is not already loaded]. - -c, --table-ctl how to control table indexing [defaults to gpio]: - gpio use gpios to control the indexes. - loop automatically increment through the indexes. - ping-pong automatically switch tables when the last index is reached. - -s, --hop-signal which hop signal to use [must be either 1 or 2]. combined - with the --rx flag controls which port will be tested. - -r, --rx test on a rx port [defaults to 1]. - -d, --debug verbose on. - -h, --help display this help and exit. - \n" - exit 2 -} - -error() { - [[ ${#} -gt "0" ]] && echo "[ERROR]: "${*} - exit 1 -} - -info() { - [[ ${#} -gt "0" ]] && echo "[INFO]: "${*} - - return 0 -} - -debug() { - [[ ${#} -gt "0" && ${verbose} == "y" ]] && echo "[DEBUG]: "${*} - - return 0 -} - -file_exists() { - [[ ! -f ${1} ]] && error "\"${1}\" does not exist..." - - return 0 -} - -validate_tbl() { - local tbl_sz=0 - local tbl_type=${2} - - file_exists "${1}" - - tbl_sz=$(cat "${1}" | egrep -v '<.*>|^#|^$' | wc -l) - [[ ${tbl_sz} -gt ${max_tbl_sz} ]] && error "\"${1}\" has more than ${max_tbl_sz} entries(${tbl_sz})..." - - [[ ${tbl_type} == "a" ]] && tbl_sz_a=${tbl_sz} || tbl_sz_b=${tbl_sz} - - return 0 -} - -get_ngpios() { - local max_gpios=6 - local i=1; - local n=1; - local tbl_sz=$((tbl_sz_a > tbl_sz_b ? tbl_sz_a : tbl_sz_b)) - - [[ ${tbl_ctl} != "gpio" ]] && { echo 0; return 0; } - - while [[ ${i} -le ${max_gpios} ]]; do - n=$((${n} * 2)) - if [[ ${n} -ge ${tbl_sz} ]]; then - echo ${i} - break - fi - - let i+=1 - done - - return 0 -} - -do_set_gpio_idx() { - local gpio=0 - local g=0 - local idx=${1} - - [[ ${tbl_ctl} != "gpio" ]] && return 0 - - debug "Set gpios for idx=${idx}" - for ((g=0; g<${tbl_ngpio}; g++)); do - gpio=$((${dgpio_3} + ${g})) - # unset the gpio first so we make sure we get the exact index we want - echo 0 > "/sys/class/gpio/gpio${gpio}/value" - if [[ "$((${idx} & $((1<<${g}))))" != 0 ]]; then - debug "Set gpio${gpio}" - echo 1 > "/sys/class/gpio/gpio${gpio}/value" - fi - done - - return 0 -} - -do_gpios_export() { - local model=$(tr -d \\0 "/sys/class/gpio/export" - echo low > "/sys/class/gpio/gpio${port_en}/direction" - } - - # export hop pin - [[ ! -e /sys/class/gpio/gpio${hop_en} ]] && { \ - debug "Export GPIO; ${hop_en}" - echo ${hop_en} > "/sys/class/gpio/export" - echo low > "/sys/class/gpio/gpio${hop_en}/direction" - } - - # export gpios for table control - for ((g=0; g<${tbl_ngpio}; g++)); do - gpio=$((${dgpio_3} + ${g})) - - [[ ! -e /sys/class/gpio/gpio${gpio} ]] && { - debug "Export GPIO; ${gpio}" - echo ${gpio} > "/sys/class/gpio/export" - echo low > "/sys/class/gpio/gpio${gpio}/direction" - } - done - - return 0 -} - -do_gpios_unexport() { - local g=0 - local gpio=0 - - debug "Unexporting GPIOS: ${port_en}, ${hop_en}" - echo ${port_en} > "/sys/class/gpio/unexport" - echo ${hop_en} > "/sys/class/gpio/unexport" - - for ((g=0; g<${tbl_ngpio}; g++)); do - gpio=$((${dgpio_3} + ${g})) - - debug "Unexporting GPIOS: ${gpio}" - echo ${gpio} > "/sys/class/gpio/unexport" - done - - return 0 -} - -do_config() { - local p - # first we will do all static/forced configurations - # unset all pins so there's no possibility of overlapping - iio_attr -D ${dev_name} fh_hop1_table_select_pin_set 0 1>/dev/null - iio_attr -D ${dev_name} fh_hop2_table_select_pin_set 0 1>/dev/null - iio_attr -D ${dev_name} fh_hop1_pin_set 0 1>/dev/null - iio_attr -D ${dev_name} fh_hop2_pin_set 0 1>/dev/null - iio_attr -D ${dev_name} fh_table_index_control_npins 0 1>/dev/null - # force hop mappings. HOP1 = [RX1 TX1], HOP2 = [RX2 TX2] - iio_attr -D ${dev_name} fh_rx0_port_hop_signal 0 1>/dev/null - iio_attr -D ${dev_name} fh_tx0_port_hop_signal 0 1>/dev/null - iio_attr -D ${dev_name} fh_rx1_port_hop_signal 1 1>/dev/null - iio_attr -D ${dev_name} fh_tx1_port_hop_signal 1 1>/dev/null - # force it to dual hop if using hop signal 2. This also means that the - # table size cannot be bigger than 32 entries - [[ ${hop} == 2 ]] && iio_attr -D ${dev_name} fh_mode 3 1>/dev/null || \ - iio_attr -D ${dev_name} fh_mode 2 1>/dev/null - # force maximum lo range - iio_attr -D ${dev_name} fh_min_lo_freq_hz 30000000 1>/dev/null - iio_attr -D ${dev_name} fh_max_lo_freq_hz 6000000000 1>/dev/null - # let's do now the actual config set by the user - # dgpio_2 for hop signal - iio_attr -D ${dev_name} fh_hop${hop}_pin_set 3 1>/dev/null - if [[ ${tbl_ctl} == "gpio" ]]; then - iio_attr -D ${dev_name} fh_table_index_control_mode 2 1>/dev/null - elif [[ ${tbl_ctl} == "ping-pong" ]]; then - iio_attr -D ${dev_name} fh_table_index_control_mode 1 1>/dev/null - else - iio_attr -D ${dev_name} fh_table_index_control_mode 0 1>/dev/null - fi - - tbl_ngpio=$(get_ngpios) - debug "Got ngpios=${tbl_ngpio}" - iio_attr -D ${dev_name} fh_table_index_control_npins ${tbl_ngpio} 1>/dev/null - for p in $(seq 1 ${tbl_ngpio}); do - # we start at dgpio3 so pin4 - iio_attr -D ${dev_name} fh_table_index_control_pin${p} $((${p} + 3)) 1>/dev/null - done - - return 0 -} - -do_dev_init() { - local fh=$(iio_attr -d ${dev_name} profile_config | grep "FH enable" | cut -d ":" -f2 | tr -d " ") - - iio_dev=$(iio_attr -c | grep ${dev_name} | cut -d"," -f1 | tr -d "\t") - if [[ -n ${profile} ]]; then - # if a profile is given, well, we assume FH is enabled! - info "Loading new profile..." - cat "${stream}" > "/sys/bus/iio/devices/${iio_dev}/stream_config" - cat "${profile}" > "/sys/bus/iio/devices/${iio_dev}/profile_config" - else - [[ ${fh} == 0 ]] && error "Frequency hopping not enabled and profile not given..." - info "Initializing the device..." - iio_attr -D ${dev_name} initialize 1 1>/dev/null - fi - - return 0 -} - -do_tbl_hop() { - local i - - for ((i=0; i<${1}; i++)); do - do_set_gpio_idx ${i} - # the table index get's fetched by the device when we assert the port pin - echo 1 > "/sys/class/gpio/gpio${port_en}/value" - # trigger the hop signal. the frame should start on the next hop edge - echo 1 > "/sys/class/gpio/gpio${hop_en}/value" - sleep 0.1 - echo 0 > "/sys/class/gpio/gpio${port_en}/value" - echo 0 > "/sys/class/gpio/gpio${hop_en}/value" - done -} - -do_hopping() { - local i=0 - - # let's load the table - cat "${tbl_a}" >> "/sys/bus/iio/devices/${iio_dev}/frequency_hopping_hop${hop}_table_a" - [[ -n ${tbl_b} ]] && cat "${tbl_b}" >> "/sys/bus/iio/devices/${iio_dev}/frequency_hopping_hop${hop}_table_b" - [[ ${rx} == "true" ]] && iio_attr -c ${dev_name} -i voltage$((${hop} - 1)) port_en_mode pin 1>/dev/null || \ - iio_attr -c ${dev_name} -o voltage$((${hop} - 1)) port_en_mode pin 1>/dev/null - - info "Start hopping, tbl_ctl: ${tbl_ctl}, tbl_sz_a: ${tbl_sz_a}, tbl_sz_b: ${tbl_sz_b}, hop: ${hop}, \ - rx: ${rx}, repetitions: ${n_run}" - while [[ ${i} -lt ${n_run} ]]; do - do_tbl_hop ${tbl_sz_a} - if [[ -n ${tbl_b} ]]; then - # if ping-pong, the device should automatically switch tables... - [[ ${tbl_ctl} != "ping-pong" ]] && \ - iio_attr -d ${dev_name} frequency_hopping_hop${hop}_table_select "TABLE_B" 1>/dev/null - do_tbl_hop ${tbl_sz_b} - # switch back to table a - [[ ${tbl_ctl} != "ping-pong" ]] && \ - iio_attr -d ${dev_name} frequency_hopping_hop${hop}_table_select "TABLE_A" 1>/dev/null - fi - - let i+=1 - done - - return 0 -} - -# make sure iio tools are available -command -v iio_info >/dev/null 2>&1 || error "libiio and it's tools must be installed..." -command -v realpath >/dev/null 2>&1 || error "realpath not found..." - -while [[ ${#} -gt 0 ]]; do - case "${1}" in - -n|--n-run) - n_run="${2}" - shift 2 - ;; - -p|--profile) - # we must always give a valid stream for the profile - file_exists "${2}" - file_exists "${3}" - stream="$(realpath "${2}")" - profile="$(realpath "${3}")" - shift 3 - ;; - -c|--table-ctl) - [[ ${2} != "gpio" && ${2} != "loop" && ${2} != "ping-pong" ]] && \ - error "Invalid table control mode: \"${2}\"" - tbl_ctl=${2} - shift 2 - ;; - -s|--hop-signal) - [[ ${2} != 1 && ${2} != 2 ]] && error "Invalid hop signal: \"${2}\"" - hop=${2} - [[ ${hop} == 2 ]] && max_tbl_sz=32 - shift 2 - ;; - -r|--rx) - rx="true" - shift - ;; - -d|--debug) - verbose="y" - shift - ;; - -h|--help) - usage - ;; - *) - [[ -n ${tbl_a} && -n ${tbl_b} ]] && error "Both tables given already... Unknown option: \"${1}\"" - [[ -z ${tbl_a} ]] && tbl_a="$(realpath "${1}")" || tbl_b="$(realpath "${1}")" - shift - ;; - esac -done - -# we just validate the tables now as it's size depends on the hop signal selected -validate_tbl ${tbl_a} "a" -[[ -n ${tbl_b} ]] && validate_tbl ${tbl_b} "b" - -do_config -do_dev_init -do_gpios_export -do_hopping -do_gpios_unexport diff --git a/test_ensm_pinctrl.sh b/test_ensm_pinctrl.sh deleted file mode 100755 index f0231e3..0000000 --- a/test_ensm_pinctrl.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/sh - -find_zynq_base_gpio () { - for i in /sys/class/gpio/gpiochip*; do - if [ "zynq_gpio" = `cat $i/label` ]; then - return `echo $i | sed 's/^[^0-9]\+//'` - break - fi - done - return -1 -} - -fdd_pin_control_test () { - echo Running FDD Pin Control Test - while true; do - echo high > $ENABLE # RX&TX ON - - sleep 1 - - echo low > $ENABLE # RX&TX OFF - - sleep 1 - - done -} - -fdd_independant_mode_pin_control_test () { - echo Running FDD Independant Pin Control Test - while true; do - echo high > $ENABLE # RX ON - echo low > $TXNRX # TX OFF - - sleep 1 - - echo high > $TXNRX #TX ON - - sleep 1 - - done -} - -tdd_pin_control_test () { - - echo Running TDD Pin Control Test - while true; do - - # RX - echo low > $ENABLE - echo low > $TXNRX - echo low > $TXNRX # add some extra delay required for VCO cal in single synthesizer mode. - echo high > $ENABLE - - sleep 1 - - # TX - echo low > $ENABLE - echo high > $TXNRX - echo high > $TXNRX # add some extra delay required for VCO cal in single synthesizer mode. - echo high > $ENABLE - - sleep 1 - done -} - -if [ `id -u` != "0" ] -then - echo "This script must be run as root" 1>&2 - exit 1 -fi - -for i in $(find -L /sys/bus/iio/devices -maxdepth 2 -name name) -do - dev_name=$(cat $i) - if [ "$dev_name" = "ad9361-phy" ]; then - phy_path=$(echo $i | sed 's:/name$::') - ensm_modes=$(cat $phy_path/ensm_mode_available) - break - fi -done - -if [ "$dev_name" != "ad9361-phy" ]; then - echo "This test if for FMCOMMS2/3/4 only" - exit -fi - -find_zynq_base_gpio -GPIO_BASE=$? - -cd /sys/class/gpio - -if [ $GPIO_BASE -ge 0 ] -then - GPIO_ENABLE=`expr $GPIO_BASE + 101` - GPIO_TXNRX=`expr $GPIO_BASE + 102` - #Export the CTRL_IN GPIOs - echo $GPIO_ENABLE > export 2> /dev/null - echo $GPIO_TXNRX > export 2> /dev/null -else - echo ERROR: Wrong board? - exit -fi - -ENABLE=gpio${GPIO_ENABLE}/direction -TXNRX=gpio${GPIO_TXNRX}/direction - -echo low > $ENABLE -echo low > $TXNRX - -echo Press CTRL-C to exit - -case "$ensm_modes" in - *fdd*) - echo "Type: 0 for FDD Pin Control Mode" - echo "Type: 1 for FDD Independant Pin Control Mode" - - read mode - - if [ $mode = "1" ]; then - echo pinctrl_fdd_indep > $phy_path/ensm_mode #Enable Pincontrol Mode - fdd_independant_mode_pin_control_test - else - echo pinctrl > $phy_path/ensm_mode #Enable Pincontrol Mode - fdd_pin_control_test - fi - - ;; - *rx*) - echo pinctrl > $phy_path/ensm_mode #Enable Pincontrol Mode - tdd_pin_control_test - ;; -esac diff --git a/test_fmcadc2.sh b/test_fmcadc2.sh deleted file mode 100755 index 71a8a2e..0000000 --- a/test_fmcadc2.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -tmpdir=$(mktemp -d --tmpdir=/tmp fmcadc2-test.XXXXXX) -pushd ${tmpdir} >/dev/null -OSC_FORCE_PLUGIN=scpi /usr/local/bin/osc -p /usr/local/lib/osc/profiles/AD-FMCADC2_test.ini -rc=$? -popd >/dev/null - -# save test output -serial="$(find /sys -name eeprom -size 256c | xargs fru-dump -b -i | awk '/^Serial Number/ {print $NF}')" -if [[ -n ${serial} ]]; then - # failing cards have log dirs named ${serial}-failed - [[ ${rc} -eq 0 ]] || serial+="-failed" - mkdir -p "/root/osc-logs/${serial}" - if [[ ! -d "/root/osc-logs/${serial}" ]]; then - mv ${tmpdir} "/root/osc-logs/${serial}" - else - # serial number collision - rand=$(basename ${tmpdir}) - rand=${rand##*.} - mv ${tmpdir} "/root/osc-logs/${serial}.${rand}" - fi -fi - -/sbin/shutdown -h now diff --git a/test_fmcdaq2.sh b/test_fmcdaq2.sh deleted file mode 100755 index da15c67..0000000 --- a/test_fmcdaq2.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# initialize scale to workaround dBFS GUI reload issue -/usr/local/bin/dds_set_scale.sh 0 >/dev/null - -tmpdir=$(mktemp -d --tmpdir=/tmp fmcdaq2-test.XXXXXX) -pushd ${tmpdir} >/dev/null -/usr/local/bin/osc -p /usr/local/lib/osc/profiles/AD-FMCDAQ2_test.ini -rc=$? -popd >/dev/null - -# save test output -serial="$(find /sys -name eeprom -size 256c | xargs fru-dump -b -i | awk '/^Serial Number/ {print $NF}')" -if [[ -n ${serial} ]]; then - # failing cards have log dirs named ${serial}-failed - [[ ${rc} -eq 0 ]] || serial+="-failed" - mkdir -p "/root/osc-logs/${serial}" - if [[ ! -d "/root/osc-logs/${serial}" ]]; then - mv ${tmpdir} "/root/osc-logs/${serial}" - else - # serial number collision - rand=$(basename ${tmpdir}) - rand=${rand##*.} - mv ${tmpdir} "/root/osc-logs/${serial}.${rand}" - fi -fi - -/sbin/shutdown -h now diff --git a/test_fmcdaq3.sh b/test_fmcdaq3.sh deleted file mode 100644 index 74982c1..0000000 --- a/test_fmcdaq3.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# initialize scale to workaround dBFS GUI reload issue -/usr/local/bin/dds_set_scale.sh 0 >/dev/null - -tmpdir=$(mktemp -d --tmpdir=/tmp fmcdaq3-test.XXXXXX) -pushd ${tmpdir} >/dev/null -/usr/local/bin/osc -p /usr/local/lib/osc/profiles/AD-FMCDAQ3_test.ini -rc=$? -popd >/dev/null - -# save test output -serial="$(find /sys -name eeprom -size 256c | xargs fru-dump -b -i | awk '/^Serial Number/ {print $NF}')" -if [[ -n ${serial} ]]; then - # failing cards have log dirs named ${serial}-failed - [[ ${rc} -eq 0 ]] || serial+="-failed" - mkdir -p "/root/osc-logs/${serial}" - if [[ ! -d "/root/osc-logs/${serial}" ]]; then - mv ${tmpdir} "/root/osc-logs/${serial}" - else - # serial number collision - rand=$(basename ${tmpdir}) - rand=${rand##*.} - mv ${tmpdir} "/root/osc-logs/${serial}.${rand}" - fi -fi - -/sbin/shutdown -h now \ No newline at end of file diff --git a/test_fmcomms2.sh b/test_fmcomms2.sh deleted file mode 100755 index 0a79229..0000000 --- a/test_fmcomms2.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -OSC_FORCE_PLUGIN=scpi /usr/local/bin/osc -p /usr/local/lib/osc/profiles/FMComms2_test.ini -rc=$? - -if [[ "$rc" = "0" ]] ; then - /sbin/shutdown -h now -fi diff --git a/test_fmcomms4.sh b/test_fmcomms4.sh deleted file mode 100755 index b7639b0..0000000 --- a/test_fmcomms4.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -OSC_FORCE_PLUGIN=scpi /usr/local/bin/osc -p /usr/local/lib/osc/profiles/FMComms4_test.ini -rc=$? - -if [[ "$rc" = "0" ]] ; then - /sbin/shutdown -h now -fi diff --git a/test_fmcomms5.sh b/test_fmcomms5.sh deleted file mode 100755 index 5be102d..0000000 --- a/test_fmcomms5.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -OSC_FORCE_PLUGIN=scpi /usr/local/bin/osc -p /usr/local/lib/osc/profiles/FMComms5_test.ini -rc=$? - -# save marker logs -if [[ ${rc} -eq 0 ]] ; then - eeprom=$(find /sys -name eeprom -size 256c) - serial=$(fru-dump "${eeprom}" -b | awk '/^Serial Number/ {print $NF}') - [[ -d /root/osc-logs ]] || mkdir -p /root/osc-logs - mv log.txt /root/osc-logs/"${serial}"-log.txt -fi - -/sbin/shutdown -h now diff --git a/test_freqcvt1.sh b/test_freqcvt1.sh deleted file mode 100755 index ad5d5fa..0000000 --- a/test_freqcvt1.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -/usr/local/bin/osc -p /usr/local/lib/osc/profiles/AD-FREQCVT1_test.ini -ret=$? - -if [[ ${ret} -eq 0 ]] ; then - /sbin/shutdown -h now -fi diff --git a/test_mgc_pinctrl.sh b/test_mgc_pinctrl.sh deleted file mode 100644 index ae5de89..0000000 --- a/test_mgc_pinctrl.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh - -find_zynq_base_gpio () { - for i in /sys/class/gpio/gpiochip*; do - if [ "zynq_gpio" = `cat $i/label` ]; then - return `echo $i | sed 's/^[^0-9]\+//'` - break - fi - done - return -1 -} - -if [ `id -u` != "0" ] -then - echo "This script must be run as root" 1>&2 - exit 1 -fi - -if [ `iio_attr -q -D ad9361-phy adi,mgc-rx1-ctrl-inp-enable` = "0" ];then - #Enable Pin Control Mode - iio_attr -D ad9361-phy adi,mgc-rx1-ctrl-inp-enable 1 > export 2> /dev/null - iio_attr -D ad9361-phy adi,mgc-rx2-ctrl-inp-enable 1 > export 2> /dev/null - iio_attr -D ad9361-phy initialize 1 > export 2> /dev/null - - sleep 1 -fi - -iio_attr -c ad9361-phy voltage0 gain_control_mode manual > export 2> /dev/null -iio_attr -c ad9361-phy voltage1 gain_control_mode manual > export 2> /dev/null - -find_zynq_base_gpio -GPIO_BASE=$? -cd /sys/class/gpio - -if [ $GPIO_BASE -ge 0 ] -then - GPIO_CTRL_IN0=`expr $GPIO_BASE + 94` - GPIO_CTRL_IN1=`expr $GPIO_BASE + 95` - GPIO_CTRL_IN2=`expr $GPIO_BASE + 96` - GPIO_CTRL_IN3=`expr $GPIO_BASE + 97` - #Export the CTRL_IN GPIOs - echo $GPIO_CTRL_IN0 > export 2> /dev/null - echo $GPIO_CTRL_IN1 > export 2> /dev/null - echo $GPIO_CTRL_IN2 > export 2> /dev/null - echo $GPIO_CTRL_IN3 > export 2> /dev/null -else - echo ERROR: Wrong board? - exit -fi - -CTRL_IN0=gpio${GPIO_CTRL_IN0}/direction -CTRL_IN1=gpio${GPIO_CTRL_IN1}/direction -CTRL_IN2=gpio${GPIO_CTRL_IN2}/direction -CTRL_IN3=gpio${GPIO_CTRL_IN3}/direction - -if [ "$1" = "1" ];then - iio_attr -i -c ad9361-phy voltage0 hardwaregain - - if [ "$2" = "up" ];then - echo low > $CTRL_IN0 - echo high > $CTRL_IN0 - elif [ "$2" = "down" ];then - echo low > $CTRL_IN1 - echo high > $CTRL_IN1 - else - echo "usage: $0 <1|2> " - exit - fi - iio_attr -i -c ad9361-phy voltage0 hardwaregain - -elif [ "$1" = "2" ];then - iio_attr -i -c ad9361-phy voltage1 hardwaregain - if [ "$2" = "up" ];then - echo low > $CTRL_IN2 - echo high > $CTRL_IN2 - elif [ "$2" = "down" ];then - echo low > $CTRL_IN3 - echo high > $CTRL_IN3 - else - echo "usage: $0 <1|2> " - exit - fi - iio_attr -i -c ad9361-phy voltage1 hardwaregain -else - echo "usage: $0 <1|2> " - exit -fi diff --git a/test_pzsdr2_2400tdd.sh b/test_pzsdr2_2400tdd.sh deleted file mode 100755 index 3c96fab..0000000 --- a/test_pzsdr2_2400tdd.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -/usr/local/bin/osc -p /usr/local/lib/osc/profiles/PZSDR2_2400TDD_test.ini -ret=$? - -if [[ ${ret} -eq 0 ]] ; then - /sbin/shutdown -h now -fi diff --git a/test_rx_fastlock_pinctrl.sh b/test_rx_fastlock_pinctrl.sh deleted file mode 100644 index 6daf8cd..0000000 --- a/test_rx_fastlock_pinctrl.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh - -find_zynq_base_gpio () { - for i in /sys/class/gpio/gpiochip*; do - if [ "zynq_gpio" = `cat $i/label` ]; then - return `echo $i | sed 's/^[^0-9]\+//'` - break - fi - done - return -1 -} - -if [ `id -u` != "0" ] -then - echo "This script must be run as root" 1>&2 - exit 1 -fi - -for i in $(find -L /sys/bus/iio/devices -maxdepth 2 -name name) -do - dev_name=$(cat $i) - if [ "$dev_name" = "ad9361-phy" ]; then - phy_path=$(echo $i | sed 's:/name$::') - cd $phy_path - break - fi -done - -if [ "$dev_name" != "ad9361-phy" ]; then - exit -fi - -#Setup 8 Profiles 10MHz spaced -for i in `seq 0 7` -do - echo $((2400000000 + $i * 100000)) > out_altvoltage0_RX_LO_frequency - echo "Initializing PROFILE $i at $((2400000000 + $i * 100000)) MHz" - echo $i > out_altvoltage0_RX_LO_fastlock_store -done - -#Enable Fastlock Mode -iio_attr -D ad9361-phy adi,rx-fastlock-pincontrol-enable 1 -echo 0 > out_altvoltage0_RX_LO_fastlock_recall - -find_zynq_base_gpio -GPIO_BASE=$? - -cd /sys/class/gpio - -if [ $GPIO_BASE -ge 0 ] -then - GPIO_CTRL_IN1=`expr $GPIO_BASE + 95` - GPIO_CTRL_IN2=`expr $GPIO_BASE + 96` - GPIO_CTRL_IN3=`expr $GPIO_BASE + 97` - #Export the CTRL_IN GPIOs - echo $GPIO_CTRL_IN1 > export 2> /dev/null - echo $GPIO_CTRL_IN2 > export 2> /dev/null - echo $GPIO_CTRL_IN3 > export 2> /dev/null -else - echo ERROR: Wrong board? - exit -fi - -CTRL_IN1=gpio${GPIO_CTRL_IN1}/direction -CTRL_IN2=gpio${GPIO_CTRL_IN2}/direction -CTRL_IN3=gpio${GPIO_CTRL_IN3}/direction - -for i in `seq 0 7` -do - echo Setting PROFILE $i - # BIT 0 - if [ $(($i & 1)) -gt 0 ] - then - echo CTRL_IN1:1 - echo high > $CTRL_IN1 - else - echo CTRL_IN1:0 - echo low > $CTRL_IN1 - fi - - # BIT 1 - if [ $(($i & 2)) -gt 0 ] - then - echo CTRL_IN2:1 - echo high > $CTRL_IN2 - else - echo CTRL_IN2:0 - echo low > $CTRL_IN2 - fi - - # BIT 2 - if [ $(($i & 4)) -gt 0 ] - then - echo CTRL_IN3:1 - echo high > $CTRL_IN3 - else - echo CTRL_IN3:0 - echo low > $CTRL_IN3 - fi - - sleep 1 -done diff --git a/test_trxboost1.sh b/test_trxboost1.sh deleted file mode 100755 index a7eab70..0000000 --- a/test_trxboost1.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -/usr/local/bin/osc -p /usr/local/lib/osc/profiles/AD-TRXBOOST1_test.ini -ret=$? - -if [[ ${ret} -eq 0 ]] ; then - /sbin/shutdown -h now -fi diff --git a/test_tx_fastlock_pinctrl.sh b/test_tx_fastlock_pinctrl.sh deleted file mode 100755 index 8c2d89b..0000000 --- a/test_tx_fastlock_pinctrl.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh - -find_zynq_base_gpio () { - for i in /sys/class/gpio/gpiochip*; do - if [ "zynq_gpio" = `cat $i/label` ]; then - return `echo $i | sed 's/^[^0-9]\+//'` - break - fi - done - return -1 -} - -if [ `id -u` != "0" ] -then - echo "This script must be run as root" 1>&2 - exit 1 -fi - -for i in $(find -L /sys/bus/iio/devices -maxdepth 2 -name name) -do - dev_name=$(cat $i) - if [ "$dev_name" = "ad9361-phy" ]; then - phy_path=$(echo $i | sed 's:/name$::') - cd $phy_path - break - fi -done - -if [ "$dev_name" != "ad9361-phy" ]; then - exit -fi - -#Setup 8 Profiles 10MHz spaced -for i in `seq 0 7` -do - echo $((2400000000 + $i * 10000000)) > out_altvoltage1_TX_LO_frequency - echo "Initializing PROFILE $i at $((2400000000 + $i * 10000000)) MHz" - echo $i > out_altvoltage1_TX_LO_fastlock_store -done - -#Enable Fastlock Mode -iio_attr -D ad9361-phy adi,tx-fastlock-pincontrol-enable 1 -echo 0 > out_altvoltage1_TX_LO_fastlock_recall - -find_zynq_base_gpio -GPIO_BASE=$? - -cd /sys/class/gpio - -if [ $GPIO_BASE -ge 0 ] -then - GPIO_CTRL_IN1=`expr $GPIO_BASE + 95` - GPIO_CTRL_IN2=`expr $GPIO_BASE + 96` - GPIO_CTRL_IN3=`expr $GPIO_BASE + 97` - #Export the CTRL_IN GPIOs - echo $GPIO_CTRL_IN1 > export 2> /dev/null - echo $GPIO_CTRL_IN2 > export 2> /dev/null - echo $GPIO_CTRL_IN3 > export 2> /dev/null -else - echo ERROR: Wrong board? - exit -fi - -CTRL_IN1=gpio${GPIO_CTRL_IN1}/direction -CTRL_IN2=gpio${GPIO_CTRL_IN2}/direction -CTRL_IN3=gpio${GPIO_CTRL_IN3}/direction - -for i in `seq 0 7` -do - echo Setting PROFILE $i - # BIT 0 - if [ $(($i & 1)) -gt 0 ] - then - echo CTRL_IN1:1 - echo high > $CTRL_IN1 - else - echo CTRL_IN1:0 - echo low > $CTRL_IN1 - fi - - # BIT 1 - if [ $(($i & 2)) -gt 0 ] - then - echo CTRL_IN2:1 - echo high > $CTRL_IN2 - else - echo CTRL_IN2:0 - echo low > $CTRL_IN2 - fi - - # BIT 2 - if [ $(($i & 4)) -gt 0 ] - then - echo CTRL_IN3:1 - echo high > $CTRL_IN3 - else - echo CTRL_IN3:0 - echo low > $CTRL_IN3 - fi - - sleep 1 -done