David Brownell <david-b@pacbell.net>:

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
This commit is contained in:
zwelch 2009-05-24 21:13:29 +00:00
parent 5ecae346cc
commit ad8f1b4295
3 changed files with 63 additions and 42 deletions

View File

@ -1493,53 +1493,58 @@ The OpenOCD default value is 2 and for some systems a value of 10 has proved use
Currently, there are no options available for the ep93xx interface. Currently, there are no options available for the ep93xx interface.
@section JTAG Speed @section JTAG Speed
@itemize @bullet @anchor{JTAG Speed}
@item @b{jtag_khz} <@var{reset speed kHz}> JTAG clock setup is part of system setup.
@cindex jtag_khz It @emph{does not belong with interface setup} since any interface
only knows a few of the constraints for the JTAG clock speed.
Sometimes the JTAG speed is
changed during the target initialization process: (1) slow at
reset, (2) program the CPU clocks, (3) run fast.
Both the "slow" and "fast" clock rates are functions of the
oscillators used, the chip, the board design, and sometimes
power management software that may be active.
It is debatable if this command belongs here - or in a board The speed used during reset can be adjusted using pre_reset
configuration file. In fact, in some situations the JTAG speed is and post_reset event handlers.
changed during the target initialisation process (i.e.: (1) slow at @xref{Target Events}.
reset, (2) program the CPU clocks, (3) run fast)
Speed 0 (khz) selects RTCK method. A non-zero speed is in KHZ. Hence: 3000 is 3mhz. If your system supports adaptive clocking (RTCK), configuring
JTAG to use that is probably the most robust approach.
However, it introduces delays to synchronize clocks; so it
may not be the fastest solution.
Not all interfaces support ``rtck''. If the interface device can not @b{NOTE:} Script writers should consider using @command{jtag_rclk}
support the rate asked for, or can not translate from kHz to instead of @command{jtag_khz}.
jtag_speed, then an error is returned.
Make sure the JTAG clock is no more than @math{1/6th CPU-Clock}. This is @deffn {Command} jtag_khz max_speed_kHz
especially true for synthesized cores (-S). Also see RTCK. A non-zero speed is in KHZ. Hence: 3000 is 3mhz.
JTAG interfaces usually support a limited number of
speeds. The speed actually used won't be faster
than the speed specified.
@b{NOTE: Script writers} If the target chip requires/uses RTCK - As a rule of thumb, if you specify a clock rate make
please use the command: 'jtag_rclk FREQ'. This Tcl proc (in sure the JTAG clock is no more than @math{1/6th CPU-Clock}.
startup.tcl) attempts to enable RTCK, if that fails it falls back to This is especially true for synthesized cores (ARMxxx-S).
the specified frequency.
Speed 0 (khz) selects RTCK method.
@xref{FAQ RTCK}.
If your system uses RTCK, you won't need to change the
JTAG clocking after setup.
Not all interfaces, boards, or targets support ``rtck''.
If the interface device can not
support it, an error is returned when you try to use RTCK.
@end deffn
@defun jtag_rclk fallback_speed_kHz
@cindex RTCK
This Tcl proc (defined in startup.tcl) attempts to enable RTCK/RCLK.
If that fails (maybe the interface, board, or target doesn't
support it), falls back to the specified frequency.
@example @example
# Fall back to 3mhz if RCLK is not supported # Fall back to 3mhz if RTCK is not supported
jtag_rclk 3000 jtag_rclk 3000
@end example @end example
@end defun
@item @b{DEPRECATED} @b{jtag_speed} - please use jtag_khz above.
@cindex jtag_speed
@*Limit the maximum speed of the JTAG interface. Usually, a value of zero means maximum
speed. The actual effect of this option depends on the JTAG interface used.
The speed used during reset can be adjusted using setting jtag_speed during
pre_reset and post_reset events.
@itemize @minus
@item wiggler: maximum speed / @var{number}
@item ft2232: 6MHz / (@var{number}+1)
@item amt jtagaccel: 8 / 2**@var{number}
@item jlink: maximum speed in kHz (0-12000), 0 will use RTCK
@item rlink: 24MHz / @var{number}, but only for certain values of @var{number}
@comment end speed list.
@end itemize
@comment END command list
@end itemize
@node Reset Configuration @node Reset Configuration
@chapter Reset Configuration @chapter Reset Configuration
@ -3696,6 +3701,20 @@ and @option{target cortex_m3 little reset_halt 0}.
@item @b{flash auto_erase} @item @b{flash auto_erase}
@cindex flash auto_erase @cindex flash auto_erase
@*use @option{flash write_image} command passing @option{erase} as the first parameter. @xref{flash write_image}. @*use @option{flash write_image} command passing @option{erase} as the first parameter. @xref{flash write_image}.
@item @b{jtag_speed} value
@*@xref{JTAG Speed}.
Usually, a value of zero means maximum
speed. The actual effect of this option depends on the JTAG interface used.
@itemize @minus
@item wiggler: maximum speed / @var{number}
@item ft2232: 6MHz / (@var{number}+1)
@item amt jtagaccel: 8 / 2**@var{number}
@item jlink: maximum speed in kHz (0-12000), 0 will use RTCK
@item rlink: 24MHz / @var{number}, but only for certain values of @var{number}
@comment end speed list.
@end itemize
@item @b{load_binary} @item @b{load_binary}
@cindex load_binary @cindex load_binary
@*use @option{load_image} command with same args. @xref{load_image}. @*use @option{load_image} command with same args. @xref{load_image}.
@ -3724,6 +3743,7 @@ halt
@cindex faq @cindex faq
@enumerate @enumerate
@item @b{RTCK, also known as: Adaptive Clocking - What is it?} @item @b{RTCK, also known as: Adaptive Clocking - What is it?}
@anchor{FAQ RTCK}
@cindex RTCK @cindex RTCK
@cindex adaptive clocking @cindex adaptive clocking
@* @*

View File

@ -446,7 +446,7 @@ static int ft2232_khz(int khz, int* jtag_speed)
{ {
if (khz==0) if (khz==0)
{ {
LOG_ERROR("RCLK not supported"); LOG_DEBUG("RTCK not supported");
return ERROR_FAIL; return ERROR_FAIL;
} }

View File

@ -2315,9 +2315,10 @@ int jtag_register_commands(struct command_context_s *cmd_ctx)
register_command(cmd_ctx, NULL, "interface", handle_interface_command, register_command(cmd_ctx, NULL, "interface", handle_interface_command,
COMMAND_CONFIG, "try to configure interface"); COMMAND_CONFIG, "try to configure interface");
register_command(cmd_ctx, NULL, "jtag_speed", handle_jtag_speed_command, register_command(cmd_ctx, NULL, "jtag_speed", handle_jtag_speed_command,
COMMAND_ANY, "set jtag speed (if supported)"); COMMAND_ANY, "(DEPRECATED) set jtag speed (if supported)");
register_command(cmd_ctx, NULL, "jtag_khz", handle_jtag_khz_command, register_command(cmd_ctx, NULL, "jtag_khz", handle_jtag_khz_command,
COMMAND_ANY, "same as jtag_speed, except it takes maximum khz as arguments. 0 KHz = RTCK."); COMMAND_ANY, "set maximum jtag speed (if supported); "
"parameter is maximum khz, or 0 for adaptive clocking (RTCK).");
register_command(cmd_ctx, NULL, "jtag_device", handle_jtag_device_command, register_command(cmd_ctx, NULL, "jtag_device", handle_jtag_device_command,
COMMAND_CONFIG, "jtag_device <ir_length> <ir_expected> <ir_mask>"); COMMAND_CONFIG, "jtag_device <ir_length> <ir_expected> <ir_mask>");
register_command(cmd_ctx, NULL, "reset_config", handle_reset_config_command, register_command(cmd_ctx, NULL, "reset_config", handle_reset_config_command,