summaryrefslogtreecommitdiff
path: root/src/jtag/jtag.h
Commit message (Collapse)AuthorAgeFilesLines
* cortex_a : multiple target on the same dapMichel JAOUEN2011-04-131-0/+2
|
* str9xpec: Find flash controller from the chain.Santeri Salko2011-01-141-0/+1
| | | | | | | | | | | Find the flash controller by position since it is before the core, not after it. This fixes the problem that str9xpec enable_turbo (or any other str9xpec command) did not work. (See my post in http://forum.sparkfun.com/viewtopic.php?f=18&t=25542) Signed-off-by: Santeri Salko <santeri.salko@gmail.com>
* initial SWD transport (SWD infrastructure #2)David Brownell2010-12-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This piggy backs on JTAG so it's not yet pretty, but that seems unavoidable so far given today's OpenOCD internals. SWD init and data transfer are unfinished and untested, but that should cause no regressions, and will be addressed by the time drivers start using this infrastructure. Checking in whould get the code working better sooner, and turn up any structural/architectural issues while they're easier to fix. The debug adapter drivers will provide simple SWD driver structs with methods that kick in as needed (instead of JTAG). So far just one adapter driver has been updated (not yet ready to use or circulate). The biggest issues are probably - fault handling, where the ARM Debug Interface V5 pipelining needs work in both JTAG and SWD modes and - missing rewrite of block I/O code to work on both of our Cortex-ready transports (Current code is hard-wired to JTAG); relates also to the pipelining issue. - omitted support to activate/deactivate SWO/SWV trace (this is technically trivial, but configuring what to trace is NOT. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> ---- doc/openocd.texi | 17 ++ src/jtag/core.c | 3 src/jtag/interface.h | 4 src/jtag/jtag.h | 2 src/jtag/swd.h | 114 +++++++++++++++++++ src/jtag/tcl.c | 2 src/target/adi_v5_swd.c | 281 ++++++++++++++++++++++++++++++++++++++++++++++-- src/target/arm_adi_v5.c | 8 + src/target/arm_adi_v5.h | 3 9 files changed, 425 insertions(+), 9 deletions(-)
* jtag: getting the JTAG speed can failØyvind Harboe2010-12-081-1/+1
| | | | | | | | | | | If the JTAG speed has not been set, then it has no defined value, add code to propagate the error. No change to actual behavior as no new failure paths have been introduced. This is a no-op patch to make subsequent patches smaller. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: add jtag_flush_queue_sleep debug commandØyvind Harboe2010-08-021-0/+4
| | | | | | | | it can be useful to throttle performance: test differences in behavior, test performance effect of long roundtrips. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* initial "transport" frameworkDavid Brownell2010-07-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the guts of a transport framework with initialization, which should work with current JTAG-only configurations (tested with FT2232). Each debug adapter can declare the transports it supports, and exactly one transport is initialized. (with its commands) in any given OpenOCD session. * Define a new "struct transport with init hooks and a few "transport" subcommands to support it: "list" ... list the transports configured (just "jtag" for now) "select" ... makes the debug session use that transport "init" ... initializes the selected transport (internal) * "interface_transports" ... declares transports the current interface can support. (Some will do this from C code instead, when there are no hardware versioning (or other) issues to prevent it. Plus some FT2232 tweaks, including a few to streamline upcoming support for an SWD transport (initially for Luminary adapters). Eventually src/jtag should probably become src/transport, moving jtag-specific stuff to transport/jtag. Signed-off-by: David Brownell <db@helium.(none)>
* jtag: retire jtag_get_error()Øyvind Harboe2010-06-211-2/+0
| | | | | | | This fn is an implementation detail of jtag_execute_queue() that is not to be exposed externally. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: make out_value constØyvind Harboe2010-03-211-2/+2
| | | | | | Tightens up the jtag_add_xxx_scan() API Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: retire jtag_get/set_end_state()Øyvind Harboe2010-03-191-20/+0
| | | | | | | Voila! This get rids of mysteries about what what state the TAP is in. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: cut down on usage of unintended modification of global end stateØyvind Harboe2010-03-181-2/+5
| | | | | | | | | | | | | jtag_get/set_end_state() is now deprecated. There were lots of places in the code where the end state was unintentionally modified. The big Q is whether there were any places where the intention was to modify the end state. 0.5 is a long way off, so we'll get a fair amount of testing. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* rename jtag_interface_{init,quit}()David Brownell2010-03-141-7/+4
| | | | | | | These routines apply to non-JTAG debug adapters too. To reduce confusion, give them better (non-misleading) names. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* jtag: simplify jtag_add_plain_ir/dr_scanØyvind Harboe2010-03-081-10/+10
| | | | | | | These fn's now clearly just clock out/in bits. No mystical fields are involved. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: jtag_add_ir_scan() now takes a single fieldØyvind Harboe2010-03-081-2/+2
| | | | | | | | In the code a single field was all that was ever used. Makes jtag_add_ir_scan() simpler and leaves more complicated stuff to jtag_add_plain_ir_scan(). Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jtag: retire tap fieldØyvind Harboe2010-03-081-7/+4
| | | | | | | | | | | | | | | | | jtag_add_dr/ir_scan() now takes the tap as the first argument, rather than for each of the fields passed in. The code never exercised the path where there was more than one tap being scanned, who knows if it even worked. This simplifies the implementation and reduces clutter in the calling code. use jtag_add_ir/dr_plain_scan() for more fancy situations. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* interface: define TMS sequence commandDavid Brownell2010-02-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | For support of SWD we need to be able to clock out special bit sequences over TMS or SWDIO. Create this as a generic operation, not yet called by anything, which is split as usual into: - upper level abstraction ... here, jtag_add_tms_seq(); - midlayer implementation logic hooking that to the lowlevel code; - lowlevel minidriver operation ... here, interface_add_tms_seq(); - message type for request queue, here JTAG_TMS. This is done slightly differently than other operations: there's a flag saying whether the interface driver supports this request. (In fact a flag *word* so upper layers can learn about other capabilities too ... for example, supporting SWD operations.) That approach (flag) lets this method *eventually* be used to eliminate pathmove() and statemove() support from most adapter drivers, by moving all that logic into the mid-layer and increasing uniformity between the various drivers. (Which will in turn reduce subtle bugginess.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* jtag.h whitespace/comment cleanupDavid Brownell2010-01-141-9/+8
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* jtag: add '-ignore-version' optionDavid Brownell2009-12-141-0/+3
| | | | | | | | | | Add a "-ignore-version" to "jtag newtap" which makes the IDCODE comparison logic optionally ignore version differences. Update the "scan_chain" command to illustrate this by showing the "*" character instead of the (ignored) version nibble. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Comment and doxygen fixesDavid Brownell2009-12-091-22/+9
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* minidriver: fix inline capability of minidriverØyvind Harboe2009-12-081-7/+5
| | | | | | | | | | | Low latency low CPU processing power systems(embedded) will benefit greatly from being able to inline certain jtag_add_xxx() fn's. The trick is that this has to be done in such a way as to allow implementing an OpenOCD API with a shared library(eventually) on a PC hosted OpenOCD. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* change #include "log.h" to <helper/log.h>Zachary T Welch2009-12-031-1/+1
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "log.h" the following form should be used. #include <helper/log.h> The exception is from .c files in the same directory.
* change #include "binarybuffer.h" to <helper/binarybuffer.h>Zachary T Welch2009-12-031-1/+1
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "binarybuffer.h" the following form should be used. #include <helper/binarybuffer.h> The exception is from .c files in the same directory.
* jtag: avoid using interp global variableZachary T Welch2009-11-301-3/+8
| | | | | Adds 'interp' field to jtag_tap_event_action structure to avoid using the global variable of same name.
* move ARRAY_SIZE macro to types.hZachary T Welch2009-11-161-8/+0
| | | | | | | | The ARRAY_SIZE macro was defined in several target files, so move it to types.h. This patch also removes two other identical macros: DIM (from jtag.h) and asizeof (from arm11.h).
* remove TAP_SCAN_BYTES macroZachary T Welch2009-11-161-3/+0
| | | | Use DIV_ROUND_UP(n, 8) instead of TAP_SCAN_BYTES macro.
* rename CEIL as DIV_ROUND_UPZachary T Welch2009-11-161-1/+1
| | | | | Improves the name of this macro, moves it to types.h, and adds a block of Doxygen comments to describe what it does.
* command_context_t -> struct command_contextZachary T Welch2009-11-131-5/+5
| | | | Remove misleading typedef and redundant suffix from struct command_context.
* use struct jtag_tap_event_actionZachary T Welch2009-11-131-5/+3
| | | | Remove useless typedef and redundant suffix from jtag_tap_event_action.
* scan_field_t -> struct scan_fieldZachary T Welch2009-11-131-11/+10
| | | | Remove useless structure typedef.
* jtag_tap_t -> struct jtag_tapZachary T Welch2009-11-131-16/+11
| | | | | Search and destroy the jtag_tap_t typedef. This also cleans up a layering violation, removing the declaration from types.h.
* finish removing deprecated/obsolete commandsDavid Brownell2009-11-091-10/+4
| | | | | | | | | | | | | | | | | | | | It's been about a year since these were deprecated and, in most cases, removed. There's no point in carrying that documentation, or backwards compatibility for "jtag_device" and "jtag_speed", around forever. (Or a few remnants of obsolete code...) Removed a few obsolete uses of "jtag_speed": - The Calao stuff hasn't worked since July 2008. (Those Atmel targets need to work with a 32KHz core clock after reset until board-specific init-reset code sets up the PLL and enables a faster JTAg clock.) - Parport speed controls don't actually work (tops out at about 1 MHz on typical HW). - In general, speed controls need to live in board.cfg files (or sometimes target.cfg files), not interface.cfg ... Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* src/jtag: remove 'extern' and wrap headers.Zachary T Welch2009-11-091-44/+54
| | | | | | | Removes the 'extern' keyword from function declarations. Wraps long prototypes to fit into 80 columns. Fixes documentation for jtag_tap_s::{,has}idcode fields.
* jtag: clean up TAP state name handlingDavid Brownell2009-10-231-8/+8
| | | | | | | | | | | | 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-231-1/+4
| | | | | | | | | | | | | | | | | | | | | - 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>
* prevent abort via polling during jtag_resetDavid Brownell2009-10-081-0/+17
| | | | | | | | | | | | | 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-081-0/+1
| | | | | | | | | | | | | | | | 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>
* Remove much #ifdeffery around _DEBUG_JTAG_IO_ usage.dbrownell2009-10-071-2/+4
| | | | | | | 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-071-1/+1
| | | | | | | | | | | - 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
* Introduced jtag_init and "jtag arp_init" to allow target scripts more ↵oharboe2009-10-061-2/+3
| | | | | | 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
* Add a new JTAG "setup" event; use for better DaVinci ICEpick support.dbrownell2009-10-051-12/+21
| | | | | | | | | | | | | | | | | 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
* added t/nsrst_assert_width commandsoharboe2009-09-291-0/+6
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2768 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* srst_gates_jtag option. at91sam9260 needs retesting, and possibly ↵oharboe2009-09-171-0/+1
| | | | | | 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-111-0/+4
| | | | | | tickle's after a TAP_RESET. git-svn-id: svn://svn.berlios.de/openocd/trunk@2696 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* reduce arm11 output noiseoharboe2009-08-261-1/+2
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2628 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Jonas Horberg [jhorberg@sauer-danfoss.com]ntfreak2009-08-181-3/+6
| | | | | | Change jtag_rclk behaviour so it can be called before the interface init function git-svn-id: svn://svn.berlios.de/openocd/trunk@2590 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Andreas Fritiofson <andreas.fritiofson@gmail.com> UTF8 fixesoharboe2009-07-171-1/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2549 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Fix doxygen warning in jtag.h caused by a changed parameter name.zwelch2009-06-301-1/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2424 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net>:zwelch2009-06-291-1/+0
| | | | | | | | | | | | | | | | | | | Warn when people (or scripts) use numeric identifiers for TAPs, instead of dotted.name values. We want this usage to go away, so that for example adding more TAPs doesn't cause config scripts to break because some sequence number changed. It's been deprecated since late 2008, but putting a warning on this should help us remove it (say, in June 2010) by helping to phase out old (ab)usage in config scripts. Other than in various config files, the only code expecting such a number was the almost unused str9xpec driver. This code was changed to use the TAP it was passed, instead of making its own dubious lookup and ignoring that TAP. git-svn-id: svn://svn.berlios.de/openocd/trunk@2415 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - Fixes '+' whitespacezwelch2009-06-231-1/+1
| | | | | | | | | | - Replace ')\(+\)(' with ') \1 ('. - Replace ')\(+\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(+\)(' with '\1 \2 ('. - Replace '\(\w\)\(+\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2373 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - Fixes '!=' whitespacezwelch2009-06-231-1/+1
| | | | | | | | | - Replace ')\(!=\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(!=\)(' with '\1 \2 ('. - Replace '\(\w\)\(!=\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2363 b42882b7-edfa-0310-969c-e2dbd0fdcd60