zwelch [Thu, 4 Jun 2009 01:22:23 +0000 (01:22 +0000)]
David Brownell <david-b@pacbell.net>:
Update the "General Commands" (a.k.a. "random stuff") chapter,
and associated chunks of other text:
- Switch to @deffn and review everything that's documented
- Improve descriptions of reset events, with reference to
the setup.tcl code which issues them.
- Move one zy1000-specific command to that driver's doc.
- There is no "script" command; remove its doc.
NOTE: Some things missing from this bit of work are:
1- Reviewing the code to catch various *missing* functions,
mostly from "target.c"
2- Alphabetizing and organizing. This chapter is a real
grab-bag with no evident focus or structural principle.
3- Hole-filling and bugfixing with respect to messaging/logging.
Example, what principle could possibly justify the tcl command
output going into the server output/log instead of just the
telnet session?
4- Not just for this chapter ... but there should be a section
with descriptions of all the supported image file formats,
so every image command can just reference that section.
zwelch [Thu, 4 Jun 2009 01:16:43 +0000 (01:16 +0000)]
David Brownell <david-b@pacbell.net>:
Minor cleanup of FT2232:
- make Olimex glue warn about Olimex issues instead of JTAGkey issues;
- make some data static+const;
- don't export some internal symbols.
zwelch [Thu, 4 Jun 2009 00:54:25 +0000 (00:54 +0000)]
David Brownell <david-b@pacbell.net>:
Convert the Interface/Dongle Config chapter's section
on drivers to use the @deffn syntax, and integrate the
presentation of the driver-specific commands with the
relevant driver. Alphabetize.
Cross-checked against the code ... several adapters were
not listed, and a few commands weren't.
(Maintainers for the versaloon and zy1000 drivers would be
good candidates to add the commands missing from those
sections...)
zwelch [Wed, 3 Jun 2009 00:59:13 +0000 (00:59 +0000)]
David Brownell <david-b@pacbell.net>:
Update docs for most of the remaining commands in jtag.c:
- switch to @deffn
- these are just the "low level" JTAG commands
- resolve much goofage!
* remove docs for non-existent commands
* add missing docs for some existing commands
* fix incorrect docs for some commands
- just index TAP states overall, not individually
- current name is "RUN/IDLE" not "IDLE"
Cross checked against the source.
This also creates an "Interface Drivers" section, analagous to how
(NOR) Flash and NAND drivers are presented; that's not yet sorted.
zwelch [Wed, 3 Jun 2009 00:56:50 +0000 (00:56 +0000)]
David Brownell <david-b@pacbell.net>:
Rework the TAP creation documentation.
- Try to use "TAP" not "tap" everywhere; it's an acronym.
- Update the associated "target config files" section:
* reference the "TAP Creation" chapter for details
* simplify: reference interesting multi-tap config files
* let's not forget CPU configuration (*before* workspace setup)
* streamline it a bit
* move that workspace-vs-mmu issue to a better location
- Clean up TAP creation doc mess
* switch to @deffn
* (re)organize the remaining stuff
* reference the "Config File Guidelines" chapter
- Tweak the "Target Configuration" chapter
* rename as "CPU configuration"; unconfuse vs. target/*.cfg
* bring out that it's not just there for GDB
* move TAP events to the TAP chapter, where they belong (bugfix)
zwelch [Wed, 3 Jun 2009 00:45:21 +0000 (00:45 +0000)]
Move the JTAG cable interface API implementation
- Cloned the src/jtag/jtag.c file to src/jtag/interface.c.
- For each for of those files, deleted the contents of the other.
- Add new source file to automake input.
zwelch [Tue, 2 Jun 2009 23:59:13 +0000 (23:59 +0000)]
Add private src/jtag/interface.h for use by JTAG interface drivers:
- Move the jtag_interface structure definition.
- Move the Cable API declarations.
- Add new header file to automake input.
The next patch will move the implementation to interface.c.
zwelch [Tue, 2 Jun 2009 23:15:12 +0000 (23:15 +0000)]
Add header file for JTAG minidriver:
- Wraps all minidriver API functions using API front-ends:
- Outlines jtag_add_dr_out() and jtag_alloc_in_value32().
- Adds interface_ prefix to existing jtag_alloc_invalue_32 routines.
- Re-inline these interface definitions in new header file.
- Re-inline parts of the (mini)driver implementations in minidriver.h.
- Replace INCLUDE_JTAG_MINIDRIVER_H with #include directives.
The next patch will finish removing '#ifdef HAVE_JTAG_MINIDRIVER_H'
from jtag.h.
ntfreak [Tue, 2 Jun 2009 21:06:12 +0000 (21:06 +0000)]
- change signature for adi_jtag_dp_scan and adi_jtag_dp_scan_u32 to use swjdp_common_t *swjdp instead of arm_jtag_t *jtag_info
- change SWJDP_IR/DR_APACC to DAP_IR/DR_APACC to conform with ARM_ADI docs.
- add swjdp->memaccess_tck field and code for extra tck clocks before accessing memory bus
- Set default memaccess value to 8 for Cortex-M3.
- Add dap memaccess command.
- document all armv7 dap cmds.
- Original patch submitted by Magnus Lundin [lundin@mlu.mine.nu].
ntfreak [Tue, 2 Jun 2009 16:07:31 +0000 (16:07 +0000)]
- hack added to fix a issue with v5/6 jlink
v5/6 jlink seems to have an issue if the first tap move is not divisible by 8, so we send a TLR on first power up
zwelch [Tue, 2 Jun 2009 07:51:16 +0000 (07:51 +0000)]
Add high-speed device support in FT2232 driver:
- Initial support for FT2232H/FT4232H devices from FTDI.
- Add --enable-ftd2xx-highspeed option to configure script.
- Original patch submitted by Joern Kaipf <lists@joernline.de>.
zwelch [Tue, 2 Jun 2009 07:05:54 +0000 (07:05 +0000)]
Continue clean-up of JTAG driver interface:
- 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.
zwelch [Tue, 2 Jun 2009 06:49:53 +0000 (06:49 +0000)]
More JTAG interface driver cleanup:
- 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.
zwelch [Tue, 2 Jun 2009 06:33:19 +0000 (06:33 +0000)]
More JTAG interface driver cleanup:
- Add jtag_callback_queue_reset() to reset the callback queue.
- Make interface_jtag_execute_queue() use new helper function.
zwelch [Tue, 2 Jun 2009 06:21:49 +0000 (06:21 +0000)]
More JTAG interface driver cleanup:
- 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.
zwelch [Tue, 2 Jun 2009 05:47:00 +0000 (05:47 +0000)]
Clean up jtag command queue handling:
- 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.
zwelch [Tue, 2 Jun 2009 03:38:50 +0000 (03:38 +0000)]
Start clean-up of JTAG driver interface:
- 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.
zwelch [Mon, 1 Jun 2009 23:30:58 +0000 (23:30 +0000)]
David Brownell <david-b@pacbell.net>:
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.
zwelch [Mon, 1 Jun 2009 23:09:19 +0000 (23:09 +0000)]
David Brownell <david-b@pacbell.net>:
Remove two sections about deprecated/removed commands, documenting
them briefly in the chapter on deprecated/removed commands. The
"working_area" command just duplicated text; "jtag_device" wasn't
listed in that chapter before.
Also start de-emphasizing those commands. Don't index them, and
include a disclaimer that their documentation may start to vanish
about a year after the code does (e.g. in January 2010).
zwelch [Mon, 1 Jun 2009 03:06:11 +0000 (03:06 +0000)]
David Brownell <david-b@pacbell.net>:
Various updates, mostly small/formatting changes:
* Small content tweaks:
- Re-title: "OpenOCD User's Guide".
- For users, URLS for latest doc and SparkFun forum
- Mention GIT-SVN
* Fix some front-matter goofage, matching texinfo docs:
- "paragraphintent" location matters
- put release version/date description with the copyright
* Fix some other stuff matching texinfo docs:
- no tabs
- tweak some refs and anchors
* whitespace-at-end-o-line fixes
zwelch [Mon, 1 Jun 2009 03:05:59 +0000 (03:05 +0000)]
David Brownell <david-b@pacbell.net>:
Split out OSK5912 board support from the omap5912 target config, and make
it pass sanity checks on my (Rev C/original) hardware:
- Fix syntax error ("-irlen" not "irlen")
- Provide real TAP ids for the ARM926ejs and the C55x dsp
- Label both CPUs appropriately (DSP, ARM)
- List both flash chips
The scan chain looks like this (note truncated DSP instruction code):
zwelch [Sun, 31 May 2009 12:38:28 +0000 (12:38 +0000)]
Final step in isolating target_type_s structure:
- Move definition of 'struct target_type_s' into new 'target_type.h' file.
- Forward delclaration remains in target.h, with comment pointing to new file.
- Replaces #define with #include in source files.
zwelch [Sun, 31 May 2009 12:10:57 +0000 (12:10 +0000)]
Whitespace-only updates to automake input files:
- use continuations to break long lines of variable assignments
- makes these variables more patch-friendly and conform to style guide
zwelch [Sun, 31 May 2009 11:32:28 +0000 (11:32 +0000)]
First step in hiding target_type_s from public interface:
- Add DEFINE_TARGET_TYPE_S symbol in files that need it defined.
- Forward declare 'struct target_type_s' only, unless that symbol is defined.
zwelch [Sun, 31 May 2009 11:30:59 +0000 (11:30 +0000)]
Add target_get_gdb_reg_list wrapper:
- replaces all calls to target->type->get_gdb_reg_list.
- add documentation in target_s to warn not to invoke callback directly.
zwelch [Sun, 31 May 2009 09:39:04 +0000 (09:39 +0000)]
Add target_bulk_write_memory wrapper:
- replaces all calls to target->type->bulk_write_memory.
- add documentation in target_s to warn not to invoke callback directly.
zwelch [Sun, 31 May 2009 09:38:43 +0000 (09:38 +0000)]
Add wrappers for target->type->examined:
- replace all checks of target->type->examined with target_was_examined().
- replace all setting of target->type->examined with target_set_examined().
- replace clearing of target->type->examined with target_reset_examined().
- add documentation in target_s to warn not to access field directly.
zwelch [Sun, 31 May 2009 09:38:20 +0000 (09:38 +0000)]
Add target_run_algorithm wrapper:
- replaces all calls to target->type->run_algorithm.
- add documentation in target_s to warn not to invoke callback directly.
zwelch [Sun, 31 May 2009 09:37:57 +0000 (09:37 +0000)]
Add target_write_memory wrapper:
- replaces all calls to target->type->write_memory.
- add documentation in target_s to warn not to invoke callback directly.
zwelch [Sun, 31 May 2009 09:37:35 +0000 (09:37 +0000)]
Add target_read_memory wrapper:
- replaces all calls to target->type->read_memory.
- add documentation in target_s to warn not to invoke callback directly.
zwelch [Sun, 31 May 2009 06:00:28 +0000 (06:00 +0000)]
Simplify the handle_md_command routine in target.c:
- fix buffer overrun in mdw; final '\0' would overflow the output buffer.
- return ERROR_COMMAND_SYNTAX_ERROR instead of ERROR_OK if:
- less than one argument is provided
- the command is called with a name other than mdb, mdh, or mdw.
- factor all command output into new handle_md_output function
zwelch [Sun, 31 May 2009 01:07:43 +0000 (01:07 +0000)]
Peter Denison <openwrt@marshadder.org>:
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.
zwelch [Sat, 30 May 2009 23:57:30 +0000 (23:57 +0000)]
Eliminate duplicated code in the handle_mw_command memory write loop.
- wordsize will always be 1, 2, or 4 due to preceeding switch statement.
- move call to keep_alive after successful writes, not upon failures
zwelch [Sat, 30 May 2009 22:23:12 +0000 (22:23 +0000)]
Encapsulate the global "jtag" jtag_interface pointer:
- Add jtag_interface_quit, factored from exit_handler() in openocd.c.
- Remove its extern declaration.
- Add static keyword to its definition.
zwelch [Sat, 30 May 2009 01:43:21 +0000 (01:43 +0000)]
David Brownell <david-b@pacbell.net>:
Provide basic documentation on the ARM ETM and ETB trace commands.
Fix minor goofs in registration of the ETM commands; and whitespace
issues in the proof-of-concept oocd_trace code. (Plus include a
ref to Dominic's email saying that it's just proof-of-concept code.)
Note that I'm still not sure whether the ETM support works. But
documenting how it's expected to work should help sort out which
behaviors are bugs, which will help get bugs patched.
ZW: whitespace changes were split out of this patch but will follow.
zwelch [Sat, 30 May 2009 01:32:19 +0000 (01:32 +0000)]
David Brownell <david-b@pacbell.net>:
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.
zwelch [Fri, 29 May 2009 04:00:51 +0000 (04:00 +0000)]
Add documentation to flash.h:
- provides low-level information about each flash API interface,
- gives driver authors some documentation about the driver interface,
- updated extensively from the original patch provided by Duane Ellis.
zwelch [Fri, 29 May 2009 01:33:04 +0000 (01:33 +0000)]
David Brownell <david-b@pacbell.net>:
Provide basic documentation for some of the other flash drivers.
avr ... looks incomplete, may work with one AVR8 microcontroller
ecosflash ... can't find docs
lpc288x ... an NXP part, driver seems lpc2888-specific
ocl ... some arm7/arm9 thing, can't find docs
pic32mx ... looks incomplete, for PIC32MX (MIPS 4K) devices
tms470 ... for TI TMS470 parts
Still seems to be mostly arm7tdmi... several of these have no
users in the current tree.