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
This commit is contained in:
dbrownell
2009-10-05 08:20:28 +00:00
parent 16a7ad5799
commit 7c7467b34f
7 changed files with 93 additions and 50 deletions

View File

@@ -41,7 +41,8 @@
#endif
static const Jim_Nvp nvp_jtag_tap_event[] = {
{ .value = JTAG_TAP_EVENT_POST_RESET, .name = "post-reset" },
{ .value = JTAG_TRST_ASSERTED, .name = "post-reset" },
{ .value = JTAG_TAP_EVENT_SETUP, .name = "setup" },
{ .value = JTAG_TAP_EVENT_ENABLE, .name = "tap-enable" },
{ .value = JTAG_TAP_EVENT_DISABLE, .name = "tap-disable" },
@@ -373,7 +374,7 @@ static void jtag_tap_handle_event(jtag_tap_t *tap, enum jtag_event e)
for (jteap = tap->event_action; jteap != NULL; jteap = jteap->next) {
if (jteap->event == e) {
LOG_DEBUG("JTAG tap: %s event: %d (%s) action: %s\n",
LOG_DEBUG("JTAG tap: %s event: %d (%s)\n\taction: %s",
tap->dotted_name,
e,
Jim_Nvp_value2name_simple(nvp_jtag_tap_event, e)->name,
@@ -384,10 +385,12 @@ static void jtag_tap_handle_event(jtag_tap_t *tap, enum jtag_event e)
case JTAG_TAP_EVENT_ENABLE:
case JTAG_TAP_EVENT_DISABLE:
/* NOTE: we currently assume the handlers
* can't fail. That presumes later code
* will be verifying the scan chains ...
* can't fail. Right here is where we should
* really be verifying the scan chains ...
*/
tap->enabled = (e == JTAG_TAP_EVENT_ENABLE);
LOG_INFO("JTAG tap: %s %s", tap->dotted_name,
tap->enabled ? "enabled" : "disabled");
break;
default:
break;
@@ -586,13 +589,12 @@ static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
}
void jtag_notify_reset(void)
void jtag_notify_event(enum jtag_event event)
{
jtag_tap_t *tap;
for (tap = jtag_all_taps(); tap; tap = tap->next_tap)
{
jtag_tap_handle_event(tap, JTAG_TAP_EVENT_POST_RESET);
}
jtag_tap_handle_event(tap, event);
}