summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@dabbelt.com>2018-12-17 16:56:56 -0800
committerGitHub <noreply@github.com>2018-12-17 16:56:56 -0800
commit0585e67d09b2343bd3ae89615adab92aaa8b5450 (patch)
treeffc08bb397d60a661bd0951b9551b4ce4cb10091
parentdcfd715b8a0085f8261c6d308f533488d4a25374 (diff)
parent281957236e78184d9ee6235bd2c5d8cfb06fd767 (diff)
Merge pull request #119 from sifive/dt-tools-updater
Add script for updating MEE BSPs
-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
+