]> git.sur5r.net Git - openocd/commitdiff
added fast option.
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Wed, 23 Apr 2008 05:42:42 +0000 (05:42 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Wed, 23 Apr 2008 05:42:42 +0000 (05:42 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@604 b42882b7-edfa-0310-969c-e2dbd0fdcd60

doc/openocd.texi
src/helper/command.c
src/helper/command.h
src/target/arm7_9_common.c

index 985a9d3a8ae5e63fd416807cdbdec36c9da6dc27..4a8bb45ba6f5b4f9ee2f9ce8937c1fcb31348915 100644 (file)
@@ -741,6 +741,22 @@ Close the OpenOCD daemon, disconnecting all clients (GDB, Telnet).
 @cindex debug_level
 Display or adjust debug level to n<0-3> 
 
+@item @b{fast} [@var{enable/disable}]
+@cindex fast
+Default disabled. Set default behaviour of OpenOCD to be "fast and dangerous". For instance ARM7/9 DCC memory
+downloads and fast memory access will work if the JTAG interface isn't too fast and
+the core doesn't run at a too low frequency. Note that this option only changes the default
+and that the indvidual options, like DCC memory downloads, can be enabled and disabled
+individually. 
+
+The target specific "dangerous" optimisation tweaking options may come and go
+as more robust and user friendly ways are found to ensure maximum throughput
+and robustness with a minimum of configuration. 
+
+Typically the "fast enable" is specified first on the command line:
+
+openocd -c "fast enable" -c "interface dummy" -f target/str710.cfg
+
 @item @b{log_output} <@var{file}>
 @cindex log_output
 Redirect logging to <file> (default: stderr) 
index 7a7cbcbb61932fecb8c3741e87881f50480dacfb..31666e3a798a1ac7e9f8167fe374ac7d8ca26589 100644 (file)
 #include <stdio.h>
 #include <unistd.h>
 
+int fast_and_dangerous = 0;
+
 void command_print_help_line(command_context_t* context, struct command_s *command, int indent);
 
 int handle_sleep_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 int handle_time_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
+int handle_fast_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 
 int build_unique_lengths(command_context_t *context, command_t *commands)
 {
@@ -559,6 +562,9 @@ command_context_t* command_init()
        register_command(context, NULL, "time", handle_time_command,
                                         COMMAND_ANY, "time <cmd + args> - execute <cmd + args> and print time it took");
        
+       register_command(context, NULL, "fast", handle_fast_command,
+                                        COMMAND_ANY, "fast <enable/disable> - place at beginning of config files. Sets defaults to fast and dangerous.");
+       
        return context;
 }
 
@@ -578,6 +584,17 @@ int handle_sleep_command(struct command_context_s *cmd_ctx, char *cmd, char **ar
        return ERROR_OK;
 }
 
+int handle_fast_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+{
+       if (argc!=1)
+               return ERROR_COMMAND_SYNTAX_ERROR;
+       
+       fast_and_dangerous = strcmp("enable", args[0])==0;
+       
+       return ERROR_OK;
+}
+
+
 int handle_time_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
 {
        duration_t duration;
index 6e6af75eb8b0ed0194ba1b23eef3b4a2171d9f9e..3586017deee048354c973f96d59de3c038d25aa8 100644 (file)
@@ -79,4 +79,7 @@ extern int command_run_file(command_context_t *context, FILE *file, enum command
 #define                ERROR_COMMAND_CLOSE_CONNECTION          (-600)
 #define                ERROR_COMMAND_SYNTAX_ERROR                      (-601)
 
+
+extern int fast_and_dangerous;
+
 #endif /* COMMAND_H */
index 0c63d9209aed41d95cf42a78b1fad80731d85639..b64a885f281da6e03dcd8d1f1d78c076175760fb 100644 (file)
@@ -2624,8 +2624,8 @@ int arm7_9_init_arch_info(target_t *target, arm7_9_common_t *arm7_9)
        
        arm7_9->dcc_working_area = NULL;
        
-       arm7_9->fast_memory_access = 0;
-       arm7_9->dcc_downloads = 0;
+       arm7_9->fast_memory_access = fast_and_dangerous;
+       arm7_9->dcc_downloads = fast_and_dangerous;
 
        armv4_5->arch_info = arm7_9;
        armv4_5->read_core_reg = arm7_9_read_core_reg;