summaryrefslogtreecommitdiff
path: root/src/jtag
Commit message (Collapse)AuthorAgeFilesLines
* FT2232: increase read retry countsDimitar Dimitrov2009-11-011-8/+26
| | | | | | | | This change is necessary to debug AT91SAM9260 on my PC with a FT2232H dongle. Signed-off-by: Dimitar Dimitrov <dinuxbg@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Signalyzer: H2 and H4 supportOleg Seiljus2009-10-271-0/+809
| | | | | | | | | | This patch includes partial support for these new JTAG adapters. More complete support will require updates to the libftdi code, for EEPROM access. [dbrownell@users.sourceforge.net: fix whitespace, linelen, etc ] Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ft2232: less noise with _DEBUG_JTAG_IO_David Brownell2009-10-261-1/+0
| | | | Don't log "Yes, I'm *still* in TAP_IDLE" every seven runtest clocks.
* JTAG: "jtag newtap ..." cleanupDavid Brownell2009-10-261-7/+2
| | | | | | Get rid of needless variable, improve and shrink diagnostic. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* JTAG: simple autoprobingDavid Brownell2009-10-261-12/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds basic autoprobing support for the JTAG scan chains which cooperate. To use, you can invoke OpenOCD with just: - interface spec: "-f interface/...cfg" - possibly with "-c 'reset_config ...'" for SRST/TRST - possibly with "-c 'jtag_khz ...'" for the JTAG clock Then set up config files matching the reported TAPs. It doesn't declare targets ... just TAPs. So facilities above the JTAG and SVF/XSVF levels won't be available without a real config; this is almost purely a way to generate diagnostics. Autoprobe was successful with most boards I tested, except ones incorporating C55x DSPs (which don't cooperate with this scheme for IR length autodetection). Here's what one multi-TAP chip reported, with the "Warn:" prefixes removed: clock speed 500 kHz There are no enabled taps. AUTO PROBING MIGHT NOT WORK!! AUTO auto0.tap - use "jtag newtap auto0 tap -expected-id 0x2b900f0f ..." AUTO auto1.tap - use "jtag newtap auto1 tap -expected-id 0x07926001 ..." AUTO auto2.tap - use "jtag newtap auto2 tap -expected-id 0x0b73b02f ..." AUTO auto0.tap - use "... -irlen 4" AUTO auto1.tap - use "... -irlen 4" AUTO auto2.tap - use "... -irlen 6" no gdb ports allocated as no target has been specified The patch tweaks IR setup a bit, so we can represent TAPs with undeclared IR length. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* JTAG: jtag_tap_init() bugfixesDavid Brownell2009-10-251-9/+18
| | | | | | | Stop allocating three bytes per IR bit, and cope somewhat better with IR lengths over 32 bits. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* jtag: clean up TAP state name handlingDavid Brownell2009-10-233-68/+63
| | | | | | | | | | | | Some cosmetic cleanup, and switch to a single table mapping between state names and symbols (vs two routines which only share that state with difficulty). Get rid of TAP_NUM_STATES, and some related knowledge about how TAP numbers are assigned. Later on, this will help us get rid of more such hardwired knowlege. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* SVF: clean up, mostly for TAP state name handlingDavid Brownell2009-10-233-4/+8
| | | | | | | | | | | | | | | | | | | | | - Use the name mappings all the other code uses: + name-to-state ... needed to add one special case + state-to-name - Improve various diagnostics: + don't complain about a "valid" state when the issue is actually that it must be "stable" + say which command was affected - Misc: + make more private data and code be static + use public DIM() not private dimof() + shorten the affected lines Re the mappings, this means we're more generous in inputs we accept, since case won't matter. Also our output diagnostics will be a smidgeon more informative, saying "RUN/IDLE" not just "IDLE" (emphasizing that there can be side effects). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* XSVF: use svf_add_statemove()David Brownell2009-10-201-23/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | XSVF improvements: - Layer parts of XSVF directly over SVF, calling svf_add_statemove() instead of expecting jtag_add_statemove() to conform to the SVF/XSVF requirements (which it doesn't). This should improve XSTATE handling a lot; it removes most users of jtag_add_statemove(), and the comments about how it should really do what svf_add_statemove() does. - Update XSTATE logic to be a closer match to the XSVF spec. The main open issue here is (still) that this implementation doesn't know how to build and submit paths from single-state transitions ... but now it will report that error case. - Update the User's Guide to mention the two utility scripts for working with XSVF, and to mention the five extension opcodes. Handling of state transition paths is, overall, still a mess. I think they should all be specified as paths not unlike SVF uses, and compiled to the bitstrings later ... so that we can actually make sense of the paths. (And see the extra clocks, detours through RUN, etc.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Removed unused interface_jtag_set_end_state and wrote down some notes on ↵Øyvind Harboe2009-10-203-13/+0
| | | | TCP/IP client/server scheme.
* More svn to git version string fixes.Øyvind Harboe2009-10-201-1/+5
|
* jtag_add_statemove() always uses TLR to get to RESETDavid Brownell2009-10-191-5/+7
| | | | | | | As decided a while back, this isn't a transition we want to chance. Whenever someone wants to got to RESET, force it. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Switch from svn to git version string handling.oyvind2009-10-191-7/+4
|
* portability updatesDavid Brownell2009-10-141-5/+6
| | | | | | | | | Based on some patches from <redirect.slash.nil@gmail.com> for preliminary Win64 compilation. More such updates are needed, but they need work. Compile tested on 64 and 32 bit Linuxes, and Cygwin. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* cosmetic cleanup in TMS tablesDavid Brownell2009-10-131-11/+17
| | | | | | | Cleanup comments and layout/whitespace in the TMS tables. Table contents stayed the same (ignoring whitespace). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* printf format warning fixesDavid Brownell2009-10-101-1/+1
| | | | | | Observed on a Cygwin build. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* add documentation about reset customizationDavid Brownell2009-10-091-10/+19
| | | | | | | | | | We added two overridable procedures; document them, and the two jtag arp_* operations they necessarily expose. Update the comment about the jtag_init_reset() routine; it's been obsolete for as long as it's had SRST support. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* minor JTAG init messaging tweaksDavid Brownell2009-10-081-2/+4
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* prevent abort via polling during jtag_resetDavid Brownell2009-10-082-0/+43
| | | | | | | | | | | | | Observed: openocd: core.c:318: jtag_checks: Assertion `jtag_trst == 0' failed. The issue was that nothing disabled background polling during calls from the TCL shell to "jtag_reset 1 1". Fix by moving the existing poll-disable mechanism to the JTAG layer where it belongs, and then augmenting it to always pay attention to TRST and SRST. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Stop ignoring most scan chain validation errorsDavid Brownell2009-10-082-15/+50
| | | | | | | | | | | | | | | | Among other things this causes startup errors to kick in the fallback "reset harder" logic during server startup. Comments are also updated a bit, explaining what the various error paths signify (in at least my observation). There's one class of validation error that we can still plausibly ignore: when wrong IDCODE values are observed. This change seems to have helped make an OMAP5912 behave much more reliably. There's still some post-reset flakiness, but it's unrelated to scan verification. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Force sane SRST and TRST initializationdbrownell2009-10-071-3/+11
| | | | | | | | | | | At least some FT2232 based adapters don't necessarily come up in the expected state, with SRST and TRST disabled. Since other adapters could suffer the same problem, let's avoid needing to patch every driver and just force *all* adapters to initialize those values properly at server startup. git-svn-id: svn://svn.berlios.de/openocd/trunk@2824 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Better fix for TAPs violating the JTAG spec for IR-Capture.dbrownell2009-10-071-16/+18
| | | | | | | | | | Instead of just assuming all IDCODE-deprived TAPs violate the JTAG spec (they don't!), just require TAPs with such problems to be declared with proper ircapture/irmask values. Example, with mask and value of zero. git-svn-id: svn://svn.berlios.de/openocd/trunk@2823 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Remove much #ifdeffery around _DEBUG_JTAG_IO_ usage.dbrownell2009-10-073-42/+47
| | | | | | | Have DEBUG_JTAG_IO() always trigger necessary warnings. git-svn-id: svn://svn.berlios.de/openocd/trunk@2822 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Updates for "reset_config":dbrownell2009-10-072-14/+95
| | | | | | | | | | | - revert to previous default: don't talk JTAG during SRST - add "srst_nogates" flag, the converse of "srst_gates_jtag" - with no args, display the current configuration And update the User's Guide text with bullet lists to be a bit more clear. git-svn-id: svn://svn.berlios.de/openocd/trunk@2818 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Do not check ir capture if there is no IDCODEoharboe2009-10-071-13/+16
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2812 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* 1.55 snapshotoharboe2009-10-071-1/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2810 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Introduced jtag_init and "jtag arp_init" to allow target scripts more ↵oharboe2009-10-063-13/+27
| | | | | | control over how OpenOCD starts up and initializes the target. git-svn-id: svn://svn.berlios.de/openocd/trunk@2805 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Improve jtag_validate_ircapture() diagnostics.dbrownell2009-10-051-8/+10
| | | | | | | | | | | Bugfix the error message so it shows the disliked value, and add a debug message showing each TAP's IR capture value, all N bits. This just changes diagnostics ... it still ignores the parameters given to us at TAP declaration time. git-svn-id: svn://svn.berlios.de/openocd/trunk@2801 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add a new JTAG "setup" event; use for better DaVinci ICEpick support.dbrownell2009-10-053-23/+43
| | | | | | | | | | | | | | | | | 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
* Streamline Capture-IR validation codedbrownell2009-09-291-26/+23
| | | | | | | | | | | | | | | | | - Don't issue needless JTAG resets ... only do them after errors. Normal exit now leaves every TAP in BYPASS. - Fix an unlikely memory leak on one fault path. - Remove the oddball limitation that invalid capture LSBs trigger errors only for TAPs that support IDCODE. Re the JTAG reset: there are too many of them, and they can (and do!) change system state. So the needless ones should get removed. This one was especially pointless. git-svn-id: svn://svn.berlios.de/openocd/trunk@2777 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Make "-expected-id 0" suppress warnings; not unlike it used to do.dbrownell2009-09-291-3/+7
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2775 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* reentry assertoharboe2009-09-291-0/+7
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2770 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* added t/nsrst_assert_width commandsoharboe2009-09-293-0/+72
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2768 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* if srst pulls trst, then set state to TAP_RESET. oharboe2009-09-281-3/+11
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2767 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Update FT2232 driver so that it reliably enters TAP_RESET.dbrownell2009-09-271-2/+10
| | | | | | | | | | | | | | | | When the OpenOCD server starts up it records its state as TAP_RESET, even though it could be anything. Then when it starts to examine the scan chain, it calls jtag_add_tlr() which sees it doesn't have any work to do, and so it does nothing. This can make the next operations fail because they start from the wrong TAP state... Instead of caring about the current recorded state, always enter TAP_RESET by forcing five clocks with TMS high. (NOTE: it seems most other JTAG adapter drivers have this same bug.) git-svn-id: svn://svn.berlios.de/openocd/trunk@2763 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Diagnostics tweaks for jtag_examine_chain() failure paths.dbrownell2009-09-261-3/+4
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2760 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Updates to the initial scanchain validation code:dbrownell2009-09-261-12/+41
| | | | | | | | | | | - minor bug fixes - code cleanup - update comments - improve diagnostics - etc git-svn-id: svn://svn.berlios.de/openocd/trunk@2759 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Streamline Capture-IR handling and integrity test.dbrownell2009-09-261-12/+22
| | | | | | | | | | | | | | | | | | | | Change the handling of the "-ircapture" and "-irmask" parameters to be slightly more sensible, given that the JTAG spec describes what is required, and that we already require that conformance in one place. IR scan returns some bitstring with LSBs "01". - First, provide and use default values that satisfy the IEEE spec. Existing TAP configs will override the defaults, but those parms are no longer required. - Second, warn if any TAP gets set up to violate the JTAG spec. It's likely a bug, but maybe not; else this should be an error. Improve the related diagnostics to say which TAP is affected. And associated minor fixes/cleanups to comments and diagnostics. git-svn-id: svn://svn.berlios.de/openocd/trunk@2758 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Remove annoying end-of-line whitespace from most src/*dbrownell2009-09-212-17/+17
| | | | | | | files; omitted src/httpd git-svn-id: svn://svn.berlios.de/openocd/trunk@2742 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Update the jtag-examine_chain() logic to verify that there's nodbrownell2009-09-211-38/+39
| | | | | | | | | | | | | | | | garbage after the expected data (from the TAPs' BYPASS or IDCODE registers). NOTE that there was previously some code that looked like it was trying to do this ... which didn't work, because it was looping over the list of expected TAPs, and never checked *after* that list completed! That could hide some *nasty* reset issues... Also replace a now-obsolete scanchain length test with one that behaves correctly; and update reporting of unexpected IDCODEs. git-svn-id: svn://svn.berlios.de/openocd/trunk@2739 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Debug message updates:dbrownell2009-09-202-31/+7
| | | | | | | | | | | | | | | | | | | - 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
* Minor regression bugfix for the jtag_tap_handle_event() casedbrownell2009-09-201-3/+7
| | | | | | | | for disabling TAPs. We don't actually know how to make any JRCs which do that yet; but when we do, this will matter. git-svn-id: svn://svn.berlios.de/openocd/trunk@2735 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Style cleanup for the updated ft2232_add_pathmove().dbrownell2009-09-191-15/+18
| | | | | | | Indentation, whitespace, line lengths. git-svn-id: svn://svn.berlios.de/openocd/trunk@2731 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Minor behavior fixes for the two JTAG reset events (C/internal,dbrownell2009-09-191-14/+12
| | | | | | | | | | | | | | | | | and Tcl/external): - Reorder so *both* paths (TCK/TMS or TRST) can enable TAPs with ICEpick ... first C code flags TAPs that got disabled, then call any Tcl code that might want to re-enable them. - Always call the C/internal handlers when JTAG operations can be issued; previously that wasn't done when TRST was used. Plus some small cleanups (whitespace, strings, better messaging during debug and on some errors) to reset-related code. git-svn-id: svn://svn.berlios.de/openocd/trunk@2730 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* remove unused externsoharboe2009-09-181-3/+0
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2727 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Address codereview comment from Steve Grubb <sgrubb@redhat.com>:dbrownell2009-09-172-33/+26
| | | | | | | | | | avoid a duplicate test. Plus other cleanup in the same code: be "static", sane line lengths for source and diagnostics, and fix misleading variable names. git-svn-id: svn://svn.berlios.de/openocd/trunk@2725 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* michal smulski <michal.smulski@ooma.com> fix regression in ↵oharboe2009-09-171-18/+30
| | | | | | jtag_add_pathmove() which broke arm11 in r1825. Other uses of jtag_add_pathmove are svn + xsvf + xscale... git-svn-id: svn://svn.berlios.de/openocd/trunk@2722 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* srst_gates_jtag option. at91sam9260 needs retesting, and possibly ↵oharboe2009-09-172-0/+9
| | | | | | srst_gates_jtag added to reset_config. Could i.MX27 be a case where srst does not pull trst, but really srst gates jtag clock? git-svn-id: svn://svn.berlios.de/openocd/trunk@2720 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* tap post reset event added. Allows omap3530 to send 100 runtest idle ↵oharboe2009-09-113-2/+37
| | | | | | tickle's after a TAP_RESET. git-svn-id: svn://svn.berlios.de/openocd/trunk@2696 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - Fix bug-in-waiting when adding more than one TAP event typeoharboe2009-09-091-4/+10
| | | | | | | - Infinite loop bugfix when running tap configure a second time git-svn-id: svn://svn.berlios.de/openocd/trunk@2681 b42882b7-edfa-0310-969c-e2dbd0fdcd60