zwelch [Fri, 12 Jun 2009 22:06:02 +0000 (22:06 +0000)]
David Brownell <david-b@pacbell.net>:
Currently the "debug_level 3" command tracing ignores commands
that could return values to TCL scripts (by plugging in to a
slightly lower level of the interpreter stack).
Fix that by abstracting the tracing command and starting to
make some of those previously-untraced commands use this new
mechanism.
zwelch [Fri, 12 Jun 2009 21:53:17 +0000 (21:53 +0000)]
David Brownell <david-b@pacbell.net>:
Move the discussion of the "scan_chain" command up to go with
the presentation of that topic in the TAP declaration chapter.
This makes the presentation of the TAP and target lists be
parallel, which will be something of an aid to understanding
that they are different (and how).
zwelch [Fri, 12 Jun 2009 21:43:53 +0000 (21:43 +0000)]
David Brownell <david-b@pacbell.net>:
Partial fix to the "long IR length" problems.
- Current code could handle up to 32 bit IR lengths with
full functionality, if it didn't just reject may of them
out of hand. So only reject clear errors, where the IR
mask (or capture instruction) needs more than IrLen bits.
- Longer IR lengths can only be handled in BYPASS mode
for now. Example: TI's DSPs use 38-bit IR lengths.
So we can't issue their IDCODE instructions...
A more complete fix would be able to issue longer instructions;
or minimally, would fail cleanly for the non-BYPASS case.
Note that this *could* make some currently broken scripts fail,
since the previous code accepted garbage values so long as
they didn't use more than 16 bits.
zwelch [Fri, 12 Jun 2009 04:14:28 +0000 (04:14 +0000)]
Further cleanup to MIPS target read/write memory function:
- Move the mips32_..._read_mem calls to top-level of read_mem function.
- Change: Only perform mips_m4k_read_mem conversion when retval == ERROR_OK.
- Prevents pointless conversions of bogus read values after failures.
- Eliminate retval variable from mips_m4k_write_mem; return directly.
- Move declaration of retval variable to point of first use.
- Remove the now redundant switch statements testing size:
- argument sanitizing already covers these cases.
zwelch [Fri, 12 Jun 2009 04:14:18 +0000 (04:14 +0000)]
David Claffey <dnclaffey@gmail.com>:
This patch helps fix MIPS big endian (elf32-tradbigmips) targets.
If "-endian big" is not set in target create, the endianess defaults to
little. mw and md commands will still work, but binary file loads will
have the incorrect word order loaded into memory.
The EJTAG processor access data register (PrAcc) is little endian
regardless of the CPU endianness; it is always loaded LSB first. This
is confirmed by the fact that mips_ejtag_drscan_32() uses buf_set_u32()
to load the scan field; buf_set_u32() is a little-endian formatter. For
big endian targets, data buffers have to be modified so the LSB of each
u32 or u16 is at the lower (first) memory location. If the drscan
out_value word order is set using buf_set_u32() then it makes sense to
also fixup the in_value with buf_get_u32(); a symmetry argument. This
has no affect on little endian hosts.
zwelch [Fri, 12 Jun 2009 01:41:00 +0000 (01:41 +0000)]
Improve vsllink command argument handling:
- Bug fix: Always clear high bit of USB bulk out endpoint.
- Use parse_ulong helpers to ensure numeric strings are parsed properly.
zwelch [Fri, 12 Jun 2009 01:40:48 +0000 (01:40 +0000)]
Improve VID/PID command argument handling in FTDI driver:
- Bug fix: Return a syntax error when less than two arguments are given.
- Bug fix: Use parse_u16 helper to ensure vales are parsed properly.
- Simplify loop termination logic by ensuring argc is always even.
- Move loop induction variable declaration to where it is used.
zwelch [Fri, 12 Jun 2009 01:40:42 +0000 (01:40 +0000)]
Improve handle_irscan_command:
- Use parse_u32 helper to ensure scan values are parsed properly.
- Clear the fields buffer to ensure partial cleanup occur correctly.
zwelch [Fri, 12 Jun 2009 01:40:23 +0000 (01:40 +0000)]
Simplify and improve gw16012_handle_parport_command:
- Show the port number to the user when asking for it or setting it.
- Print an error if the parport_port has already been set.
- Use parse_u16 helper to ensure the parport_port string parses correctly.
zwelch [Fri, 12 Jun 2009 01:40:17 +0000 (01:40 +0000)]
Simplify and improve amt_jtagaccel_handle_parport_port_command:
- Show the port number to the user when asking for it or setting it.
- Print an error if the amt_jtagaccel_port has already been set.
- Use parse_u16 helper to ensure amt_jtagaccel_port string parses correctly.
zwelch [Fri, 12 Jun 2009 01:40:03 +0000 (01:40 +0000)]
Simplify and improve parport_handle_parport_port_command:
- Show the port number to the user when asking for it or setting it.
- Print an error if the parport_port has already been set.
- Use parse_u16 helper to ensure the parport_port string parses correctly.
zwelch [Fri, 12 Jun 2009 01:39:57 +0000 (01:39 +0000)]
Simplify and improve handle_debug_level_comamnd:
- Bug fix: Return a syntax error if more than one argument is given.
- Bug fix: Use new parse_uint helper ensure debug_level parses correctly.
- Change: Display the debug_level after it has been set.
- Simplify bounds checking of debug_level.
zwelch [Fri, 12 Jun 2009 01:39:51 +0000 (01:39 +0000)]
Simplify handle_sleep_command:
- Use new parse_ulong to ensure duration parses as a valid number.
- Rework logic to improve readability and seliminate uperfluous braces.
- Change whitespace to improve style.
zwelch [Thu, 11 Jun 2009 21:48:36 +0000 (21:48 +0000)]
David Brownell <david-b@pacbell.net>:
Rework the "Simple Configuration Files" chapter so it's more
of a quick-start "how to set up your project" tutorial:
- Say how to hook up the JTAG adapter. This will help new
users, and in any case is worth spelling out somewhere.
- Streamline the previous rather haphazard presentation,
filling in some missing holes along the way:
* Suggest "project directory" structure
* Introduce new term, "user config" file (openocd.cfg)
* Talk about more options for openocd.cfg contents
* ... and about creating new config files
* Add new topic, project-specific utilities (+examples)
- Remove too-short, yet duplicative, chapter 19
Nudge packagers a bit more strongly to send patches (including
config files) upstream.
zwelch [Thu, 11 Jun 2009 21:23:24 +0000 (21:23 +0000)]
David Brownell <david-b@pacbell.net>:
Update "arm9tdmi vector_catch" command description to highlight both
use cases (display configuration, or first change that config) and
to explain a bit more about what this is: an alternative to using
hardware breakpoint resources.
Note that I tried this on an arm920t, but it didn't work. Set bits,
then examined them and they weren't set. And it didn't seem to act
as if vector triggering was noticed, either.
Also some minor unrelated tweaks: @ignore some unused or don't-use
event names; fix a few typos; tweak chip-specific reset descriptions.
zwelch [Thu, 11 Jun 2009 11:43:07 +0000 (11:43 +0000)]
Factor handle_bp_command into pieces:
- Bug fix: return a syntax error if the wrong number of arguments are given.
- Add handle_bp_command_list() and handle_bp_command_set().
- Use temporary addr variable to eliminate redundant strtoul() calls.
- Place variable declarations at their point of first use.
zwelch [Thu, 11 Jun 2009 11:43:00 +0000 (11:43 +0000)]
Factor target_timer_callbacks_check_time into pieces:
- Add target_timer_callback_periodic_restart and target_call_timer_callback.
- Clean up and simplify logic that determines whether to call each callback.
- Move variable declarations to location of first use.
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.