summaryrefslogtreecommitdiff
path: root/src/jtag/core.c
diff options
context:
space:
mode:
authordbrownell <dbrownell@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-10-05 08:20:28 +0000
committerdbrownell <dbrownell@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-10-05 08:20:28 +0000
commit7c7467b34f11939fbce41e39dfa1b6b0e110a89c (patch)
tree13b56b2b83316f8e2bc4e402c9d994cf858471fe /src/jtag/core.c
parent16a7ad5799ae488ad122648f2f74fe5d59e6c0c6 (diff)
downloadopenocd_libswd-7c7467b34f11939fbce41e39dfa1b6b0e110a89c.tar.gz
openocd_libswd-7c7467b34f11939fbce41e39dfa1b6b0e110a89c.tar.bz2
openocd_libswd-7c7467b34f11939fbce41e39dfa1b6b0e110a89c.tar.xz
openocd_libswd-7c7467b34f11939fbce41e39dfa1b6b0e110a89c.zip
Add a new JTAG "setup" event; use for better DaVinci ICEpick support.
The model is that this fires after scanchain verification, when it's safe to call "jtag tapenable $TAPNAME". So it will fire as part of non-error paths of "init" and "reset" command processing. However it will *NOT* trigger during "jtag_reset" processing, which skips all scan chain verification, or after verification errors. ALSO: - switch DaVinci chips to use this new mechanism - log TAP activation/deactivation, since their IDCODEs aren't verified - unify "enum jtag_event" scripted event notifications - remove duplicative JTAG_TAP_EVENT_POST_RESET git-svn-id: svn://svn.berlios.de/openocd/trunk@2800 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/jtag/core.c')
-rw-r--r--src/jtag/core.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c
index 6177c1dc..12850404 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -61,8 +61,8 @@ static int jtag_error = ERROR_OK;
static const char *jtag_event_strings[] =
{
[JTAG_TRST_ASSERTED] = "TAP reset",
+ [JTAG_TAP_EVENT_SETUP] = "TAP setup",
[JTAG_TAP_EVENT_ENABLE] = "TAP enabled",
- [JTAG_TAP_EVENT_POST_RESET] = "TAP post reset",
[JTAG_TAP_EVENT_DISABLE] = "TAP disabled",
};
@@ -489,7 +489,7 @@ void jtag_add_tlr(void)
/* NOTE: order here matches TRST path in jtag_add_reset() */
jtag_call_event_callbacks(JTAG_TRST_ASSERTED);
- jtag_notify_reset();
+ jtag_notify_event(JTAG_TRST_ASSERTED);
}
void jtag_add_pathmove(int num_states, const tap_state_t *path)
@@ -704,7 +704,7 @@ void jtag_add_reset(int req_tlr_or_trst, int req_srst)
* sequence must match jtag_add_tlr().
*/
jtag_call_event_callbacks(JTAG_TRST_ASSERTED);
- jtag_notify_reset();
+ jtag_notify_event(JTAG_TRST_ASSERTED);
}
}
}
@@ -1232,6 +1232,7 @@ static int jtag_init_inner(struct command_context_s *cmd_ctx)
{
jtag_tap_t *tap;
int retval;
+ bool issue_setup = true;
LOG_DEBUG("Init JTAG chain");
@@ -1249,13 +1250,21 @@ static int jtag_init_inner(struct command_context_s *cmd_ctx)
if (jtag_examine_chain() != ERROR_OK)
{
LOG_ERROR("Trying to use configured scan chain anyway...");
+ issue_setup = false;
}
if (jtag_validate_ircapture() != ERROR_OK)
{
LOG_WARNING("Errors during IR capture, continuing anyway...");
+ issue_setup = false;
}
+ if (issue_setup)
+ jtag_notify_event(JTAG_TAP_EVENT_SETUP);
+ else
+ LOG_WARNING("Bypassing JTAG setup events due to errors");
+
+
return ERROR_OK;
}