From 5287fd580b9a68e6d7db4ce20aff3cc337b7e86c Mon Sep 17 00:00:00 2001 From: Philip Balister Date: Wed, 16 Mar 2011 05:22:27 -0700 Subject: usrp_e100: Delete old test scripts. --- host/apps/omap_debug/fetch-bin.sh | 6 -- host/apps/omap_debug/fetch-kernel.sh | 7 -- host/apps/omap_debug/fetch-module.sh | 6 -- host/apps/omap_debug/fetch-u-boot.sh | 7 -- host/apps/omap_debug/read_board_id.sh | 10 --- host/apps/omap_debug/reload-fpga.sh | 7 -- host/apps/omap_debug/setup-board-id-eeprom.sh | 17 ----- host/apps/omap_debug/write-eeprom.sh | 92 --------------------------- host/apps/omap_debug/write_board_id.sh | 10 --- 9 files changed, 162 deletions(-) delete mode 100755 host/apps/omap_debug/fetch-bin.sh delete mode 100755 host/apps/omap_debug/fetch-kernel.sh delete mode 100755 host/apps/omap_debug/fetch-module.sh delete mode 100755 host/apps/omap_debug/fetch-u-boot.sh delete mode 100755 host/apps/omap_debug/read_board_id.sh delete mode 100755 host/apps/omap_debug/reload-fpga.sh delete mode 100755 host/apps/omap_debug/setup-board-id-eeprom.sh delete mode 100755 host/apps/omap_debug/write-eeprom.sh delete mode 100755 host/apps/omap_debug/write_board_id.sh (limited to 'host/apps/omap_debug') diff --git a/host/apps/omap_debug/fetch-bin.sh b/host/apps/omap_debug/fetch-bin.sh deleted file mode 100755 index 019ddaaf2..000000000 --- a/host/apps/omap_debug/fetch-bin.sh +++ /dev/null @@ -1,6 +0,0 @@ -if [ $GHQ ]; then - scp $GHQ_USER@astro:/workspace/usrp1-e-dev/u1e.bin /home/root -else - scp -P 8822 balister@192.168.1.10:src/git/fpgapriv/usrp2/top/u1e/build/u1e.bin /home/root -fi -sync diff --git a/host/apps/omap_debug/fetch-kernel.sh b/host/apps/omap_debug/fetch-kernel.sh deleted file mode 100755 index ce420f3d2..000000000 --- a/host/apps/omap_debug/fetch-kernel.sh +++ /dev/null @@ -1,7 +0,0 @@ -if [ $GHQ ]; then - scp $GHQ_USER@astro:/workspace/usrp1-e-dev/kernel_usrp/arch/arm/boot/uImage /media/mmcblk0p1/uImage -else - scp balister@192.168.1.10:src/git/kernel_usrp/arch/arm/boot/uImage /media/mmcblk0p1/uImage -fi -sync - diff --git a/host/apps/omap_debug/fetch-module.sh b/host/apps/omap_debug/fetch-module.sh deleted file mode 100755 index ec28989bd..000000000 --- a/host/apps/omap_debug/fetch-module.sh +++ /dev/null @@ -1,6 +0,0 @@ -if [ $GHQ ]; then - scp $GHQ_USER@astro:/workspace/usrp1-e-dev/kernel_usrp/drivers/misc/usrp_e.ko /lib/modules/2.6.33/kernel/drivers/misc -else - scp balister@192.168.1.10:src/git/kernel_usrp/drivers/misc/usrp_e.ko /lib/modules/2.6.33/kernel/drivers/misc -fi -sync diff --git a/host/apps/omap_debug/fetch-u-boot.sh b/host/apps/omap_debug/fetch-u-boot.sh deleted file mode 100755 index 5309364b8..000000000 --- a/host/apps/omap_debug/fetch-u-boot.sh +++ /dev/null @@ -1,7 +0,0 @@ -if [ $GHQ ]; then - scp $GHQ_USER@astro:/workspace/usrp1-e-dev/u-boot-overo/u-boot.bin /media/mmcblk0p1/ -else - scp balister@192.168.1.167:src/git/u-boot/u-boot.bin /media/mmcblk0p1/ -fi -sync - diff --git a/host/apps/omap_debug/read_board_id.sh b/host/apps/omap_debug/read_board_id.sh deleted file mode 100755 index 96081f219..000000000 --- a/host/apps/omap_debug/read_board_id.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -i2cget -y 3 0x51 0x00 b -i2cget -y 3 0x51 0x01 b -i2cget -y 3 0x51 0x02 b -i2cget -y 3 0x51 0x03 b -i2cget -y 3 0x51 0x04 b -i2cget -y 3 0x51 0x05 b - - diff --git a/host/apps/omap_debug/reload-fpga.sh b/host/apps/omap_debug/reload-fpga.sh deleted file mode 100755 index 2754718a4..000000000 --- a/host/apps/omap_debug/reload-fpga.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -rmmod usrp_e -fpga-downloader /home/root/u1e.bin -modprobe usrp_e -usrp-e-debug-pins 1 - diff --git a/host/apps/omap_debug/setup-board-id-eeprom.sh b/host/apps/omap_debug/setup-board-id-eeprom.sh deleted file mode 100755 index 4dba1cce5..000000000 --- a/host/apps/omap_debug/setup-board-id-eeprom.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -i2cset -y 3 0x51 0x00 0x00 -i2cset -y 3 0x51 0x01 0x03 -i2cset -y 3 0x51 0x02 0x00 -i2cset -y 3 0x51 0x03 0x01 -i2cset -y 3 0x51 0x04 0x01 -i2cset -y 3 0x51 0x05 0x00 -i2cset -y 3 0x51 0x06 0x00 - -i2cget -y 3 0x51 0 b -i2cget -y 3 0x51 1 b -i2cget -y 3 0x51 2 b -i2cget -y 3 0x51 3 b -i2cget -y 3 0x51 4 b -i2cget -y 3 0x51 5 b -i2cget -y 3 0x51 6 b diff --git a/host/apps/omap_debug/write-eeprom.sh b/host/apps/omap_debug/write-eeprom.sh deleted file mode 100755 index 301b06f07..000000000 --- a/host/apps/omap_debug/write-eeprom.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash - -if [ $# -ne 3 ] && [ $# -ne 5 ]; -then - echo "Usage:" - echo "" - echo "writeprom.sh deviceid rev fab_rev [envvar envsetting]" - echo - echo " deviceid - expansion board device number from table:" - echo - echo " Summit 0x01" - echo " Tobi 0x02" - echo " Tobi Duo 0x03" - echo " Palo35 0x04" - echo " Palo43 0x05" - echo " Chestnut43 0x06" - echo " Pinto 0x07" - echo - echo " rev - board revision (e.g. 0x00)" - echo " fab_rev - revision marking from pcb (e.g. R2411)" - echo " envvar - optional u-boot env variable name" - echo " (e.g. dvimode)" - echo " envsetting - optional u-boot env variable setting" - echo " (e.g. 1024x768MR-16@60)" - exit 1 -fi - -fabrevision=$3 -if [ ${#fabrevision} -ge 8 ]; then - echo "Error: fab revision string must less than 8 characters" - exit 1 -fi - -envvar=$4 -if [ ${#envar} -ge 16 ]; then - echo "Error: environment variable name string must less than 16 characters" - exit 1 -fi - -envsetting=$5 -if [ ${#ensetting} -ge 64 ]; then - echo "Error: environment setting string must less than 64 characters" - exit 1 -fi - -bus=3 -device=0x51 -vendorid=0x03 - -i2cset -y $bus $device 0x00 0x00 -i2cset -y $bus $device 0x01 $vendorid -i2cset -y $bus $device 0x02 0x00 -i2cset -y $bus $device 0x03 $1 -i2cset -y $bus $device 0x04 $2 -i2cset -y $bus $device 0x05 00 - -let i=6 -hexdumpargs="'${#fabrevision}/1 \"0x%02x \"'" -command="echo -n \"$fabrevision\" | hexdump -e $hexdumpargs" -hex=$(eval $command) -for character in $hex; do - i2cset -y $bus $device $i $character - let i=$i+1 -done -i2cset -y $bus $device $i 0x00 - -if [ $# -eq 5 ] -then - i2cset -y $bus $device 0x05 0x01 - - let i=14 - hexdumpargs="'${#envvar}/1 \"0x%02x \"'" - command="echo -n \"$envvar\" | hexdump -e $hexdumpargs" - hex=$(eval $command) - for character in $hex; do - i2cset -y $bus $device $i $character - let i=$i+1 - done - i2cset -y $bus $device $i 0x00 - - let i=30 - hexdumpargs="'${#envsetting}/1 \"0x%02x \"'" - command="echo -n \"$envsetting\" | hexdump -e $hexdumpargs" - hex=$(eval $command) - for character in $hex; do - i2cset -y $bus $device $i $character - let i=$i+1 - done - i2cset -y $bus $device $i 0x00 -fi - - diff --git a/host/apps/omap_debug/write_board_id.sh b/host/apps/omap_debug/write_board_id.sh deleted file mode 100755 index 067269c64..000000000 --- a/host/apps/omap_debug/write_board_id.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -i2cset -y 3 0x51 0x00 0x00 -i2cset -y 3 0x51 0x01 0x03 -i2cset -y 3 0x51 0x02 0x00 -i2cset -y 3 0x51 0x03 0x01 -i2cset -y 3 0x51 0x04 0x00 -i2cset -y 3 0x51 0x05 0x00 - - -- cgit v1.2.3 From a8f7839af32c2b38fc586bccffc7eb57f558672b Mon Sep 17 00:00:00 2001 From: Philip Balister Date: Wed, 16 Mar 2011 05:25:22 -0700 Subject: usrp_e100: Move gpio test program to utils. Still needs changing to use the new register map header. --- host/apps/omap_debug/usrp-e-gpio.c | 83 -------------------------------------- host/usrp_e_utils/usrp-e-gpio.c | 83 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 83 deletions(-) delete mode 100644 host/apps/omap_debug/usrp-e-gpio.c create mode 100644 host/usrp_e_utils/usrp-e-gpio.c (limited to 'host/apps/omap_debug') diff --git a/host/apps/omap_debug/usrp-e-gpio.c b/host/apps/omap_debug/usrp-e-gpio.c deleted file mode 100644 index adef877d3..000000000 --- a/host/apps/omap_debug/usrp-e-gpio.c +++ /dev/null @@ -1,83 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include "usrp_e.h" -#include "usrp_e_regs.hpp" - -// Usage: usrp_e_gpio - -static int fp; - -static int read_reg(__u16 reg) -{ - int ret; - struct usrp_e_ctl16 d; - - d.offset = reg; - d.count = 1; - ret = ioctl(fp, USRP_E_READ_CTL16, &d); - return d.buf[0]; -} - -static void write_reg(__u16 reg, __u16 val) -{ - int ret; - struct usrp_e_ctl16 d; - - d.offset = reg; - d.count = 1; - d.buf[0] = val; - ret = ioctl(fp, USRP_E_WRITE_CTL16, &d); -} - -int main(int argc, char *argv[]) -{ - int i, test, data_in; - - test = 0; - if (argc > 1) - test = 1; - - fp = open("/dev/usrp_e0", O_RDWR); - printf("fp = %d\n", fp); - - write_reg(UE_REG_GPIO_TX_DDR, 0x0); - write_reg(UE_REG_GPIO_RX_DDR, 0xFFFF); - - for (i=0; i < 16; i++) { - write_reg(UE_REG_GPIO_RX_IO, 1 << i); - sleep(1); - if (test) { - data_in = read_reg(UE_REG_GPIO_TX_IO); - if (data_in != (1 << i)) - printf("Read failed, wrote: %X read: %X\n", \ - 1 << i, data_in); - } - } - - write_reg(UE_REG_GPIO_RX_DDR, 0x0); - write_reg(UE_REG_GPIO_TX_DDR, 0xFFFF); - - sleep(1); - - for (i=0; i < 16; i++) { - write_reg(UE_REG_GPIO_TX_IO, 1 << i); - sleep(1); - if (test) { - data_in = read_reg(UE_REG_GPIO_RX_IO); - if (data_in != (1 << i)) - printf("Read failed, wrote: %X read: %X\n", \ - 1 << i, data_in); - } - } - - write_reg(UE_REG_GPIO_RX_DDR, 0x0); - write_reg(UE_REG_GPIO_TX_DDR, 0x0); - - return 0; -} diff --git a/host/usrp_e_utils/usrp-e-gpio.c b/host/usrp_e_utils/usrp-e-gpio.c new file mode 100644 index 000000000..adef877d3 --- /dev/null +++ b/host/usrp_e_utils/usrp-e-gpio.c @@ -0,0 +1,83 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "usrp_e.h" +#include "usrp_e_regs.hpp" + +// Usage: usrp_e_gpio + +static int fp; + +static int read_reg(__u16 reg) +{ + int ret; + struct usrp_e_ctl16 d; + + d.offset = reg; + d.count = 1; + ret = ioctl(fp, USRP_E_READ_CTL16, &d); + return d.buf[0]; +} + +static void write_reg(__u16 reg, __u16 val) +{ + int ret; + struct usrp_e_ctl16 d; + + d.offset = reg; + d.count = 1; + d.buf[0] = val; + ret = ioctl(fp, USRP_E_WRITE_CTL16, &d); +} + +int main(int argc, char *argv[]) +{ + int i, test, data_in; + + test = 0; + if (argc > 1) + test = 1; + + fp = open("/dev/usrp_e0", O_RDWR); + printf("fp = %d\n", fp); + + write_reg(UE_REG_GPIO_TX_DDR, 0x0); + write_reg(UE_REG_GPIO_RX_DDR, 0xFFFF); + + for (i=0; i < 16; i++) { + write_reg(UE_REG_GPIO_RX_IO, 1 << i); + sleep(1); + if (test) { + data_in = read_reg(UE_REG_GPIO_TX_IO); + if (data_in != (1 << i)) + printf("Read failed, wrote: %X read: %X\n", \ + 1 << i, data_in); + } + } + + write_reg(UE_REG_GPIO_RX_DDR, 0x0); + write_reg(UE_REG_GPIO_TX_DDR, 0xFFFF); + + sleep(1); + + for (i=0; i < 16; i++) { + write_reg(UE_REG_GPIO_TX_IO, 1 << i); + sleep(1); + if (test) { + data_in = read_reg(UE_REG_GPIO_RX_IO); + if (data_in != (1 << i)) + printf("Read failed, wrote: %X read: %X\n", \ + 1 << i, data_in); + } + } + + write_reg(UE_REG_GPIO_RX_DDR, 0x0); + write_reg(UE_REG_GPIO_TX_DDR, 0x0); + + return 0; +} -- cgit v1.2.3