Skip to content

Instantly share code, notes, and snippets.

@esben
Created October 27, 2015 20:45
Show Gist options
  • Save esben/d6c9d5eb16a96cbd777c to your computer and use it in GitHub Desktop.
Save esben/d6c9d5eb16a96cbd777c to your computer and use it in GitHub Desktop.
commit 57176f5a5e08f10bfadcb7a027661cea304c5547
Author: Esben Haabendal <esben@haabendal.dk>
Date: Tue Oct 27 21:42:14 2015 +0100
Add -defer-examine option to jtag newtap command
Change-Id: I41dcf927c7e0137f45c30fce7c8f8c38c877519e
Signed-off-by: Esben Haabendal <esben@haabendal.dk>
diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h
index eda4ccd..b1f003e 100644
--- a/src/jtag/jtag.h
+++ b/src/jtag/jtag.h
@@ -127,6 +127,8 @@ struct jtag_tap {
int abs_chain_position;
/** Is this TAP disabled after JTAG reset? */
bool disabled_after_reset;
+ /** Should we defer examine to later */
+ bool defer_examine;
/** Is this TAP currently enabled? */
bool enabled;
int ir_length; /**< size of instruction register */
diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index c916fb1..b461147 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -454,6 +454,7 @@ static int jim_newtap_expected_id(Jim_Nvp *n, Jim_GetOptInfo *goi,
#define NTAP_OPT_DISABLED 4
#define NTAP_OPT_EXPECTED_ID 5
#define NTAP_OPT_VERSION 6
+#define NTAP_OPT_DEFER_EXAMINE 7
static int jim_newtap_ir_param(Jim_Nvp *n, Jim_GetOptInfo *goi,
struct jtag_tap *pTap)
@@ -516,6 +517,7 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
{ .name = "-disable", .value = NTAP_OPT_DISABLED },
{ .name = "-expected-id", .value = NTAP_OPT_EXPECTED_ID },
{ .name = "-ignore-version", .value = NTAP_OPT_VERSION },
+ { .name = "-defer-examine", .value = NTAP_OPT_DEFER_EXAMINE },
{ .name = NULL, .value = -1 },
};
@@ -599,6 +601,9 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
case NTAP_OPT_VERSION:
pTap->ignore_version = true;
break;
+ case NTAP_OPT_DEFER_EXAMINE:
+ pTap->defer_examine = true;
+ break;
} /* switch (n->value) */
} /* while (goi->argc) */
diff --git a/src/target/target.c b/src/target/target.c
index 19e5d65..df82e4c 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -729,6 +729,9 @@ int target_examine(void)
continue;
}
+ if (target->tap->defer_examine)
+ continue;
+
retval = target_examine_one(target);
if (retval != ERROR_OK)
return retval;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment