forked from pyrpl-fpga/pyrpl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP proposed addition for version 2.0 fpga support
- Loading branch information
Showing
2 changed files
with
97 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/sh | ||
|
||
## This script is WIP. This version is the same as /opt/redpitaya/sbin/overlay.sh | ||
## so custom FPGA is not supported at present | ||
|
||
FPGAS=/opt/redpitaya/fpga | ||
MODEL=$(/opt/redpitaya/bin/monitor -f) | ||
|
||
# Assume serverbinfilename or use $2 for the serverbinfilename | ||
CUSTOMFPGA=/opt/pyrpl/fpga.bin | ||
|
||
if [ "$?" = "0" ] | ||
then | ||
sleep 0.5s | ||
|
||
rmdir /configfs/device-tree/overlays/Full 2> /dev/null | ||
rm -f /tmp/loaded_fpga.inf 2> /dev/null | ||
|
||
sleep 0.5s | ||
echo -n "Commit " | ||
awk 'NR==2 {print $2}' $FPGAS/$MODEL/$1/git_info.txt | ||
|
||
FPGATOINSTALL=$FPGAS/$MODEL/$1/fpga.bit.bin | ||
# FPGATOINSTALL=$CUSTOMFPGA | ||
|
||
/opt/redpitaya/bin/fpgautil -b $FPGATOINSTALL -o $FPGAS/$MODEL/$1/fpga.dtbo -n Full > /tmp/update_fpga.txt 2>&1 | ||
# TODO replace the following and implement overlay and get device tree for custom fpga | ||
# /opt/redpitaya/bin/fpgautil -b $FPGATOINSTALL -f Full > /tmp/update_fpga.txt 2>&1 | ||
|
||
if [ "$?" = '0' ] | ||
then | ||
md5sum $FPGATOINSTALL >> /tmp/update_fpga.txt | ||
date >> /tmp/update_fpga.txt | ||
echo -n $1 > /tmp/loaded_fpga.inf | ||
exit 0 | ||
else | ||
rm -f /tmp/update_fpga.txt 2> /dev/null | ||
rm -f /tmp/loaded_fpga.inf 2> /dev/null | ||
exit 1 | ||
fi | ||
fi | ||
exit 1 |