aboutsummaryrefslogtreecommitdiff
path: root/projects/bootloader
diff options
context:
space:
mode:
authorFredrik Thulin <fredrik@thulin.net>2016-05-22 15:32:09 +0200
committerFredrik Thulin <fredrik@thulin.net>2016-05-22 15:32:09 +0200
commit578d7f5757613898d36fd999a409e5b9f5796136 (patch)
tree2ab6f456e824ceff7360e8c6f6b2ed9fd4f53e5f /projects/bootloader
parentfd60daaeb372759f2990f059ce027616439fac28 (diff)
reindent/
#!/bin/sh -
# Voodoo to load a new bitstream image into the FPGA on a Novena PVT-1.

if test $# -ne 1 || test ! -f "$1"
then
    echo 1>&2 "usage: $0 bitstream-file"
    exit 1
fi

echo "Setting export of reset pin"
echo 135 > /sys/class/gpio/export

echo "Setting reset pin to out"
echo out > /sys/class/gpio/gpio135/direction

echo "Flipping reset"
echo 0 > /sys/class/gpio/gpio135/value
echo 1 > /sys/class/gpio/gpio135/value

echo "Configuring FPGA from $1"
dd if="$1" of=/dev/spidev2.0 bs=32

echo "Turning on clock to FPGA"
eim_peek_poke --write 0x020c8160 0x00000d2b