From: David Brownell Date: Mon, 9 Nov 2009 21:16:32 +0000 (-0800) Subject: finish removing deprecated/obsolete commands X-Git-Tag: v0.4.0-rc1~869 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=d70d9634bf6ab73ec4f2ac1e77012785770b460a finish removing deprecated/obsolete commands It's been about a year since these were deprecated and, in most cases, removed. There's no point in carrying that documentation, or backwards compatibility for "jtag_device" and "jtag_speed", around forever. (Or a few remnants of obsolete code...) Removed a few obsolete uses of "jtag_speed": - The Calao stuff hasn't worked since July 2008. (Those Atmel targets need to work with a 32KHz core clock after reset until board-specific init-reset code sets up the PLL and enables a faster JTAg clock.) - Parport speed controls don't actually work (tops out at about 1 MHz on typical HW). - In general, speed controls need to live in board.cfg files (or sometimes target.cfg files), not interface.cfg ... Signed-off-by: David Brownell --- diff --git a/doc/openocd.texi b/doc/openocd.texi index 8e1d1a8f60..86f5748f60 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -81,7 +81,6 @@ Free Documentation License''. * TFTP:: TFTP * GDB and OpenOCD:: Using GDB and OpenOCD * Tcl Scripting API:: Tcl Scripting API -* Upgrading:: Deprecated/Removed Commands * FAQ:: Frequently Asked Questions * Tcl Crash Course:: Tcl Crash Course * License:: GNU Free Documentation License @@ -6507,91 +6506,6 @@ We should add support for a variable like Tcl variable is jim, not real tcl). @end quotation -@node Upgrading -@chapter Deprecated/Removed Commands -@cindex Deprecated/Removed Commands -Certain OpenOCD commands have been deprecated or -removed during the various revisions. - -Upgrade your scripts as soon as possible. -These descriptions for old commands may be removed -a year after the command itself was removed. -This means that in January 2010 this chapter may -become much shorter. - -@itemize @bullet -@item @b{arm7_9 fast_writes} -@cindex arm7_9 fast_writes -@*Use @command{arm7_9 fast_memory_access} instead. -@xref{arm7_9 fast_memory_access}. -@item @b{endstate} -@cindex endstate -@*An buggy old command that would not really work since background polling would wipe out the global endstate -@item @b{arm7_9 force_hw_bkpts} -@*Use @command{gdb_breakpoint_override} instead. Note that GDB will use hardware breakpoints -for flash if the GDB memory map has been set up(default when flash is declared in -target configuration). @xref{gdb_breakpoint_override}. -@item @b{arm7_9 sw_bkpts} -@*On by default. @xref{gdb_breakpoint_override}. -@item @b{daemon_startup} -@*this config option has been removed, simply adding @option{init} and @option{reset halt} to -the end of your config script will give the same behaviour as using @option{daemon_startup reset} -and @option{target cortex_m3 little reset_halt 0}. -@item @b{dump_binary} -@*use @option{dump_image} command with same args. @xref{dump_image}. -@item @b{flash erase} -@*use @option{flash erase_sector} command with same args. @xref{flash erase_sector}. -@item @b{flash write} -@*use @option{flash write_bank} command with same args. @xref{flash write_bank}. -@item @b{flash write_binary} -@*use @option{flash write_bank} command with same args. @xref{flash write_bank}. -@item @b{flash auto_erase} -@*use @option{flash write_image} command passing @option{erase} as the first parameter. @xref{flash write_image}. - -@item @b{jtag_device} -@*use the @command{jtag newtap} command, converting from positional syntax -to named prefixes, and naming the TAP. -@xref{jtag newtap}. -Note that if you try to use the old command, a message will tell you the -right new command to use; and that the fourth parameter in the old syntax -was never actually used. -@example -OLD: jtag_device 8 0x01 0xe3 0xfe -NEW: jtag newtap CHIPNAME TAPNAME \ - -irlen 8 -ircapture 0x01 -irmask 0xe3 -@end example - -@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} -@*use @option{load_image} command with same args. @xref{load_image}. -@item @b{run_and_halt_time} -@*This command has been removed for simpler reset behaviour, it can be simulated with the -following commands: -@smallexample -reset run -sleep 100 -halt -@end smallexample -@item @b{target} <@var{type}> <@var{endian}> <@var{jtag-position}> -@*use the create subcommand of @option{target}. -@item @b{target_script} <@var{target#}> <@var{eventname}> <@var{scriptname}> -@*use <@var{target_name}> configure -event <@var{eventname}> "script <@var{scriptname}>" -@item @b{working_area} -@*use the @option{configure} subcommand of @option{target} to set the work-area-virt, work-area-phy, work-area-size, and work-area-backup properties of the target. -@end itemize - @node FAQ @chapter FAQ @cindex faq diff --git a/src/jtag/core.c b/src/jtag/core.c index 8bb45bcdf5..bbe7425fbe 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -1569,13 +1569,6 @@ static int jtag_set_speed(int speed) return jtag ? jtag->speed(speed) : ERROR_OK; } -int jtag_config_speed(int speed) -{ - LOG_DEBUG("handle jtag speed"); - clock_mode = CLOCK_MODE_SPEED; - return jtag_set_speed(speed); -} - int jtag_config_khz(unsigned khz) { LOG_DEBUG("handle jtag khz"); diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h index c5bee07576..1dfefdef59 100644 --- a/src/jtag/jtag.h +++ b/src/jtag/jtag.h @@ -254,31 +254,25 @@ int jtag_call_event_callbacks(enum jtag_event event); /// @returns The current JTAG speed setting. int jtag_get_speed(void); + /** * Given a @a speed setting, use the interface @c speed_div callback to * adjust the setting. * @param speed The speed setting to convert back to readable KHz. * @returns ERROR_OK if the interface has not been initialized or on success; - * otherwise, the error code produced by the @c speed_div callback. + * otherwise, the error code produced by the @c speed_div callback. */ int jtag_get_speed_readable(int *speed); -/** - * Set the JTAG speed. This routine will call the underlying - * interface @c speed callback, if the interface has been initialized. - * @param speed The new speed setting. - * @returns ERROR_OK during configuration or on success, or an error - * code returned from the interface @c speed callback. - */ -int jtag_config_speed(int speed); - /// Attempt to configure the interface for the specified KHz. int jtag_config_khz(unsigned khz); + /** * Attempt to enable RTCK/RCLK. If that fails, fallback to the * specified frequency. */ int jtag_config_rclk(unsigned fallback_speed_khz); + /// Retreives the clock speed of the JTAG interface in KHz. unsigned jtag_get_speed_khz(void); diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index c064a82561..574f266ee4 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -55,10 +55,8 @@ extern jtag_interface_t *jtag_interface; static int handle_interface_list_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); static int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -static int handle_jtag_speed_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); static int handle_jtag_khz_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); static int handle_jtag_rclk_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -static int handle_jtag_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); static int handle_reset_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); static int handle_jtag_nsrst_delay_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); static int handle_jtag_ntrst_delay_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); @@ -615,15 +613,11 @@ int jtag_register_commands(struct command_context_s *cmd_ctx) register_command(cmd_ctx, NULL, "interface_list", &handle_interface_list_command, COMMAND_ANY, "list all built-in interfaces"); - register_command(cmd_ctx, NULL, "jtag_speed", handle_jtag_speed_command, - COMMAND_ANY, "(DEPRECATED) set jtag speed (if supported)"); register_command(cmd_ctx, NULL, "jtag_khz", handle_jtag_khz_command, COMMAND_ANY, "set maximum jtag speed (if supported); " "parameter is maximum khz, or 0 for adaptive clocking (RTCK)."); register_command(cmd_ctx, NULL, "jtag_rclk", handle_jtag_rclk_command, COMMAND_ANY, "fallback_speed_khz - set JTAG speed to RCLK or use fallback speed"); - register_command(cmd_ctx, NULL, "jtag_device", handle_jtag_device_command, - COMMAND_CONFIG, "(DEPRECATED) jtag_device "); register_command(cmd_ctx, NULL, "reset_config", handle_reset_config_command, COMMAND_ANY, "reset_config " @@ -748,67 +742,6 @@ static int handle_interface_list_command(struct command_context_s *cmd_ctx, return ERROR_OK; } -static int handle_jtag_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) -{ - int e; - char buf[1024]; - Jim_Obj *newargs[ 10 ]; - /* - * CONVERT SYNTAX - * argv[-1] = command - * argv[ 0] = ir length - * argv[ 1] = ir capture - * argv[ 2] = ir mask - * argv[ 3] = not actually used by anything but in the docs - */ - - if (argc < 4) { - command_print(cmd_ctx, "OLD DEPRECATED SYNTAX: Please use the NEW syntax"); - return ERROR_OK; - } - command_print(cmd_ctx, "OLD SYNTAX: DEPRECATED - translating to new syntax"); - command_print(cmd_ctx, "jtag newtap CHIP TAP -irlen %s -ircapture %s -irvalue %s", - args[0], - args[1], - args[2]); - command_print(cmd_ctx, "Example: STM32 has 2 taps, the cortexM3(len4) + boundaryscan(len5)"); - command_print(cmd_ctx, "jtag newtap stm32 cortexm3 ....., thus creating the tap: \"stm32.cortexm3\""); - command_print(cmd_ctx, "jtag newtap stm32 boundary ....., and the tap: \"stm32.boundary\""); - command_print(cmd_ctx, "And then refer to the taps by the dotted name."); - - newargs[0] = Jim_NewStringObj(interp, "jtag", -1); - newargs[1] = Jim_NewStringObj(interp, "newtap", -1); - sprintf(buf, "chip%d", jtag_tap_count()); - newargs[2] = Jim_NewStringObj(interp, buf, -1); - sprintf(buf, "tap%d", jtag_tap_count()); - newargs[3] = Jim_NewStringObj(interp, buf, -1); - newargs[4] = Jim_NewStringObj(interp, "-irlen", -1); - newargs[5] = Jim_NewStringObj(interp, args[0], -1); - newargs[6] = Jim_NewStringObj(interp, "-ircapture", -1); - newargs[7] = Jim_NewStringObj(interp, args[1], -1); - newargs[8] = Jim_NewStringObj(interp, "-irmask", -1); - newargs[9] = Jim_NewStringObj(interp, args[2], -1); - - command_print(cmd_ctx, "NEW COMMAND:"); - sprintf(buf, "%s %s %s %s %s %s %s %s %s %s", - Jim_GetString(newargs[0], NULL), - Jim_GetString(newargs[1], NULL), - Jim_GetString(newargs[2], NULL), - Jim_GetString(newargs[3], NULL), - Jim_GetString(newargs[4], NULL), - Jim_GetString(newargs[5], NULL), - Jim_GetString(newargs[6], NULL), - Jim_GetString(newargs[7], NULL), - Jim_GetString(newargs[8], NULL), - Jim_GetString(newargs[9], NULL)); - - e = jim_jtag_command(interp, 10, newargs); - if (e != JIM_OK) { - command_print(cmd_ctx, "%s", Jim_GetString(Jim_GetResult(interp), NULL)); - } - return e; -} - static int handle_scan_chain_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { jtag_tap_t *tap; @@ -1106,29 +1039,6 @@ static int handle_jtag_ntrst_assert_width_command(struct command_context_s *cmd_ return ERROR_OK; } -static int handle_jtag_speed_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) -{ - int retval = ERROR_OK; - - command_print(cmd_ctx, "OLD SYNTAX: DEPRECATED - " - "use jtag_khz, not jtag_speed"); - - if (argc > 1) - return ERROR_COMMAND_SYNTAX_ERROR; - if (argc == 1) - { - LOG_DEBUG("handle jtag speed"); - - unsigned cur_speed = 0; - COMMAND_PARSE_NUMBER(uint, args[0], cur_speed); - - retval = jtag_config_speed(cur_speed); - } - command_print(cmd_ctx, "jtag_speed: %d", jtag_get_speed()); - - return retval; -} - static int handle_jtag_khz_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { if (argc > 1) diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index 2a0aefca4c..b251ec5b9b 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -38,7 +38,6 @@ int arm7_9_debug_entry(target_t *target); -int arm7_9_enable_sw_bkpts(struct target_s *target); /* command handler forward declarations */ int handle_arm7_9_write_xpsr_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); diff --git a/src/target/arm7_9_common.h b/src/target/arm7_9_common.h index 9c42b6b084..c0145d95e3 100644 --- a/src/target/arm7_9_common.h +++ b/src/target/arm7_9_common.h @@ -47,7 +47,6 @@ typedef struct arm7_9_common_s uint32_t arm_bkpt; /**< ARM breakpoint instruction */ uint16_t thumb_bkpt; /**< Thumb breakpoint instruction */ - bool force_hw_bkpts; int sw_breakpoints_added; /**< Specifies which watchpoint software breakpoints are setup on */ int sw_breakpoint_count; /**< keep track of number of software breakpoints we have set */ diff --git a/src/target/target.c b/src/target/target.c index 3e4c00d0b9..90c143ff54 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -1282,10 +1282,10 @@ void target_free_all_working_areas(struct target_s *target) int target_register_commands(struct command_context_s *cmd_ctx) { - register_command(cmd_ctx, NULL, "targets", handle_targets_command, COMMAND_EXEC, "change the current command line target (one parameter) or lists targets (with no parameter)"); - - - + register_command(cmd_ctx, NULL, "targets", + handle_targets_command, COMMAND_EXEC, + "change current command line target (one parameter) " + "or list targets (no parameters)"); register_jim(cmd_ctx, "target", jim_target, "configure target"); diff --git a/tcl/board/topas910.cfg b/tcl/board/topas910.cfg index 01ace63e72..ce7c87a49a 100644 --- a/tcl/board/topas910.cfg +++ b/tcl/board/topas910.cfg @@ -99,7 +99,7 @@ proc topas910_init { } { mww 0xf4300004 0x00000000 sleep 10 -# jtag_speed 10000 +# jtag_khz NNNN # remap off in case of IROM boot mww 0xf0000004 0x00000001 diff --git a/tcl/board/topasa900.cfg b/tcl/board/topasa900.cfg index 699b42eacf..a8a6caf665 100644 --- a/tcl/board/topasa900.cfg +++ b/tcl/board/topasa900.cfg @@ -105,7 +105,7 @@ proc topasa900_init { } { mww 0xf4300004 0x00000000 sleep 10 -# jtag_speed 10000 +# jtag_khz NNNN # remap off in case of IROM boot mww 0xf0000004 0x00000001 diff --git a/tcl/interface/calao-usb-a9260.cfg b/tcl/interface/calao-usb-a9260.cfg index 57c68d6138..a9d7dec442 100644 --- a/tcl/interface/calao-usb-a9260.cfg +++ b/tcl/interface/calao-usb-a9260.cfg @@ -5,12 +5,7 @@ # # See calao-usb-a9260-c01.cfg and calao-usb-a9260-c02.cfg. # -# Note: You must have an OpenOCD version where jtag_speed sets two values. -# trunk r606 contains the fix for this particular issue which can -# be seen if jtag_speed does not set two separate values. -# -jtag_speed 1200 0 jtag_nsrst_delay 200 jtag_ntrst_delay 200 diff --git a/tcl/interface/openocd-usb.cfg b/tcl/interface/openocd-usb.cfg index 8bb9ffe6f4..4000b23fb1 100644 --- a/tcl/interface/openocd-usb.cfg +++ b/tcl/interface/openocd-usb.cfg @@ -9,6 +9,3 @@ ft2232_vid_pid 0x0403 0x6010 ft2232_device_desc "Dual RS232" ft2232_layout "oocdlink" ft2232_latency 2 -# 6/(1+n) Mhz TCLK -jtag_speed 1 - diff --git a/tcl/interface/parport.cfg b/tcl/interface/parport.cfg index 6aaf80b7bb..2a2668d520 100644 --- a/tcl/interface/parport.cfg +++ b/tcl/interface/parport.cfg @@ -5,5 +5,4 @@ interface parport parport_port 0xc8b8 parport_cable wiggler -jtag_speed 0 diff --git a/tcl/interface/parport_dlc5.cfg b/tcl/interface/parport_dlc5.cfg index defda3f3f1..0f94c65620 100644 --- a/tcl/interface/parport_dlc5.cfg +++ b/tcl/interface/parport_dlc5.cfg @@ -7,5 +7,4 @@ interface parport parport_port /dev/parport0 parport_cable dlc5 -jtag_speed 0