zwelch [Thu, 11 Jun 2009 11:42:47 +0000 (11:42 +0000)]
Simplify and fix target handle_rwp_command routine:
- Return syntax error unless exactly one argument is passed.
- Move variable declaration to point of first use.
zwelch [Thu, 11 Jun 2009 11:42:33 +0000 (11:42 +0000)]
Simplify handle_resume_command:
- Eliminate redundant calls to target_resume with addr temp variable.
- Place variables at location of first use.
- Fix minor whitespace issues.
zwelch [Thu, 11 Jun 2009 11:42:26 +0000 (11:42 +0000)]
Simplify and fix handle_step_command:
- Bug fix: return syntax error when more than one argument is given.
- Eliminate redundant calls to step callback with addr temp variable.
- Place variables at location of first use.
zwelch [Wed, 10 Jun 2009 04:08:32 +0000 (04:08 +0000)]
David Brownell <david-b@pacbell.net>:
Tweak the csb337 code so that it doesn't enable alignment traps when
it completes the "reset init" sequence. It turns out that the current
CFI code reliably triggers such traps.
zwelch [Wed, 10 Jun 2009 04:06:25 +0000 (04:06 +0000)]
Move the documentation for the "poll" command up with
other server configuration. Explain what it's about;
reference the related "$target_name curstate" method.
Update "poll" output to report whether background polling
is enabled or not.
Also fix a small typo; PC's have "complementary" tools.
Some have also "complimentary" ones; but not all.
zwelch [Tue, 9 Jun 2009 14:18:28 +0000 (14:18 +0000)]
Improve use of automake conditionals for FTDI-based JTAG drivers:
- Remove once-used XXX_FTD2XX symbols; replace with XXX_DRIVER symbols.
- Enabled when either libftdi or FTD2xx driver should be built.
- Eliminates redundant DRIVERSFILE assignment in JTAG automake input.
zwelch [Tue, 9 Jun 2009 14:18:23 +0000 (14:18 +0000)]
Simplify JTAG automake input file:
- Consolidate all individual driver variables into DRIVERFILES.
- Eliminates all empty 'else' conditional clauses.
- Move minidriver files to top of file.
- Use MINIDRIVER conditional to build only driver(s) that will be linked.
- Eliminate superfluous whitespace.
zwelch [Tue, 9 Jun 2009 10:07:07 +0000 (10:07 +0000)]
Encapsulate the core jtag interface pointer:
- Add new jtag_config_khz to increase encapsulation of jtag->khz call.
- Add new jtag_get_speed_readable to encapsulate of jtag->speed_div call.
- Make definition of jtag static in core.c, remove extern from tcl.c.
zwelch [Tue, 9 Jun 2009 08:41:36 +0000 (08:41 +0000)]
Continue encapsulation of JTAG event callback sub-API:
- Move jtag_event_callbacks struct to core.c; it's an implementation detail.
- Move jtag_*_event_callbacks next to the definition of the new function type.
zwelch [Tue, 9 Jun 2009 08:41:29 +0000 (08:41 +0000)]
Add jtag_event_handler_t:
- Define the function signature used by the JTAG event callback mechanism.
- Provide Doxygen block for new type, including TODO for its return value.
zwelch [Tue, 9 Jun 2009 08:41:14 +0000 (08:41 +0000)]
Improve encapsulation of JTAG event handling:
- Move nvp_jtag_tap_event and jtag_tap_handle_event to tcl.c.
- Change both to be static; remove declaration of function from jtag.h.
zwelch [Tue, 9 Jun 2009 08:41:00 +0000 (08:41 +0000)]
Cleanup and encapsulate IR Capture verification:
- Add accessors for setting the jtag_verify_capture_ir flag.
- Use them in handle_verify_ircapture_cpmmand
- Change variable type to bool; make it static.
zwelch [Tue, 9 Jun 2009 08:40:46 +0000 (08:40 +0000)]
Move the jtag_error helper routines out of header file:
- Makes jtag_error static, add new get helper function for completeness.
- Improve and add documentation and style for these helpers.
zwelch [Tue, 9 Jun 2009 08:40:31 +0000 (08:40 +0000)]
Encapsulate jtag_reset_config using accessors:
- Update handle_reset_config_command in tcl.c to use new helpers.
- Replace direct accesses in JTAG interface and target drivers.
zwelch [Tue, 9 Jun 2009 08:40:10 +0000 (08:40 +0000)]
Add get and set accessors for jtag_speed:
- Setter calls the interface driver callback to improve core encapsulation.
- Use getter in standard JTAG interface drivers and ZY1000 minidriver.
zwelch [Tue, 9 Jun 2009 08:39:50 +0000 (08:39 +0000)]
Encapsulate the jtag_trst and jtag_srst variables:
- Add accessor functions to return their value.
- Use new SRST accessor in cortex_m3.c and mips_m4k.c
zwelch [Tue, 9 Jun 2009 04:15:13 +0000 (04:15 +0000)]
Split main jtag.c file into two layers:
- src/jtag/core.c: contains the low-level JTAG TAP and scanning routines.
- src/jtag/tcl.c: contains high-level JTAG TCL commands that use the core.
- Remove static keywords from routines in core.c, extern from tcl.c:
- jtag, jtag_interface global variables
- jtag_{examine,validate}_chain and jtag_tap_{init,free} functions
- Added myself to the copyright header in both of these files.
- Used 'svn cp' to add files, so versioning was preserved for both.
zwelch [Tue, 9 Jun 2009 02:23:44 +0000 (02:23 +0000)]
Cleanup jtag_tap_by_abs_position:
- Remove unused orig_n local variable.
- Merge variable declaration with first use.
- Update code to use current style guidelines.
zwelch [Tue, 9 Jun 2009 02:23:27 +0000 (02:23 +0000)]
Simplify and fix bug in jtag_tap_by_string:
- Bug fix: Use unsigned type and strtoul when parsing for position number.
- Simplify logic by returning directly when a tap is found by name.
- Reduce scope: declare temporary variables with first use.
- Bring code up to current style guidelines.
zwelch [Tue, 9 Jun 2009 01:16:35 +0000 (01:16 +0000)]
Change jtag_add_pathmove to set jtag_error rather than call exit():
- Add new error codes to encode the possible failure conditions.
- Add documentation to describe the routine's possible error codes.
zwelch [Tue, 9 Jun 2009 01:16:19 +0000 (01:16 +0000)]
Reduce scope or eliminate temporary variables in jtag_add_statemove:
- Change types of tms_bits and tms_count to unsigned, eliminates a cast.
- Use moves[] only if needed; a single move can use goal_state directly.
- Declare loop induction variable inside its control statement.
- Remove retval in favor of direct returns.
zwelch [Tue, 9 Jun 2009 00:58:23 +0000 (00:58 +0000)]
David Brownell <david-b@pacbell.net>:
Add configuration for an old AT91rm9200 board, the Cogent CSB 337.
Worth noting from the OpenOCD perspective:
- It got a real hardware trace port connector; wired up here as
much as we can, lacking inexpensive trace-aware dongles.
- This is the first in-tree use of the "arm920t cp15" command.
It adjusts the CPU clocking and enables i-cache, which gives
more than 4x speedup after booting Linux; it's visible even
just running U-Boot.
zwelch [Mon, 8 Jun 2009 13:12:17 +0000 (13:12 +0000)]
Factor interface list to its own command:
- Add handle_interface_list_command, used by handle_interface_command.
- Display output of new list to command console.
- Change first index of displayed drivers to 1; it's only cosmetic.
zwelch [Mon, 8 Jun 2009 13:12:12 +0000 (13:12 +0000)]
Cleanup and simplify handle_interface_command:
- Reduce indent: invert logic of strcmp test.
- Reduce scope: declare variables upon first use in loops.
- Reduce unsaid: compare end of table with NULL.
- Remove superfluous braces around blocks with one statment.
- Improve language that introduces the list of built-in drivers.
zwelch [Mon, 8 Jun 2009 10:58:28 +0000 (10:58 +0000)]
Simplify jtag_add_sleep:
- Add todo for removing keep_alive: is this a layering violation?
- Use jtag_set_error instead of accessing jtag_error directly.
- Remove superfluous retval temporary variable and empty return.
zwelch [Mon, 8 Jun 2009 10:57:18 +0000 (10:57 +0000)]
Simplify jtag_add_pathmove:
- Use jtag_set_error instead of accessing jtag_error directly.
- Eliminate superfluous retval temporary variable.
- Reduce scope of loop induction variable.
- Wrap to fit within 80 columns.
zwelch [Mon, 8 Jun 2009 10:56:49 +0000 (10:56 +0000)]
Simplify jtag_add_plain_dr_scan:
- Use jtag_set_error instead of accessing jtag_error directly.
- Wrap function arguments to fit everything in 80 columns.
- Move retval variable to location of first use.
zwelch [Mon, 8 Jun 2009 10:56:36 +0000 (10:56 +0000)]
Simplify jtag_add_dr_scan:
- Use jtag_set_error instead of accessing jtag_error directly.
- Wrap function arguments to fit everything in 80 columns.
- Move retval variable to location of first use.
zwelch [Mon, 8 Jun 2009 10:56:25 +0000 (10:56 +0000)]
Simplify jtag_add_plain_ir_scan:
- Use jtag_set_error instead of accessing jtag_error directly.
- Wrap function arguments to fit everything in 80 columns.
zwelch [Mon, 8 Jun 2009 10:56:18 +0000 (10:56 +0000)]
Simplify jtag_add_ir_scan_noverify:
- Use jtag_set_error instead of accessing jtag_error directly.
- Wrap and rename function arguments to fit everything in 80 columns.
- Move retval variable to location of first use.
zwelch [Mon, 8 Jun 2009 10:56:07 +0000 (10:56 +0000)]
Simplify jtag_execute_queue:
- Add static inline jtag_error_clear helper to return and clear jtag_error.
- Use new helper to shrink body of function to two lines.
zwelch [Mon, 8 Jun 2009 10:55:44 +0000 (10:55 +0000)]
Cleanup handle_runtest_command:
- Make command argument require exactly one argument; do not allow extras.
- Remove superfluous whitespace at end of function.
- Wrap function arguments to fit in 80 columns.
zwelch [Mon, 8 Jun 2009 10:55:36 +0000 (10:55 +0000)]
Clean up handle_jtag_reset_command:
- Make command require exactly two arguments; do not allow more than two.
- Move temporary variable declarations closer to point of first use.
- Remove superfluous braces around single statments.
- Wrap to 80 column width.
zwelch [Mon, 8 Jun 2009 10:55:24 +0000 (10:55 +0000)]
Extend handle_jtag_n{s,t}rst_delay_command routines:
- Add support to display the reset delays too, like the other commands.
- Always show the values, so users can see if they are being redundant.
zwelch [Mon, 8 Jun 2009 10:54:52 +0000 (10:54 +0000)]
Update JTAG reset delay command handlers:
- Fixes for error handling:
- Return a syntax error instead of calling exit(-1).
- Return error when more than one argument is provided too.
- Remove useless braces and indent after the if/return statements.
- Wrap function arguments to fit in 80 columns.
oharboe [Mon, 8 Jun 2009 06:18:13 +0000 (06:18 +0000)]
David Brownell <david-b@pacbell.net> Bugfix: $target_name cget/configure -work-area-backup commands
should return the "is it backed up?" flag, not the work area size.
oharboe [Mon, 8 Jun 2009 06:16:43 +0000 (06:16 +0000)]
David Brownell <david-b@pacbell.net>
- Don't let disabled TAPs be set as the current target
- Improve "targets" output:
* Remove undesirable "chain position" number; we discourage using them
* TAP and Target column updates:
+ make them long enough for current usage
+ improve labels, removing guesswork
+ "TapName" label patches scan_chain output
* Highlight the "current" target
* Display "tap disabled" as a new pseudo-state
* Update docs accordingly
zwelch [Mon, 8 Jun 2009 04:35:05 +0000 (04:35 +0000)]
Reorder configure script macros:
- Check for a compiler before looking for libraries or header files.
- Initialize automake before calling other AM_ macros.
- Disable libtool shared libraries by default.
- Remove checks for unused C++, Fortran, and Java compilers.
- Remove redundant AC_CANONICAL_HOST; called by AC_PROG_LIBTOOL.
zwelch [Mon, 8 Jun 2009 04:34:45 +0000 (04:34 +0000)]
Rework parallel port configure script option handling:
- Move AC_ARG_ENABLE for secondary parallel port options:
- These macros cause their configure options to appear unconditionally,
so they should not be placed inside conditional logic.
- Groups them with primary parallel port driver option.
- Update these options to show '-' instead of '_'; both still work.
- Update command help text to show host architecture/OS requirements.
- Display a warning when these options have been provided and the
configure script will ignore the setting that the user specified.
zwelch [Mon, 8 Jun 2009 00:42:15 +0000 (00:42 +0000)]
Finish off the dummy minidriver integration:
- Try to disambiguates minidriver options from "standard" driver options.
- Make minidummy symbols more explict about being a minidriver.
- Move minidummy.c into minidummy directory to put it with its header.
In configure.in:
- Improve configuration option to allow new minidriver implementations:
- Change option from --enable-minidummy to --enable-minidriver-dummy.
- Move it to the end of the list of options.
- Provides a clear pattern for future minidrivers.
- Update handling of HAVE_JTAG_MINIDRIVER_H:
- Check for external jtag_minidriver.h only with --enable-ecosboard.
- Otherwise, define it when --enable-minidriver-dummy is provided.
- Add check to ensure only one minidriver is enabled.
- When a minidriver is enabled, warn user that standard drivers are not built.
- Use proper AC_DEFINE semantics with MINIDRIVER_DUMMY.
In src/jtag/Makefile.am:
- Restructure handling of minidummy source files.
- Include minidummy driver header in the distribution.
In src/jtag/jtag.c:
- Restructure preprocessor logic to include:
- only one minidriver, or
- all configured standard drivers.
zwelch [Sun, 7 Jun 2009 23:35:29 +0000 (23:35 +0000)]
David Brownell <david-b@pacbell.net>:
Let disabled targets be ignored during normal operation:
- In target_examine(), ignore disabled TAPs
- Reset handling must not poke at them either:
* fail $target_name arp_* operations on disabled TAPs
* in startup.tcl, don't even issue the arp_* wait ops
ZW: removed superfluous braces from the patch to target.c.
zwelch [Sun, 7 Jun 2009 23:10:50 +0000 (23:10 +0000)]
David Brownell <david-b@pacbell.net>:
Various minor tweaks for the User's guide.
- Fix various minor (but repeated) typographic goofs;
- Talk about TAP "declaration" not "creation" (they exist
even if OpenOCD never learns about their board);
- Encourage board.cfg for reset config, not target.cfg
- Fill in some missing information (e.g. x16_as_x8)
- Add a cross reference to the FAQ on TAP ordering;
- Unclutter the concept index a bit (re core-specific commands)
- Provide a bit more info about TAP states