summaryrefslogtreecommitdiff
path: root/src/jtag
Commit message (Collapse)AuthorAgeFilesLines
* Continue clean-up of JTAG driver interface:zwelch2009-06-024-502/+535
| | | | | | | | | - Move all interface_jtag_* functions to jtag_driver.c. - Extern command queue routines in jtag.h (with INCLUDE_JTAG_INTERFACE_H). - Add new source file to automake inputs. git-svn-id: svn://svn.berlios.de/openocd/trunk@1996 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* More JTAG interface driver cleanup:zwelch2009-06-021-10/+9
| | | | | | | | | | | | | | - Moves references to global jtag interface to default core implementation. - Missed this reference in the earlier "pointless" patch. Mea culpa. Important: this has a side-effect. Previously, the error return inside the interface routine short-circuited the remainder of that function when 'init' has not been called. With this patch, the command queue will be cleared in the case that 'init' has been called. Since that case indicates a buggy script, this does not seem to be a problem. git-svn-id: svn://svn.berlios.de/openocd/trunk@1995 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* More JTAG interface driver cleanup:zwelch2009-06-021-3/+7
| | | | | | | | - Add jtag_callback_queue_reset() to reset the callback queue. - Make interface_jtag_execute_queue() use new helper function. git-svn-id: svn://svn.berlios.de/openocd/trunk@1994 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* More JTAG interface driver cleanup:zwelch2009-06-022-1/+13
| | | | | | | | | | | | - Make interface_jtag_execute_queue call new helper function. - Add default_interface_jtag_execute_queue to wrap jtag interface access. This patch may look useless on its own, but it helps to isolate the core JTAG variables from the interface_jtag_* routines, so the later can be moved into jtag_driver.c in a pending patch. git-svn-id: svn://svn.berlios.de/openocd/trunk@1993 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Clean up jtag command queue handling:zwelch2009-06-021-32/+17
| | | | | | | | | | | | | - Rename last_command_pointer as next_command_pointer, because this variable stores the address where jtag_queue_command() will store a command pointer. - Make that variable static, since it is only used internally in jtag.c. - Remove superfluous accessor for that now-static variable. - Deobfuscate use of variables in jtag_command_queue. - Add jtag_command_queue_reset helper function. - Use it in interface_jtag_execute_queue. git-svn-id: svn://svn.berlios.de/openocd/trunk@1992 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Encapsulate JTAG command interfaces for moving to jtag_interface.h.zwelch2009-06-021-0/+7
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1991 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Remove the useless invalidstruct from jtag.h.zwelch2009-06-021-4/+0
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1990 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Start clean-up of JTAG driver interface:zwelch2009-06-021-20/+28
| | | | | | | | | - Factor jtag_add_scan_check to call new jtag_add_scan_check_alloc helper. - Use conditional logic to define two versions of the helper. - These helpers will be moved to other files in future patches. git-svn-id: svn://svn.berlios.de/openocd/trunk@1989 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net>:zwelch2009-06-011-8/+39
| | | | | | | | | | | | | | | | | Make the TCL "drscan" and "irscan" commands finish in RUN/IDLE unless the user specifies otherwise ... usually they'd choose something like DRPAUSE or IRPAUSE, avoiding RUN/IDLE. The current "end" state is whatever the preceding commands left in "cmd_queue_end_state", which to TCL scripts isn't knowable. This change should forestall various surprises/bugs. Also check that any "end" state specified is safe in case this adapter's JTAG clock is free-running. For now, just issue a warning; eventually a hard failure is probably correct. git-svn-id: svn://svn.berlios.de/openocd/trunk@1988 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net>:zwelch2009-06-011-13/+11
| | | | | | | | Whitespace fixes in jtag.c ... mostly end-of-line crap. Flag "jtag_device" command as obsolete in its helptext. git-svn-id: svn://svn.berlios.de/openocd/trunk@1987 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Encapsulate JTAG Cable API and interface structure, plan for new header file.zwelch2009-06-0118-0/+25
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1984 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Encapsulate JTAG minidriver functions, plan for new header file.zwelch2009-06-013-19/+37
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1983 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Remove unused in_handler_t type definition from jtag.hzwelch2009-06-011-3/+0
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1982 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* added jtag_add_statemove() helper fn(actual fn written by Dick Hollonbeck, I ↵oharboe2009-06-012-0/+97
| | | | | | just moved it). git-svn-id: svn://svn.berlios.de/openocd/trunk@1980 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Whitespace-only updates to automake input files:zwelch2009-05-311-7/+25
| | | | | | | | - use continuations to break long lines of variable assignments - makes these variables more patch-friendly and conform to style guide git-svn-id: svn://svn.berlios.de/openocd/trunk@1970 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Peter Denison <openwrt@marshadder.org>:zwelch2009-05-311-1/+1
| | | | | | | | | The debugging code in jlink_tap_execute() called when _DEBUG_USB_COMMS_ is defined was using the entire cached scan length to print the results buffers, and not the correct length of each individual buffer. git-svn-id: svn://svn.berlios.de/openocd/trunk@1955 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Encapsulate the global "jtag" jtag_interface pointer:zwelch2009-05-302-3/+18
| | | | | | | | | - Add jtag_interface_quit, factored from exit_handler() in openocd.c. - Remove its extern declaration. - Add static keyword to its definition. git-svn-id: svn://svn.berlios.de/openocd/trunk@1952 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Remove unused jlink_execute_end_state (unreferenced after r1949).zwelch2009-05-301-8/+0
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1951 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* remove unused JTAG_END_STATE part 2oharboe2009-05-302-17/+0
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1950 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* remove unused JTAG_END_STATEoharboe2009-05-309-62/+0
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1949 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net>:zwelch2009-05-301-54/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it so the magic "reset_config" keywords can be provided in any order. This eliminates needless error paths, and makes it easier to define things at the right level (adapter, board, target). It also includes two other behavioral changes: (1) When "handle_reset_config" sees a parameter error, it exits without changing anything. This is best viewed as a bugfix. (Old behavior: restore defaults, even if they weren't previously active.) (2) Only the behaviors that were explicitly specified get changed. (Old behavior: everything else gets reset to the "default".) So for example you can now specify SRST drive requirements without saying anything about the three unrelated topics you previously had to specify. That second one might cause confusion for any configs that end up calling "reset_config" twice, so it will deserve to be called out in the release notes. (There were no such configurations in the current OpenOCD source tree.) Update docs accordingly. Note that at least some versions of the texi-to-html tools can't handle "@xref{with spaces}", but those work properly in PDF and in the info files. git-svn-id: svn://svn.berlios.de/openocd/trunk@1944 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Remove error_handler_t type definition; it was unused in the tree.zwelch2009-05-291-2/+0
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1943 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* SimonQian <simonqian@SimonQian.com>:zwelch2009-05-271-14/+30
| | | | | | | This patch allows the vsllink to support very large scan sizes in DMA mode. git-svn-id: svn://svn.berlios.de/openocd/trunk@1926 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - add support for cortino jtag interfacentfreak2009-05-271-1/+46
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1925 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net>:zwelch2009-05-242-3/+4
| | | | | | | | | | | | | | | Doc (mostly) update for jtag_khz: - switch to @deffn syntax - add entry for "jtag_rclk" - move deprecated "jtag_speed" into collection of deprecated calls And for ft2232, don't be the only adapter to *log* an error if RTCK is requested; it's already reported properly, like any other nonfatal command parameter. "jtag_rclk" just works as expected, without any scarey messages. git-svn-id: svn://svn.berlios.de/openocd/trunk@1910 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Submitted by Magnus Lundin <lundin@mlu.mine.nu>:zwelch2009-05-231-4/+0
| | | | | | | - Remove FTDI driver tap_set_state call; performed by jtag_add_reset. git-svn-id: svn://svn.berlios.de/openocd/trunk@1893 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Submitted by Magnus Lundin <lundin@mlu.mine.nu>:zwelch2009-05-231-1/+2
| | | | | | | | | - Add jtag_execute_queue in jtag_add_reset after interface_jtag_add_reset. - Use tap_set_state to demark TAP_RESET, instead of cmd_queue_cur_state - cmd_queue_cur_state needs to be retired. git-svn-id: svn://svn.berlios.de/openocd/trunk@1892 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Submitted by Magnus Lundin <lundin@mlu.mine.nu>:zwelch2009-05-231-21/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updates to the J-Link interface driver to support more device versions: - Add capability detection: - if capable, detect protocol version; otherwise, assume v2 protocol. - if capable, detect buffer size; otherwise, assume minimal. - Disable command result queries for devices using v2 protocol. - Defined and use JTAG2 command with v2 protocol; JTAG3 is v3 protocol. - Add TCL command to allow explicit setting of J-Link protocol version. With approval, I revised the patch to make the following changes: - add static keywords to new jlink-specific variables - factor calculation of major_version to be more readable - remove braces around simple one-line statements in if/else clauses - remove (rather than #if 0) duplicate reset code; it is in SVN - use &function to be clearer when passing function pointers - add symbols for EMU_CMD_GET_CAPS bits; do not hard-code constants! - almost renamed jlink_handle_jlink_hw_jtag_command (seriously?!?!) - rewrote that function using a switch statement. - made version request processing easier to understand and modify - improve alternate endpoint detection: - make code easier to read by using temporary variables - eliminate extra level of indentation and redundant logging - use ternary conditional to select JTAG2 or JTAG3 command - reverse version test in jlink_usb_message to reduce indentation - this had the biggest effect in cleaning up this patch - use C99's ability to declare new/changed variables with less scope - add spaces around binary operators in new/changed code - revert other superfluous whitespace/comment style changes git-svn-id: svn://svn.berlios.de/openocd/trunk@1889 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-211-2/+7
| | | | | | | | | | -jtag.c, interface_jtag_add_ir_scan() [2/2] (version without goto): - change 'found' to bool - add comments on loops git-svn-id: svn://svn.berlios.de/openocd/trunk@1876 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Thomas Kindler <mail@t-kindler.de>kc8apf2009-05-211-1/+1
| | | | | | | - Increase DTC status retry count to avoid problems with STM Primer git-svn-id: svn://svn.berlios.de/openocd/trunk@1871 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Holger Schurig <hs4233@mail.mn-solutions.de>kc8apf2009-05-211-2/+0
| | | | | | | -Prevent freezing of target when doing a 'shutdown'. git-svn-id: svn://svn.berlios.de/openocd/trunk@1869 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-211-15/+12
| | | | | | | | | | | -jtag.c, interface_jtag_add_ir_scan() [1/2]: - remove temporary scan_size and use tap->ir_length instead - slight loop restructuring to reduce indentation level git-svn-id: svn://svn.berlios.de/openocd/trunk@1868 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-211-30/+33
| | | | | | | | | | | | | -jtag.c, interface_jtag_add_dr_out(): - use pointer 'field' instead of scan->fields[field_count] - restructure the main loop to clearly separate the two cases: TAP is not bypassed / TAP is bypassed (this is to keep the function similar to interface_jtag_add_dr_scan()) - fix bug where only the first output field has its tap field set - add asserts to verify that target_tap points to the one not bypassed TAP git-svn-id: svn://svn.berlios.de/openocd/trunk@1867 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-211-37/+27
| | | | | | | | | | | | -jtag.c, interface_jtag_add_dr_scan(): - use pointer 'field' instead of scan->fields[field_count] - restructure the main loop to clearly separate the two cases: TAP is not bypassed / TAP is bypassed - add an assert that each non-bypassed TAP receives at least one field - add an assert that checks that no superfluous input fields were passed git-svn-id: svn://svn.berlios.de/openocd/trunk@1866 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-211-16/+17
| | | | | | | | | | -jtag.c, interface_jtag_add_ir_scan(): - use pointer 'field' instead of scan->fields[nth_tap] - add assertion to ensure that input data has correct size for TAP's IR git-svn-id: svn://svn.berlios.de/openocd/trunk@1865 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-211-27/+28
| | | | | | | | | | - jtag.c: consolidate output scan field initialization in scan functions - jtag.c: add cmd_queue_scan_field_clone() to handle 1:1 field copies - jtag.c: fix bug where only the first output field in a dr scan has its tap field set git-svn-id: svn://svn.berlios.de/openocd/trunk@1864 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-211-9/+0
| | | | | | | | - jtag.c: remove unused variable 'nth_tap' from DR scan functions git-svn-id: svn://svn.berlios.de/openocd/trunk@1863 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-211-44/+23
| | | | | | | | - jtag.c: Use single 'for' statement to iterate over list of TAPs in scan functions git-svn-id: svn://svn.berlios.de/openocd/trunk@1862 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-211-15/+20
| | | | | | | | - jtag.c: consolidate all memory allocations in scan functions in one block, add out_fields pointer to set stage for further changes git-svn-id: svn://svn.berlios.de/openocd/trunk@1861 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-212-31/+31
| | | | | | | | - add 'const' qualifier to function parameters in jtag.c that are not to be modified or freed by the function git-svn-id: svn://svn.berlios.de/openocd/trunk@1860 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-211-14/+76
| | | | | | | | | | - add doxygen comments to scan commands in jtag.c - move jtag_add_dr_scan next to interface_jtag_add_dr_scan to keep these function pairs together git-svn-id: svn://svn.berlios.de/openocd/trunk@1859 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Spencer Oliver <spen@spen-soft.co.uk> use 7 tms out of resetoharboe2009-05-201-3/+3
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1851 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-201-13/+12
| | | | | | | | - simplify code in interface_jtag_add_plain_dr_scan() by adding a local variable 'scan' to hold the scan_command_t git-svn-id: svn://svn.berlios.de/openocd/trunk@1849 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-201-4/+2
| | | | | | | | | - move scan_size in interface_jtag_add_dr_out() into the scope of the inner loop and change it to unsigned - move loop variable j into for scope git-svn-id: svn://svn.berlios.de/openocd/trunk@1848 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-201-16/+15
| | | | | | | | - simplify code in interface_jtag_add_dr_out() by adding a local variable 'scan' to hold the scan_command_t git-svn-id: svn://svn.berlios.de/openocd/trunk@1847 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-201-2/+1
| | | | | | | | - move scan_size in interface_jtag_add_dr_scan() into the scope of the inner loop and change it to unsigned git-svn-id: svn://svn.berlios.de/openocd/trunk@1846 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-201-18/+16
| | | | | | | | - simplify code in interface_jtag_add_dr_scan() by adding a local variable 'scan' to hold the scan_command_t git-svn-id: svn://svn.berlios.de/openocd/trunk@1845 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-201-13/+12
| | | | | | | | - simplify code in interface_jtag_add_plain_ir_scan() by adding a local variable 'scan' to hold the scan_command_t git-svn-id: svn://svn.berlios.de/openocd/trunk@1844 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-201-2/+1
| | | | | | | | - move scan_size in interface_jtag_add_ir_scan() into the scope of the inner loop and change it to unsigned git-svn-id: svn://svn.berlios.de/openocd/trunk@1843 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Michael Bruck <mbruck@digenius.de>kc8apf2009-05-201-19/+25
| | | | | | | | | - simplify code in interface_jtag_add_ir_scan() by adding a local variable 'scan' to hold the scan_command_t git-svn-id: svn://svn.berlios.de/openocd/trunk@1842 b42882b7-edfa-0310-969c-e2dbd0fdcd60