summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathaniel Graff <nathaniel.graff@sifive.com>2019-06-18 13:57:51 -0700
committerNathaniel Graff <nathaniel.graff@sifive.com>2019-06-19 11:44:07 -0700
commit794c2ee39a8c71651728c283fc37699565872d3c (patch)
tree89cf2a3c40023dac803fcc4a68f3d40fa339fcc9
parentb6d3042a135969177e80255216f49197c02754d8 (diff)
update-targets.sh generates openocd.cfg
Generates for Arty and HiFive targets which don't have "jlink" in TARGET_TAGS Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
-rwxr-xr-xbsp/update-targets.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/bsp/update-targets.sh b/bsp/update-targets.sh
index 198cd5a..fe9458a 100755
--- a/bsp/update-targets.sh
+++ b/bsp/update-targets.sh
@@ -80,6 +80,7 @@ MEE_HEADER_GENERATOR=freedom-metal_header-generator
LDSCRIPT_GENERATOR=freedom-ldscript-generator
MAKEATTRIB_GENERATOR=freedom-makeattributes-generator
BARE_HEADER_GENERATOR=freedom-bare_header-generator
+OPENOCDCFG_GENERATOR=freedom-openocdcfg-generator
DTS_FILENAME=design.dts
DTB_FILENAME=temp.dtb
@@ -89,6 +90,7 @@ LDS_RAMRODATA_FILENAME=metal.ramrodata.lds
LDS_SCRATCHPAD_FILENAME=metal.scratchpad.lds
SETTINGS_FILENAME=settings.mk
BARE_HEADER_FILENAME=metal-platform.h
+OPENOCDCFG_FILENAME=openocd.cfg
update_target() {
TARGET=$1
@@ -113,6 +115,12 @@ update_target() {
$MAKEATTRIB_GENERATOR -d $TARGET/$DTB_FILENAME -b $TARGET_TYPE -o $TARGET/$SETTINGS_FILENAME || warn "Failed to produce $TARGET/$SETTINGS_FILENAME"
$BARE_HEADER_GENERATOR -d $TARGET/$DTB_FILENAME -o $TARGET/$BARE_HEADER_FILENAME || warn "Failed to produce $TARGET/$BARE_HEADER_FILENAME"
+ if [[ "$TARGET_TYPE" =~ "arty" || "$TARGET_TYPE" =~ "hifive" ]] ; then
+ if [ `grep -c "jlink" $TARGET/$SETTINGS_FILENAME` -ne 1 ] ; then
+ $OPENOCDCFG_GENERATOR -d $TARGET/$DTB_FILENAME -o $TARGET/$OPENOCDCFG_FILENAME || warn "Failed to produce $TARGET/$OPENOCDCFG_FILENAME"
+ fi
+ fi
+
# Remove temporary .dtb
rm $TARGET/$DTB_FILENAME