diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-11-27 14:58:49 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-11-27 14:58:49 +0000 |
commit | 3a636951eba6d674762f3aa6dfc76c35655ca8a9 (patch) | |
tree | 8589a4c9a92b897ad021145d255bcaa1e8a22dac | |
parent | ab28153685f44a5fab9a0d346239f116fd996a7a (diff) | |
download | riscv-openocd-3a636951eba6d674762f3aa6dfc76c35655ca8a9.zip riscv-openocd-3a636951eba6d674762f3aa6dfc76c35655ca8a9.tar.gz riscv-openocd-3a636951eba6d674762f3aa6dfc76c35655ca8a9.tar.bz2 |
Rick Altherr <kc8apf@kc8apf.net> retire obsolete syntax
git-svn-id: svn://svn.berlios.de/openocd/trunk@1190 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r-- | doc/openocd.texi | 51 | ||||
-rw-r--r-- | src/helper/startup.tcl | 44 | ||||
-rw-r--r-- | src/target/arm7_9_common.c | 2 | ||||
-rw-r--r-- | src/target/target.c | 145 |
4 files changed, 28 insertions, 214 deletions
diff --git a/doc/openocd.texi b/doc/openocd.texi index b436ab7..00932da 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2057,13 +2057,22 @@ called "flash_banks". Certain OpenOCD commands have been deprecated/removed during the various revisions. @itemize @bullet -@item @b{load_binary} -@cindex load_binary -@*use @option{load_image} command with same args. @xref{load_image}. -@item @b{target} -@cindex target -@*@option{target} no longer take the reset_init, reset_run, run_and_halt, run_and_init. The @option{reset} command -always does a @option{reset run} when passed no arguments. +@item @b{arm7_9 fast_writes} +@cindex arm7_9 fast_writes +@*use @option{arm7_9 fast_memory_access} command with same args. @xref{arm7_9 fast_memory_access}. +@item @b{arm7_9 force_hw_bkpts} +@cindex arm7_9 force_hw_bkpts +@*Use @option{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} +@cindex arm7_9 sw_bkpts +@*On by default. See also @option{gdb_breakpoint_override}. @xref{gdb_breakpoint_override}. +@item @b{daemon_startup} +@cindex 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} @cindex dump_binary @*use @option{dump_image} command with same args. @xref{dump_image}. @@ -2076,25 +2085,12 @@ always does a @option{reset run} when passed no arguments. @item @b{flash write_binary} @cindex flash write_binary @*use @option{flash write_bank} command with same args. @xref{flash write_bank}. -@item @b{arm7_9 fast_writes} -@cindex arm7_9 fast_writes -@*use @option{arm7_9 fast_memory_access} command with same args. @xref{arm7_9 fast_memory_access}. @item @b{flash auto_erase} @cindex flash auto_erase @*use @option{flash write_image} command passing @option{erase} as the first parameter. @xref{flash write_image}. -@item @b{daemon_startup} -@cindex 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{arm7_9 sw_bkpts} -@cindex arm7_9 sw_bkpts -@*On by default. See also @option{gdb_breakpoint_override}. @xref{gdb_breakpoint_override}. -@item @b{arm7_9 force_hw_bkpts} -@cindex arm7_9 force_hw_bkpts -@*Use @option{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{load_binary} +@cindex load_binary +@*use @option{load_image} command with same args. @xref{load_image}. @item @b{run_and_halt_time} @cindex run_and_halt_time @*This command has been removed for simpler reset behaviour, it can be simulated with the @@ -2104,6 +2100,15 @@ reset run sleep 100 halt @end smallexample +@item @b{target} <@var{type}> <@var{endian}> <@var{jtag-position}> +@cindex target +@*use the create subcommand of @option{target}. +@item @b{target_script} <@var{target#}> <@var{eventname}> <@var{scriptname}> +@cindex target_script +@*use <@var{target_name}> configure -event <@var{eventname}> "script <@var{scriptname}>" +@item @b{working_area} +@cindex 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 diff --git a/src/helper/startup.tcl b/src/helper/startup.tcl index f91ba7e..41137f1 100644 --- a/src/helper/startup.tcl +++ b/src/helper/startup.tcl @@ -100,37 +100,6 @@ proc new_target_name { } { return [target number [expr [target count] - 1 ]] } - -proc target_script {target_num eventname scriptname} { - - set tname [target number $target_num] - - if { 0 == [string compare $eventname "reset"] } { - $tname configure -event reset-init "script $scriptname" - return - } - - if { 0 == [string compare $eventname "post_reset"] } { - $tname configure -event reset-init "script $scriptname" - return - } - - if { 0 == [string compare $eventname "pre_reset"] } { - $tname configure -event reset-start "script $scriptname" - return - } - - if { 0 == [string compare $eventname "gdb_program_config"] } { - $tname configure -event old-gdb_program_config "script $scriptname" - return - } - - return -code error "Unknown target (old) event: $eventname (try $tname configure -event NAME)" - -} - -add_help_text target_script "DEPRECATED please see the new TARGETNAME configure -event interface" - # Try flipping / and \ to find file if the filename does not # match the precise spelling proc find {filename} { @@ -277,19 +246,6 @@ proc production_test {} { } add_help_text production "Runs test procedure. Throws exception if procedure failed. Prints progress messages. Implement in target script." -proc load {args} { - return [eval "load_image $args"] -} -add_help_text load "synonym to load_image" - -proc verify {args} { - return [eval "verify_image $args"] -} - -add_help_text verify "synonym to verify_image" - - - add_help_text cpu "<name> - prints out target options and a comment on CPU which matches name" # A list of names of CPU and options required diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index 8814636..3dec458 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -2610,8 +2610,6 @@ int arm7_9_register_commands(struct command_context_s *cmd_ctx) register_command(cmd_ctx, arm7_9_cmd, "dbgrq", handle_arm7_9_dbgrq_command, COMMAND_ANY, "use EmbeddedICE dbgrq instead of breakpoint for target halt requests <enable|disable>"); - register_command(cmd_ctx, arm7_9_cmd, "fast_writes", handle_arm7_9_fast_memory_access_command, - COMMAND_ANY, "(deprecated, see: arm7_9 fast_memory_access)"); register_command(cmd_ctx, arm7_9_cmd, "fast_memory_access", handle_arm7_9_fast_memory_access_command, COMMAND_ANY, "use fast memory accesses instead of slower but potentially unsafe slow accesses <enable|disable>"); register_command(cmd_ctx, arm7_9_cmd, "dcc_downloads", handle_arm7_9_dcc_downloads_command, diff --git a/src/target/target.c b/src/target/target.c index f86c52f..96a414d 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -64,8 +64,6 @@ int cli_target_callback_event_handler(struct target_s *target, enum target_event int handle_targets_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -int handle_working_area_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); - int handle_reg_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); int handle_poll_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); int handle_halt_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); @@ -947,7 +945,6 @@ 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, "working_area", handle_working_area_command, COMMAND_ANY, "set a new working space"); register_command(cmd_ctx, NULL, "virt2phys", handle_virt2phys_command, COMMAND_ANY, "translate a virtual address into a physical address"); register_command(cmd_ctx, NULL, "profile", handle_profile_command, COMMAND_EXEC, "profiling samples the CPU PC"); @@ -1409,50 +1406,6 @@ DumpTargets: return ERROR_OK; } - - -int handle_working_area_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) -{ - int retval = ERROR_OK; - target_t *target = NULL; - - if ((argc < 4) || (argc > 5)) - { - return ERROR_COMMAND_SYNTAX_ERROR; - } - - target = get_target_by_num(strtoul(args[0], NULL, 0)); - if (!target) - { - return ERROR_COMMAND_SYNTAX_ERROR; - } - target_free_all_working_areas(target); - - target->working_area_phys = target->working_area_virt = strtoul(args[1], NULL, 0); - if (argc == 5) - { - target->working_area_virt = strtoul(args[4], NULL, 0); - } - target->working_area_size = strtoul(args[2], NULL, 0); - - if (strcmp(args[3], "backup") == 0) - { - target->backup_working_area = 1; - } - else if (strcmp(args[3], "nobackup") == 0) - { - target->backup_working_area = 0; - } - else - { - LOG_ERROR("unrecognized <backup|nobackup> argument (%s)", args[3]); - return ERROR_COMMAND_SYNTAX_ERROR; - } - - return retval; -} - - // every 300ms we check for reset & powerdropout and issue a "reset halt" if // so. @@ -3973,7 +3926,6 @@ jim_target( Jim_Interp *interp, int argc, Jim_Obj *const *argv ) int x,r,e; jim_wide w; struct command_context_s *cmd_ctx; - const char *cp; target_t *target; Jim_GetOptInfo goi; enum tcmd { @@ -4003,103 +3955,6 @@ jim_target( Jim_Interp *interp, int argc, Jim_Obj *const *argv ) return JIM_ERR; } - /* is this old syntax? */ - /* To determine: We have to peek at argv[0]*/ - cp = Jim_GetString( goi.argv[0], NULL ); - for( x = 0 ; target_types[x] ; x++ ){ - if( 0 == strcmp(cp,target_types[x]->name) ){ - break; - } - } - if( target_types[x] ){ - /* YES IT IS OLD SYNTAX */ - Jim_Obj *new_argv[10]; - int new_argc; - - /* target_old_syntax - * - * It appears that there are 2 old syntaxes: - * - * target <typename> <endian> <chain position> <variant> - * - * and - * - * target <typename> <endian> <reset mode> <chain position> <variant> - * - */ - - /* The minimum number of arguments is 4 */ - if( argc < 4 ){ - Jim_WrongNumArgs( interp, 1, argv, "[OLDSYNTAX] ?TYPE? ?ENDIAN? ?CHAIN-POSITION? ?VARIANT?"); - return JIM_ERR; - } - - /* the command */ - new_argv[0] = argv[0]; - new_argv[1] = Jim_NewStringObj( interp, "create", -1 ); - { - char buf[ 30 ]; - sprintf( buf, "target%d", new_target_number() ); - new_argv[2] = Jim_NewStringObj( interp, buf , -1 ); - } - new_argv[3] = goi.argv[0]; /* typename */ - new_argv[4] = Jim_NewStringObj( interp, "-endian", -1 ); - new_argv[5] = goi.argv[1]; - new_argv[6] = Jim_NewStringObj( interp, "-chain-position", -1 ); - - /* If goi.argv[2] is not a number, we need to skip it since it is the reset mode. */ - jim_wide w; - int chain_position_argv = 2; - if (JIM_ERR == Jim_GetWide(interp, goi.argv[chain_position_argv], &w)) { - if (chain_position_argv + 1 < goi.argc) { - chain_position_argv += 1; - } else { - Jim_WrongNumArgs( interp, 1, argv, "[OLDSYNTAX] ?TYPE? ?ENDIAN? ?RESET? ?CHAIN-POSITION? ?VARIANT?"); - return JIM_ERR; - } - } - - new_argv[7] = goi.argv[chain_position_argv]; - - /* Only provide a variant configure option if there was a variant specified */ - if (chain_position_argv + 1 < goi.argc) { - new_argv[8] = Jim_NewStringObj( interp, "-variant", -1 ); - new_argv[9] = goi.argv[chain_position_argv + 1]; - new_argc = 10; - } else { - new_argc = 8; - } - - /* - * new arg syntax: - * argv[0] = command - * argv[1] = create - * argv[2] = cmdname - * argv[3] = typename - * argv[4] = -endian - * argv[5] = little - * argv[6] = -position - * argv[7] = NUMBER - * argv[8] = -variant - * argv[9] = "somestring" - */ - - /* don't let these be released */ - for( x = 0 ; x < new_argc ; x++ ){ - Jim_IncrRefCount( new_argv[x]); - } - /* call our self */ - LOG_DEBUG("Target OLD SYNTAX - converted to new syntax"); - - r = jim_target( goi.interp, new_argc, new_argv ); - - /* release? these items */ - for( x = 0 ; x < new_argc ; x++ ){ - Jim_DecrRefCount( interp, new_argv[x] ); - } - return r; - } - //Jim_GetOpt_Debug( &goi ); r = Jim_GetOpt_Enum( &goi, target_cmds, &x ); if( r != JIM_OK ){ |