diff options
author | dbrownell <dbrownell@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-09-20 07:55:11 +0000 |
---|---|---|
committer | dbrownell <dbrownell@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-09-20 07:55:11 +0000 |
commit | 0c4b119d3f8c218f4da0336fb9c25f856f52853e (patch) | |
tree | 9d8152195f5af45ac388c01c00730394469beb44 /src/jtag/core.c | |
parent | 75581ffea63690c80f4914b2b4e30372b6a5c580 (diff) |
Debug message updates:
- Shrink messaging during resets, primarily by getting rid of
"nothing happened" noise that hides *useful* information.
- Improve: the "no IDCODE" message by identifying which tap only
supports BYPASS; and the TAP event strings.
Related minor code updates:
- Remove two needless tests when examining the chain: we know
we have a TAP, and that all TAPs have names.
- Clean up two loops, turning "while"s into "for"s which better
show what's actually being done.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2736 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/jtag/core.c')
-rw-r--r-- | src/jtag/core.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c index 6a314ece..bf4a9cc7 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -60,9 +60,9 @@ static int jtag_error = ERROR_OK; static const char *jtag_event_strings[] = { - [JTAG_TRST_ASSERTED] = "JTAG controller reset (TLR or TRST)", + [JTAG_TRST_ASSERTED] = "TAP reset", [JTAG_TAP_EVENT_ENABLE] = "TAP enabled", - [JTAG_TAP_EVENT_POST_RESET] = "post reset", + [JTAG_TAP_EVENT_POST_RESET] = "TAP post reset", [JTAG_TAP_EVENT_DISABLE] = "TAP disabled", }; @@ -820,9 +820,6 @@ static int jtag_reset_callback(enum jtag_event event, void *priv) { jtag_tap_t *tap = priv; - LOG_DEBUG("TAP %s event %s", tap->dotted_name, - jtag_event_strings[event]); - if (event == JTAG_TRST_ASSERTED) { tap->enabled = !tap->disabled_after_reset; @@ -943,15 +940,10 @@ static bool jtag_examine_chain_match_tap(const struct jtag_tap_s *tap) for (ii = 0; ii < tap->expected_ids_cnt; ii++) { if (tap->idcode == tap->expected_ids[ii]) - break; + return true; } /* If none of the expected ids matched, log an error */ - if (ii != tap->expected_ids_cnt) - { - LOG_DEBUG("JTAG Tap/device matched"); - return true; - } jtag_examine_chain_display(LOG_LVL_ERROR, "got", tap->dotted_name, tap->idcode); for (ii = 0; ii < tap->expected_ids_cnt; ii++) @@ -994,7 +986,8 @@ static int jtag_examine_chain(void) if ((idcode & 1) == 0) { /* LSB must not be 0, this indicates a device in bypass */ - LOG_WARNING("Tap/Device does not have IDCODE"); + LOG_WARNING("TAP %s does not have IDCODE", + tap->dotted_name); idcode = 0; tap->hasidcode = false; @@ -1017,15 +1010,11 @@ static int jtag_examine_chain(void) } jtag_examine_chain_display(LOG_LVL_INFO, "tap/device found", - tap ? tap->dotted_name : "(not-named)", - idcode); + tap->dotted_name, idcode); bit_count += 32; } device_count++; - if (!tap) - continue; - tap->idcode = idcode; // ensure the TAP ID does matches what was expected |