summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathaniel Graff <nathaniel.graff@sifive.com>2019-06-19 23:30:43 +0000
committerGitHub <noreply@github.com>2019-06-19 23:30:43 +0000
commit4e14a479f958fa2f4259035f3a47d799c6aa4c07 (patch)
treef0cf242da339025cad42d190be8b99ff4a2a5483
parent00a58b4a52a6a3678c1359d76a8647fd5f528b9b (diff)
parent794c2ee39a8c71651728c283fc37699565872d3c (diff)
Merge pull request #286 from sifive/generate-openocd-cfg
update-targets.sh generates openocd.cfg
-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