summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathaniel Graff <nathaniel.graff@sifive.com>2018-12-14 11:00:09 -0800
committerNathaniel Graff <nathaniel.graff@sifive.com>2018-12-14 11:00:42 -0800
commit281957236e78184d9ee6235bd2c5d8cfb06fd767 (patch)
treee516658484cd86a3b9f89964b0a48c618910a8a5
parent0c3b3d75eadffb9ab1d85e811cac55d54ac9d3ca (diff)
Add script for updating MEE BSPs
Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
-rwxr-xr-xbsp/update-targets.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/bsp/update-targets.sh b/bsp/update-targets.sh
new file mode 100755
index 0000000..337d493
--- /dev/null
+++ b/bsp/update-targets.sh
@@ -0,0 +1,37 @@
+#!/usr/bin/env sh
+
+DTC=dtc
+MEE_HEADER_GENERATOR=freedom-mee_header-generator
+LDSCRIPT_GENERATOR=freedom-ldscript-generator
+
+DTS_FILENAME=design.dts
+DTB_FILENAME=temp.dtb
+HEADER_FILENAME=mee.h
+LDSCRIPT_FILENAME=mee.lds
+
+TARGET_LIST="$(ls coreip* -d) "
+TARGET_LIST+="sifive-hifive1 freedom-e310-arty "
+
+update_target() {
+ TARGET=$1
+
+ echo "Updating target $TARGET"
+
+ # Compile temporary .dtb
+ $DTC -I dts -O dtb -o $TARGET/$DTB_FILENAME $TARGET/$DTS_FILENAME || die "Failed to compile $TARGET/$DTS_FILENAME to dtb"
+
+ # Produce parameterized files
+ $MEE_HEADER_GENERATOR -d $TARGET/$DTB_FILENAME -o $TARGET/$HEADER_FILENAME || die "Failed to produce $TARGET/$HEADER_FILENAME"
+ $LDSCRIPT_GENERATOR -d $TARGET/$DTB_FILENAME -l $TARGET/$LDSCRIPT_FILENAME || die "Failed to produce $TARGET/$LDSCRIPT_FILENAME"
+
+ # Remove temporary .dtb
+ rm $TARGET/$DTB_FILENAME
+
+ echo ""
+}
+
+for TARGET in $TARGET_LIST
+do
+ update_target $TARGET
+done
+