#!/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
> : sw/stm32
blob: 7aa8d3e7c6401a08312be94d0cb3e05fba8f84a2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
TEST = cores test-bus test-trng test-hash test-aes-key-wrap test-pbkdf2 test-ecdsa test-rsa test-mkmif
CFLAGS += -I $(LIBHAL_SRC)
LIBC_OBJS = printf.o gettimeofday.o
LIBS += $(LIBHAL_BLD)/libhal.a $(LIBTFM_BLD)/libtfm.a
all: $(TEST:=.elf)
vpath %.c $(LIBHAL_SRC)/tests $(LIBHAL_SRC)/utils
# .mo extension for files with main() that need to be wrapped as __main()
%.mo: %.c
$(CC) -c $(CFLAGS) -Dmain=__main -o $@ $<
%.elf: %.mo main.o $(BOARD_OBJS) $(LIBC_OBJS) $(LIBS)
$(CC) $(CFLAGS) $^ -o $*.elf -T$(LDSCRIPT) -g -Wl,-Map=$*.map
$(OBJCOPY) -O binary $*.elf $*.bin
$(SIZE) $*.elf
# don't automatically delete objects, to avoid a lot of unnecessary rebuilding
.SECONDARY: $(BOARD_OBJS) $(LIBC_OBJS)
clean:
rm -f *.o *.mo
rm -f *.elf
rm -f *.bin
rm -f *.map
|