From 281957236e78184d9ee6235bd2c5d8cfb06fd767 Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Fri, 14 Dec 2018 11:00:09 -0800 Subject: Add script for updating MEE BSPs Signed-off-by: Nathaniel Graff --- bsp/update-targets.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 bsp/update-targets.sh (limited to 'bsp') 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 + -- cgit v1.2.3