From: David B. <dbr...@us...> - 2010-01-08 02:07:43
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 12c143d5948355b3b54c9c0decc779177b22d5d9 (commit) via 82c0fb527783a56f7cf82e21b85546b425378b00 (commit) via e7965cd3eb6204e618f9555331b7172e3dba7df8 (commit) via a42bea654ce1316dd521b1c9beffa8f829bf8be0 (commit) via e0b6e5deef2d7b0054058116b6ddf9c684053739 (commit) via 199abf49ea02f03aedd1239b6ef3928d35f5dbb7 (commit) via 48d51e1719c2b48509786bba7c84c09d329929d3 (commit) via 17921f51abc4402c9c5aadf3e664eb37663f744f (commit) via e19fe9ad09e28df1976257052afe6edf765aa778 (commit) via dd8f679aa2ea447a96f393db3a8938259f63eebc (commit) via 7c3aee96b2f122fd16ec20e305cb16fe89180c9b (commit) from 991d030fcc9be971f29498ea7e1b3afbed05815b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 12c143d5948355b3b54c9c0decc779177b22d5d9 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 16:41:42 2010 -0800 misc ARM help/usage updates Usage syntax messages have the same EBNF as the User's Guide; there should be no angle brackets in either place. Uupdate some helptext to be more accurate. Don't use "&function"; functions are like arrays, their address is their name. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm926ejs.c b/src/target/arm926ejs.c index 4ac92a2..e099919 100644 --- a/src/target/arm926ejs.c +++ b/src/target/arm926ejs.c @@ -757,7 +757,7 @@ static int arm926ejs_mmu(struct target *target, int *enabled) static const struct command_registration arm926ejs_exec_command_handlers[] = { { .name = "cache_info", - .handler = &arm926ejs_handle_cache_info_command, + .handler = arm926ejs_handle_cache_info_command, .mode = COMMAND_EXEC, .help = "display information about target caches", diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c index ae0c4e0..823e962 100644 --- a/src/target/arm9tdmi.c +++ b/src/target/arm9tdmi.c @@ -918,7 +918,9 @@ static const struct command_registration arm9tdmi_exec_command_handlers[] = { .name = "vector_catch", .handler = handle_arm9tdmi_catch_vectors_command, .mode = COMMAND_EXEC, - .usage = "[all|none|reset|undef|swi|pabt|dabt|irq|fiq] ...", + .help = "Display, after optionally updating, configuration " + "of vector catch unit.", + .usage = "[all|none|(reset|undef|swi|pabt|dabt|irq|fiq)*]", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index 1c4923b..c7b7367 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -928,22 +928,22 @@ static int jim_mcrmrc(Jim_Interp *interp, int argc, Jim_Obj *const *argv) static const struct command_registration arm_exec_command_handlers[] = { { .name = "reg", - .handler = &handle_armv4_5_reg_command, + .handler = handle_armv4_5_reg_command, .mode = COMMAND_EXEC, .help = "display ARM core registers", }, { .name = "core_state", - .handler = &handle_armv4_5_core_state_command, + .handler = handle_armv4_5_core_state_command, .mode = COMMAND_EXEC, - .usage = "<arm | thumb>", + .usage = "['arm'|'thumb']", .help = "display/change ARM core state", }, { .name = "disassemble", - .handler = &handle_armv4_5_disassemble_command, + .handler = handle_armv4_5_disassemble_command, .mode = COMMAND_EXEC, - .usage = "<address> [<count> ['thumb']]", + .usage = "address [count ['thumb']]", .help = "disassemble instructions ", }, { commit 82c0fb527783a56f7cf82e21b85546b425378b00 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 16:39:32 2010 -0800 ARM966: help/usage updates Usage syntax messages have the same EBNF as the User's Guide; there should be no angle brackets in either place. Fix the User's Guide to say where the magic CP15 bits are defined; and add comments in case someone provides mcr/mrc methods. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 285603a..84bdb3c 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -6030,6 +6030,10 @@ and ARM9 commands. @deffn Command {arm966e cp15} regnum [value] Display cp15 register @var{regnum}; else if a @var{value} is provided, that value is written to that register. +The six bit @var{regnum} values are bits 37..32 from table 7-2 of the +ARM966E-S TRM. +There is no current control over bits 31..30 from that table, +as required for BIST support. @end deffn @subsection XScale specific commands diff --git a/src/target/arm966e.c b/src/target/arm966e.c index 82be738..86af0f6 100644 --- a/src/target/arm966e.c +++ b/src/target/arm966e.c @@ -68,6 +68,13 @@ static int arm966e_verify_pointer(struct command_context *cmd_ctx, return ERROR_OK; } +/* + * REVISIT: The "read_cp15" and "write_cp15" commands could hook up + * to eventual mrc() and mcr() routines ... the reg_addr values being + * constructed (for CP15 only) from Opcode_1, Opcode_2, and CRn values. + * See section 7.3 of the ARM966E-S TRM. + */ + static int arm966e_read_cp15(struct target *target, int reg_addr, uint32_t *value) { int retval = ERROR_OK; @@ -86,6 +93,9 @@ static int arm966e_read_cp15(struct target *target, int reg_addr, uint32_t *valu fields[0].tap = jtag_info->tap; fields[0].num_bits = 32; + /* REVISIT: table 7-2 shows that bits 31-31 need to be + * specified for accessing BIST registers ... + */ fields[0].out_value = NULL; fields[0].in_value = NULL; @@ -227,7 +237,7 @@ static const struct command_registration arm966e_exec_command_handlers[] = { .name = "cp15", .handler = arm966e_handle_cp15_command, .mode = COMMAND_EXEC, - .usage = "<opcode> [value]", + .usage = "regnum [value]", .help = "display/modify cp15 register", }, COMMAND_REGISTRATION_DONE commit e7965cd3eb6204e618f9555331b7172e3dba7df8 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 16:34:44 2010 -0800 Xscale: User's Guide updates Fix some EBNF goofs ... these commands have *optional* params, etc Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index bf7402d..285603a 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -6105,7 +6105,7 @@ else if a @var{value} is provided, that value is written to that register. Changes the address used for the specified target's debug handler. @end deffn -@deffn Command {xscale dcache} (@option{enable}|@option{disable}) +@deffn Command {xscale dcache} [@option{enable}|@option{disable}] Enables or disable the CPU's data cache. @end deffn @@ -6113,17 +6113,18 @@ Enables or disable the CPU's data cache. Dumps the raw contents of the trace buffer to @file{filename}. @end deffn -@deffn Command {xscale icache} (@option{enable}|@option{disable}) +@deffn Command {xscale icache} [@option{enable}|@option{disable}] Enables or disable the CPU's instruction cache. @end deffn -@deffn Command {xscale mmu} (@option{enable}|@option{disable}) +@deffn Command {xscale mmu} [@option{enable}|@option{disable}] Enables or disable the CPU's memory management unit. @end deffn -@deffn Command {xscale trace_buffer} (@option{enable}|@option{disable}) [@option{fill} [n] | @option{wrap}] -Enables or disables the trace buffer, -and controls how it is emptied. +@deffn Command {xscale trace_buffer} [@option{enable}|@option{disable} [@option{fill} [n] | @option{wrap}]] +Displays the trace buffer status, after optionally +enabling or disabling the trace buffer +and modifying how it is emptied. @end deffn @deffn Command {xscale trace_image} filename [offset [type]] @@ -6155,7 +6156,7 @@ The mask bits correspond with bit 16..23 in the DCSR: @end deffn @anchor{xscale vector_table} -@deffn Command {xscale vector_table} [<low|high> <index> <value>] +@deffn Command {xscale vector_table} [(@option{low}|@option{high}) index value] @cindex vector_table Set an entry in the mini-IC vector table. There are two tables: one for commit a42bea654ce1316dd521b1c9beffa8f829bf8be0 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 16:30:09 2010 -0800 ARM720: help/usage updates Deprecate the "pass an instruction opcode" flavor of cp15 access in favor of the "arm mcr ..." and "arm mrc ..." commands, which offer fewer ways to break things. Use the same EBNF syntax in the code as for the user's guide. Update User's Guide to say where to find those magic values (which table in the ARM920 TRM). Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index ea23bf7..bf7402d 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -5978,13 +5978,21 @@ is an ARM920T (2x16kByte cache) or ARM922T (2x8kByte cache). @deffn Command {arm920t cp15} regnum [value] Display cp15 register @var{regnum}; else if a @var{value} is provided, that value is written to that register. +This uses "physical access" and the register number is as +shown in bits 38..33 of table 9-9 in the ARM920T TRM. +(Not all registers can be written.) @end deffn @deffn Command {arm920t cp15i} opcode [value [address]] -Interpreted access using cp15 @var{opcode}. +@emph{DEPRECATED -- avoid using this. +Use the @command{arm mrc} or @command{arm mcr} commands instead.} + +Interpreted access using ARM instruction @var{opcode}, which should +be the value of either an MRC or MCR instruction +(as shown tables 9-11, 9-12, and 9-13 in the ARM920T TRM). If no @var{value} is provided, the result is displayed. Else if that value is written using the specified @var{address}, -or using zero if no other address is not provided. +or using zero if no other address is provided. @end deffn @deffn Command {arm920t read_cache} filename diff --git a/src/target/arm920t.c b/src/target/arm920t.c index c5b7c88..29eb62d 100644 --- a/src/target/arm920t.c +++ b/src/target/arm920t.c @@ -1384,35 +1384,39 @@ static int arm920t_mcr(struct target *target, int cpnum, static const struct command_registration arm920t_exec_command_handlers[] = { { .name = "cp15", - .handler = &arm920t_handle_cp15_command, + .handler = arm920t_handle_cp15_command, .mode = COMMAND_EXEC, .help = "display/modify cp15 register", - .usage = "<num> [value]", + .usage = "regnum [value]", }, { .name = "cp15i", - .handler = &arm920t_handle_cp15i_command, + .handler = arm920t_handle_cp15i_command, .mode = COMMAND_EXEC, - .help = "display/modify cp15 (interpreted access)", - .usage = "<opcode> [value] [address]", + /* prefer using less error-prone "arm mcr" or "arm mrc" */ + .help = "display/modify cp15 register using ARM opcode" + " (DEPRECATED)", + .usage = "instruction [value [address]]", }, { .name = "cache_info", - .handler = &arm920t_handle_cache_info_command, + .handler = arm920t_handle_cache_info_command, .mode = COMMAND_EXEC, .help = "display information about target caches", }, { .name = "read_cache", - .handler = &arm920t_handle_read_cache_command, + .handler = arm920t_handle_read_cache_command, .mode = COMMAND_EXEC, - .help = "display I/D cache content", + .help = "dump I/D cache content to file", + .usage = "filename", }, { .name = "read_mmu", - .handler = &arm920t_handle_read_mmu_command, + .handler = arm920t_handle_read_mmu_command, .mode = COMMAND_EXEC, - .help = "display I/D mmu content", + .help = "dump I/D mmu content to file", + .usage = "filename", }, COMMAND_REGISTRATION_DONE }; commit e0b6e5deef2d7b0054058116b6ddf9c684053739 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 16:25:03 2010 -0800 ARM720: help/usage updates Deprecate the "pass an instruction opcode" flavor of cp15 access in favor of the "arm mcr ..." and "arm mrc ..." commands, which offer fewer ways to break things. Use the same EBNF syntax in the code as for the user's guide. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index a6fb970..ea23bf7 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -5921,9 +5921,13 @@ which are implementations of the ARMv4T architecture based on the ARM7TDMI-S integer core. They are available in addition to the ARM and ARM7/ARM9 commands. -@deffn Command {arm720t cp15} regnum [value] -Display cp15 register @var{regnum}; +@deffn Command {arm720t cp15} opcode [value] +@emph{DEPRECATED -- avoid using this. +Use the @command{arm mrc} or @command{arm mcr} commands instead.} + +Display cp15 register returned by the ARM instruction @var{opcode}; else if a @var{value} is provided, that value is written to that register. +The @var{opcode} should be the value of either an MRC or MCR instruction. @end deffn @subsection ARM9 specific commands diff --git a/src/target/arm720t.c b/src/target/arm720t.c index 84c66b8..2f51699 100644 --- a/src/target/arm720t.c +++ b/src/target/arm720t.c @@ -516,8 +516,10 @@ static const struct command_registration arm720t_exec_command_handlers[] = { .name = "cp15", .handler = arm720t_handle_cp15_command, .mode = COMMAND_EXEC, - .usage = "<opcode> [value]", - .help = "display/modify cp15 register", + /* prefer using less error-prone "arm mcr" or "arm mrc" */ + .help = "display/modify cp15 register using ARM opcode" + " (DEPRECATED)", + .usage = "instruction [value]", }, COMMAND_REGISTRATION_DONE }; commit 199abf49ea02f03aedd1239b6ef3928d35f5dbb7 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 16:21:10 2010 -0800 ARM11: help/usage updates Usage syntax messages have the same EBNF as the User's Guide; there should be no angle brackets in either place. Uupdate some helptext to be more accurate. Fix the User's Guide in a few places to be more consistent (mostly to use brackets not parentheses) and to recognize that parameter may be entirely optional (in which case the command just displays output, and changes nothing). Also reference NXP, not Philips, for LPC chips. Don't use "&function"; functions are like arrays, their address is their name. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index b91e754..a6fb970 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -6162,27 +6162,29 @@ Without arguments, the current settings are displayed. @subsection ARM11 specific commands @cindex ARM11 -@deffn Command {arm11 memwrite burst} [value] +@deffn Command {arm11 memwrite burst} [@option{enable}|@option{disable}] Displays the value of the memwrite burst-enable flag, -which is enabled by default. Burst writes are only used -for memory writes larger than 1 word. Single word writes -are likely to be from reset init scripts and those writes -are often to non-memory locations which could easily have -many wait states, which could easily break burst writes. -If @var{value} is defined, first assigns that. +which is enabled by default. +If a boolean parameter is provided, first assigns that flag. +Burst writes are only used for memory writes larger than 1 word. +They improve performance by assuming that the CPU has read each data +word over JTAG and completed its write before the next word arrives, +instead of polling for a status flag to verify that completion. +This is usually safe, because JTAG runs much slower than the CPU. @end deffn -@deffn Command {arm11 memwrite error_fatal} [value] +@deffn Command {arm11 memwrite error_fatal} [@option{enable}|@option{disable}] Displays the value of the memwrite error_fatal flag, which is enabled by default. -If @var{value} is defined, first assigns that. +If a boolean parameter is provided, first assigns that flag. +When set, certain memory write errors cause earlier transfer termination. @end deffn -@deffn Command {arm11 step_irq_enable} [value] +@deffn Command {arm11 step_irq_enable} [@option{enable}|@option{disable}] Displays the value of the flag controlling whether IRQs are enabled during single stepping; they are disabled by default. -If @var{value} is defined, first assigns that. +If a boolean parameter is provided, first assigns that. @end deffn @deffn Command {arm11 vcr} [value] diff --git a/src/target/arm11.c b/src/target/arm11.c index 67a8409..082930a 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -1318,17 +1318,20 @@ COMMAND_HANDLER(arm11_handle_vcr) static const struct command_registration arm11_mw_command_handlers[] = { { .name = "burst", - .handler = &arm11_handle_bool_memwrite_burst, + .handler = arm11_handle_bool_memwrite_burst, .mode = COMMAND_ANY, - .help = "Enable/Disable potentially risky fast burst mode" - " (default: enabled)", + .help = "Display or modify flag controlling potentially " + "risky fast burst mode (default: enabled)", + .usage = "['enable'|'disable']", }, { .name = "error_fatal", - .handler = &arm11_handle_bool_memwrite_error_fatal, + .handler = arm11_handle_bool_memwrite_error_fatal, .mode = COMMAND_ANY, - .help = "Terminate program if transfer error was found" + .help = "Display or modify flag controlling transfer " + "termination on transfer errors" " (default: enabled)", + .usage = "['enable'|'disable']", }, COMMAND_REGISTRATION_DONE }; @@ -1338,11 +1341,11 @@ static const struct command_registration arm11_any_command_handlers[] = { * simulate + breakpoint implementation is broken. * TEMPORARY! NOT DOCUMENTED! */ .name = "hardware_step", - .handler = &arm11_handle_bool_hardware_step, + .handler = arm11_handle_bool_hardware_step, .mode = COMMAND_ANY, .help = "DEBUG ONLY - Hardware single stepping" " (default: disabled)", - .usage = "(enable|disable)", + .usage = "['enable'|'disable']", }, { .name = "memwrite", @@ -1352,16 +1355,18 @@ static const struct command_registration arm11_any_command_handlers[] = { }, { .name = "step_irq_enable", - .handler = &arm11_handle_bool_step_irq_enable, + .handler = arm11_handle_bool_step_irq_enable, .mode = COMMAND_ANY, - .help = "Enable interrupts while stepping" - " (default: disabled)", + .help = "Display or modify flag controlling interrupt " + "enable while stepping (default: disabled)", + .usage = "['enable'|'disable']", }, { .name = "vcr", - .handler = &arm11_handle_vcr, + .handler = arm11_handle_vcr, .mode = COMMAND_ANY, - .help = "Control (Interrupt) Vector Catch Register", + .help = "Display or modify Vector Catch Register", + .usage = "[value]", }, COMMAND_REGISTRATION_DONE }; commit 48d51e1719c2b48509786bba7c84c09d329929d3 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 16:20:14 2010 -0800 ARM7/ARM9: help/usage updates Provide helptext which was sometimes missing; update some of it to be more accurate. Usage syntax messages have the same EBNF as the User's Guide; there should be no angle brackets in either place. Fix the User's Guide in a few places to be more consistent (mostly to use brackets not parentheses) and to recognize that parameter may be entirely optional (in which case the command just displays output, and changes nothing). Also reference NXP, not Philips, for LPC chips. Don't use "&function"; functions are like arrays, their address is their name. Shrink some overlong lines. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 6057aad..b91e754 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2501,7 +2501,7 @@ signal implementations. The default behaviour if no option given is @option{separate}, indicating everything behaves normally. @option{srst_pulls_trst} states that the -test logic is reset together with the reset of the system (e.g. Philips +test logic is reset together with the reset of the system (e.g. NXP LPC2000, "broken" board layout), @option{trst_pulls_srst} says that the system is reset together with the test logic (only hypothetical, I haven't seen hardware with such a bug, and can be worked around). @@ -5867,26 +5867,36 @@ ARM9TDMI, ARM920T or ARM926EJ-S. They are available in addition to the ARM commands, and any other core-specific commands that may be available. -@deffn Command {arm7_9 dbgrq} (@option{enable}|@option{disable}) -Control use of the EmbeddedIce DBGRQ signal to force entry into debug mode, -instead of breakpoints. This should be -safe for all but ARM7TDMI--S cores (like Philips LPC). +@deffn Command {arm7_9 dbgrq} [@option{enable}|@option{disable}] +Displays the value of the flag controlling use of the +the EmbeddedIce DBGRQ signal to force entry into debug mode, +instead of breakpoints. +If a boolean parameter is provided, first assigns that flag. + +This should be +safe for all but ARM7TDMI-S cores (like NXP LPC). This feature is enabled by default on most ARM9 cores, including ARM9TDMI, ARM920T, and ARM926EJ-S. @end deffn -@deffn Command {arm7_9 dcc_downloads} (@option{enable}|@option{disable}) +@deffn Command {arm7_9 dcc_downloads} [@option{enable}|@option{disable}] @cindex DCC -Control the use of the debug communications channel (DCC) to write larger (>128 byte) -amounts of memory. DCC downloads offer a huge speed increase, but might be +Displays the value of the flag controlling use of the debug communications +channel (DCC) to write larger (>128 byte) amounts of memory. +If a boolean parameter is provided, first assigns that flag. + +DCC downloads offer a huge speed increase, but might be unsafe, especially with targets running at very low speeds. This command was introduced with OpenOCD rev. 60, and requires a few bytes of working area. @end deffn @anchor{arm7_9 fast_memory_access} -@deffn Command {arm7_9 fast_memory_access} (@option{enable}|@option{disable}) -Enable or disable memory writes and reads that don't check completion of -the operation. This provides a huge speed increase, especially with USB JTAG +@deffn Command {arm7_9 fast_memory_access} [@option{enable}|@option{disable}] +Displays the value of the flag controlling use of memory writes and reads +that don't check completion of the operation. +If a boolean parameter is provided, first assigns that flag. + +This provides a huge speed increase, especially with USB JTAG cables (FT2232), but might be unsafe if used with targets running at very low speeds, like the 32kHz startup clock of an AT91RM9200. @end deffn diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index a09b0ad..2f4c408 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -2864,32 +2864,32 @@ int arm7_9_init_arch_info(struct target *target, struct arm7_9_common *arm7_9) static const struct command_registration arm7_9_any_command_handlers[] = { { "dbgrq", - .handler = &handle_arm7_9_dbgrq_command, + .handler = handle_arm7_9_dbgrq_command, .mode = COMMAND_ANY, - .usage = "<enable|disable>", + .usage = "['enable'|'disable']", .help = "use EmbeddedICE dbgrq instead of breakpoint " "for target halt requests", }, { "fast_memory_access", - .handler = &handle_arm7_9_fast_memory_access_command, + .handler = handle_arm7_9_fast_memory_access_command, .mode = COMMAND_ANY, - .usage = "<enable|disable>", + .usage = "['enable'|'disable']", .help = "use fast memory accesses instead of slower " "but potentially safer accesses", }, { "dcc_downloads", - .handler = &handle_arm7_9_dcc_downloads_command, + .handler = handle_arm7_9_dcc_downloads_command, .mode = COMMAND_ANY, - .usage = "<enable | disable>", + .usage = "['enable'|'disable']", .help = "use DCC downloads for larger memory writes", }, { "semihosting", - .handler = &handle_arm7_9_semihosting_command, + .handler = handle_arm7_9_semihosting_command, .mode = COMMAND_EXEC, - .usage = "<enable | disable>", + .usage = "['enable'|'disable']", .help = "activate support for semihosting operations", }, COMMAND_REGISTRATION_DONE commit 17921f51abc4402c9c5aadf3e664eb37663f744f Author: David Brownell <dbr...@us...> Date: Thu Jan 7 15:52:38 2010 -0800 ARMv7: help/usage updates Provide helptext which was sometimes missing; update some of it to be more accurate. Usage syntax messages have the same EBNF as the User's Guide; there should be no angle brackets in either place. Don't use "&function"; functions are like arrays, their address is their name. Shrink some overlong lines, remove some empties. Add a couple comments about things that should change: those extra TCK cycles for MEM-AP reads are in the wrong place (that might explain some problems we've seen); the DAP command tables should be shared, not copied. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 3f5882c..6057aad 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -6198,26 +6198,28 @@ These commands are specific to ARM architecture v7 Debug Access Port (DAP), included on Cortex-M3 and Cortex-A8 systems. They are available in addition to other core-specific commands that may be available. -@deffn Command {dap info} [num] -Displays dap info for ap @var{num}, defaulting to the currently selected AP. +@deffn Command {dap apid} [num] +Displays ID register from AP @var{num}, +defaulting to the currently selected AP. @end deffn @deffn Command {dap apsel} [num] Select AP @var{num}, defaulting to 0. @end deffn -@deffn Command {dap apid} [num] -Displays id register from AP @var{num}, +@deffn Command {dap baseaddr} [num] +Displays debug base address from MEM-AP @var{num}, defaulting to the currently selected AP. @end deffn -@deffn Command {dap baseaddr} [num] -Displays debug base address from AP @var{num}, +@deffn Command {dap info} [num] +Displays the ROM table for MEM-AP @var{num}, defaulting to the currently selected AP. @end deffn @deffn Command {dap memaccess} [value] -Displays the number of extra tck for mem-ap memory bus access [0-255]. +Displays the number of extra tck cycles in the JTAG idle to use for MEM-AP +memory bus access [0-255], giving additional time to respond to reads. If @var{value} is defined, first assigns that. @end deffn diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 96accf3..e490f2e 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -101,6 +101,10 @@ static int adi_jtag_dp_scan(struct swjdp_common *swjdp, arm_jtag_set_instr(jtag_info, instr, NULL); /* Add specified number of tck clocks before accessing memory bus */ + + /* REVISIT these TCK cycles should be *AFTER* updating APACC, since + * they provide more time for the (MEM) AP to complete the read ... + */ if ((instr == JTAG_DP_APACC) && ((reg_addr == AP_REG_DRW) || ((reg_addr & 0xF0) == AP_REG_BD0)) @@ -137,6 +141,10 @@ static int adi_jtag_dp_scan_u32(struct swjdp_common *swjdp, arm_jtag_set_instr(jtag_info, instr, NULL); /* Add specified number of tck clocks before accessing memory bus */ + + /* REVISIT these TCK cycles should be *AFTER* updating APACC, since + * they provide more time for the (MEM) AP to complete the read ... + */ if ((instr == JTAG_DP_APACC) && ((reg_addr == AP_REG_DRW) || ((reg_addr & 0xF0) == AP_REG_BD0)) diff --git a/src/target/armv7a.c b/src/target/armv7a.c index 31538c2..fe87fee 100644 --- a/src/target/armv7a.c +++ b/src/target/armv7a.c @@ -174,40 +174,49 @@ COMMAND_HANDLER(handle_dap_info_command) return dap_info_command(CMD_CTX, swjdp, apsel); } +/* FIXME this table should be part of generic DAP support, and + * be shared by the ARMv7-A/R and ARMv7-M support ... + */ static const struct command_registration armv7a_exec_command_handlers[] = { { .name = "info", - .handler = &handle_dap_info_command, + .handler = handle_dap_info_command, .mode = COMMAND_EXEC, - .help = "dap info for ap [num], " - "default currently selected AP", + .help = "display ROM table for MEM-AP " + "(default currently selected AP)", + .usage = "[ap_num]", }, { .name = "apsel", - .handler = &handle_dap_apsel_command, + .handler = handle_dap_apsel_command, .mode = COMMAND_EXEC, - .help = "select a different AP [num] (default 0)", + .help = "Set the currently selected AP (default 0) " + "and display the result", + .usage = "[ap_num]", }, { .name = "apid", - .handler = &handle_dap_apid_command, + .handler = handle_dap_apid_command, .mode = COMMAND_EXEC, - .help = "return id reg from AP [num], " - "default currently selected AP", + .help = "return ID register from AP " + "(default currently selected AP)", + .usage = "[ap_num]", }, { .name = "baseaddr", - .handler = &handle_dap_baseaddr_command, + .handler = handle_dap_baseaddr_command, .mode = COMMAND_EXEC, - .help = "return debug base address from AP [num], " - "default currently selected AP", + .help = "return debug base address from MEM-AP " + "(default currently selected AP)", + .usage = "[ap_num]", }, { .name = "memaccess", - .handler = &handle_dap_memaccess_command, + .handler = handle_dap_memaccess_command, .mode = COMMAND_EXEC, - .help = "set/get number of extra tck for mem-ap memory " + .help = "set/get number of extra tck for MEM-AP memory " "bus access [0-255]", + .usage = "[cycles]", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/target/armv7m.c b/src/target/armv7m.c index 9d8132d..233fb95 100644 --- a/src/target/armv7m.c +++ b/src/target/armv7m.c @@ -799,40 +799,49 @@ COMMAND_HANDLER(handle_dap_info_command) return dap_info_command(CMD_CTX, swjdp, apsel); } +/* FIXME this table should be part of generic DAP support, and + * be shared by the ARMv7-A/R and ARMv7-M support ... + */ static const struct command_registration armv7m_exec_command_handlers[] = { { .name = "info", - .handler = &handle_dap_info_command, + .handler = handle_dap_info_command, .mode = COMMAND_EXEC, - .help = "dap info for ap [num], " - "default currently selected AP", + .help = "display ROM table for MEM-AP " + "(default currently selected AP)", + .usage = "[ap_num]", }, { .name = "apsel", - .handler = &handle_dap_apsel_command, + .handler = handle_dap_apsel_command, .mode = COMMAND_EXEC, - .help = "select a different AP [num] (default 0)", + .help = "Set the currently selected AP (default 0) " + "and display the result", + .usage = "[ap_num]", }, { .name = "apid", - .handler = &handle_dap_apid_command, + .handler = handle_dap_apid_command, .mode = COMMAND_EXEC, - .help = "return id reg from AP [num], " - "default currently selected AP", + .help = "return ID register from AP " + "(default currently selected AP)", + .usage = "[ap_num]", }, { .name = "baseaddr", - .handler = &handle_dap_baseaddr_command, + .handler = handle_dap_baseaddr_command, .mode = COMMAND_EXEC, - .help = "return debug base address from AP [num], " - "default currently selected AP", + .help = "return debug base address from MEM-AP " + "(default currently selected AP)", + .usage = "[ap_num]", }, { .name = "memaccess", - .handler = &handle_dap_memaccess_command, + .handler = handle_dap_memaccess_command, .mode = COMMAND_EXEC, - .help = "set/get number of extra tck for mem-ap memory " + .help = "set/get number of extra tck for MEM-AP memory " "bus access [0-255]", + .usage = "[cycles]", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 424263d..18edd95 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -1642,13 +1642,13 @@ COMMAND_HANDLER(cortex_a8_handle_dbginit_command) static const struct command_registration cortex_a8_exec_command_handlers[] = { { .name = "cache_info", - .handler = &cortex_a8_handle_cache_info_command, + .handler = cortex_a8_handle_cache_info_command, .mode = COMMAND_EXEC, .help = "display information about target caches", }, { .name = "dbginit", - .handler = &cortex_a8_handle_dbginit_command, + .handler = cortex_a8_handle_dbginit_command, .mode = COMMAND_EXEC, .help = "Initialize core debug", }, diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c index 9685821..c6b1bb2 100644 --- a/src/target/cortex_m3.c +++ b/src/target/cortex_m3.c @@ -1989,24 +1989,24 @@ COMMAND_HANDLER(handle_cortex_m3_mask_interrupts_command) static const struct command_registration cortex_m3_exec_command_handlers[] = { { .name = "disassemble", - .handler = &handle_cortex_m3_disassemble_command, + .handler = handle_cortex_m3_disassemble_command, .mode = COMMAND_EXEC, .help = "disassemble Thumb2 instructions", - .usage = "<address> [<count>]", + .usage = "address [count]", }, { .name = "maskisr", - .handler = &handle_cortex_m3_mask_interrupts_command, + .handler = handle_cortex_m3_mask_interrupts_command, .mode = COMMAND_EXEC, .help = "mask cortex_m3 interrupts", .usage = "['on'|'off']", }, { .name = "vector_catch", - .handler = &handle_cortex_m3_vector_catch_command, + .handler = handle_cortex_m3_vector_catch_command, .mode = COMMAND_EXEC, - .help = "catch hardware vectors", - .usage = "['all'|'none'|<list>]", + .help = "configure hardware vectors to trigger debug entry", + .usage = "['all'|'none'|('bus_err'|'chk_err'|...)*]", }, COMMAND_REGISTRATION_DONE }; commit e19fe9ad09e28df1976257052afe6edf765aa778 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 15:22:41 2010 -0800 ARM ETM/ETB/trace: help/usage updates Provide helptext which was sometimes missing; update some of it to be more accurate. Usage syntax messages have the same EBNF as the User's Guide; no angle brackets in either place. Don't use "&function"; functions are like arrays, their address is their name. Shrink some overlong lines, remove some empties. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/etb.c b/src/target/etb.c index fb2dd60..18258f6 100644 --- a/src/target/etb.c +++ b/src/target/etb.c @@ -447,17 +447,21 @@ COMMAND_HANDLER(handle_etb_trigger_percent_command) static const struct command_registration etb_config_command_handlers[] = { { + /* NOTE: with ADIv5, ETBs are accessed using DAP operations, + * possibly over SWD, not through separate TAPs... + */ .name = "config", - .handler = &handle_etb_config_command, + .handler = handle_etb_config_command, .mode = COMMAND_CONFIG, + .help = "Associate ETB with target and JTAG TAP.", .usage = "target tap", }, { .name = "trigger_percent", - .handler = &handle_etb_trigger_percent_command, + .handler = handle_etb_trigger_percent_command, .mode = COMMAND_EXEC, - .help = "percent of trace buffer to be filled " - "after the trigger occurs", + .help = "Set percent of trace buffer to be filled " + "after the trigger occurs (2..100).", .usage = "[percent]", }, COMMAND_REGISTRATION_DONE diff --git a/src/target/etm.c b/src/target/etm.c index d22bc40..3126efc 100644 --- a/src/target/etm.c +++ b/src/target/etm.c @@ -1259,12 +1259,16 @@ COMMAND_HANDLER(handle_etm_tracemode_command) case 0: break; case 4: - CALL_COMMAND_HANDLER(handle_etm_tracemode_command_update, &tracemode); + CALL_COMMAND_HANDLER(handle_etm_tracemode_command_update, + &tracemode); break; default: - command_print(CMD_CTX, "usage: configure trace mode " - "<none | data | address | all> " - "<context id bits> <cycle accurate> <branch output>"); + command_print(CMD_CTX, "usage: tracemode " + "('none'|'data'|'address'|'all') " + "context_id_bits " + "('enable'|'disable') " + "('enable'|'disable')" + ); return ERROR_FAIL; } @@ -2112,11 +2116,16 @@ COMMAND_HANDLER(handle_etm_analyze_command) static const struct command_registration etm_config_command_handlers[] = { { + /* NOTE: with ADIv5, ETMs are accessed by DAP operations, + * possibly over SWD, not JTAG scanchain 6 of 'target'. + * + * Also, these parameters don't match ETM v3+ modules... + */ .name = "config", - .handler = &handle_etm_config_command, + .handler = handle_etm_config_command, .mode = COMMAND_CONFIG, - .usage = "<target> <port_width> <port_mode> " - "<clocking> <capture_driver>", + .help = "Set up ETM output port.", + .usage = "target port_width port_mode clocking capture_driver", }, COMMAND_REGISTRATION_DONE }; @@ -2132,33 +2141,36 @@ const struct command_registration etm_command_handlers[] = { static const struct command_registration etm_exec_command_handlers[] = { { - .name = "tracemode", handle_etm_tracemode_command, + .name = "tracemode", + .handler = handle_etm_tracemode_command, .mode = COMMAND_EXEC, .help = "configure/display trace mode", - .usage = "<none | data | address | all> " - "<context_id_bits> <cycle_accurate> <branch_output>", + .usage = "('none'|'data'|'address'|'all') " + "context_id_bits " + "['enable'|'disable'] " + "['enable'|'disable']", }, { .name = "info", - .handler = &handle_etm_info_command, + .handler = handle_etm_info_command, .mode = COMMAND_EXEC, .help = "display info about the current target's ETM", }, { .name = "status", - .handler = &handle_etm_status_command, + .handler = handle_etm_status_command, .mode = COMMAND_EXEC, .help = "display current target's ETM status", }, { .name = "start", - .handler = &handle_etm_start_command, + .handler = handle_etm_start_command, .mode = COMMAND_EXEC, .help = "start ETM trace collection", }, { .name = "stop", - .handler = &handle_etm_stop_command, + .handler = handle_etm_stop_command, .mode = COMMAND_EXEC, .help = "stop ETM trace collection", }, @@ -2167,7 +2179,7 @@ static const struct command_registration etm_exec_command_handlers[] = { .handler = handle_etm_trigger_debug_command, .mode = COMMAND_EXEC, .help = "enable/disable debug entry on trigger", - .usage = "(enable | disable)", + .usage = "['enable'|'disable']", }, { .name = "analyze", @@ -2177,19 +2189,21 @@ static const struct command_registration etm_exec_command_handlers[] = { }, { .name = "image", - .handler = &handle_etm_image_command, + .handler = handle_etm_image_command, .mode = COMMAND_EXEC, - .help = "load image from <file> [base address]", + .help = "load image from file with optional offset", + .usage = "filename [offset]", }, { .name = "dump", - .handler = &handle_etm_dump_command, + .handler = handle_etm_dump_command, .mode = COMMAND_EXEC, - .help = "dump captured trace data <file>", + .help = "dump captured trace data to file", + .usage = "filename", }, { .name = "load", - .handler = &handle_etm_load_command, + .handler = handle_etm_load_command, .mode = COMMAND_EXEC, .help = "load trace data for analysis <file>", }, diff --git a/src/target/etm_dummy.c b/src/target/etm_dummy.c index 19a078f..f9c6fe7 100644 --- a/src/target/etm_dummy.c +++ b/src/target/etm_dummy.c @@ -61,9 +61,9 @@ COMMAND_HANDLER(handle_etm_dummy_config_command) static const struct command_registration etm_dummy_config_command_handlers[] = { { .name = "config", - .handler = &handle_etm_dummy_config_command, + .handler = handle_etm_dummy_config_command, .mode = COMMAND_CONFIG, - .usage = "<target>", + .usage = "target", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/target/oocd_trace.c b/src/target/oocd_trace.c index 2533c40..3b43571 100644 --- a/src/target/oocd_trace.c +++ b/src/target/oocd_trace.c @@ -398,13 +398,13 @@ COMMAND_HANDLER(handle_oocd_trace_resync_command) static const struct command_registration oocd_trace_all_command_handlers[] = { { .name = "config", - .handler = &handle_oocd_trace_config_command, + .handler = handle_oocd_trace_config_command, .mode = COMMAND_CONFIG, - .usage = "<target>", + .usage = "target", }, { .name = "status", - .handler = &handle_oocd_trace_status_command, + .handler = handle_oocd_trace_status_command, .mode = COMMAND_EXEC, .help = "display OpenOCD + trace status", }, commit dd8f679aa2ea447a96f393db3a8938259f63eebc Author: David Brownell <dbr...@us...> Date: Thu Jan 7 15:05:26 2010 -0800 target misc: help/usage updates Provide helptext which was sometimes missing; update some of it to be more accurate. Usage syntax messages have the same EBNF as the User's Guide. Don't use "&function"; functions are like arrays, their address is their name. Shrink some overlong lines; remove some empties. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/target.c b/src/target/target.c index 73a762d..c29c45e 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -45,8 +45,10 @@ #include "image.h" -static int target_array2mem(Jim_Interp *interp, struct target *target, int argc, Jim_Obj *const *argv); -static int target_mem2array(Jim_Interp *interp, struct target *target, int argc, Jim_Obj *const *argv); +static int target_array2mem(Jim_Interp *interp, struct target *target, + int argc, Jim_Obj *const *argv); +static int target_mem2array(Jim_Interp *interp, struct target *target, + int argc, Jim_Obj *const *argv); /* targets */ extern struct target_type arm7tdmi_target; @@ -2960,7 +2962,8 @@ static void writeGmon(uint32_t *samples, uint32_t sampleNum, const char *filenam fclose(f); } -/* profiling samples the CPU PC as quickly as OpenOCD is able, which will be used as a random sampling of PC */ +/* profiling samples the CPU PC as quickly as OpenOCD is able, + * which will be used as a random sampling of PC */ COMMAND_HANDLER(handle_profile_command) { struct target *target = get_current_target(CMD_CTX); @@ -2976,6 +2979,12 @@ COMMAND_HANDLER(handle_profile_command) timeval_add_time(&timeout, offset, 0); + /** + * @todo: Some cores let us sample the PC without the + * annoying halt/resume step; for example, ARMv7 PCSR. + * Provide a way to use that more efficient mechanism. + */ + command_print(CMD_CTX, "Starting profiling. Halting and resuming the target as often as we can..."); static const int maxSample = 10000; @@ -3287,7 +3296,9 @@ static int jim_array2mem(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return target_array2mem(interp,target, argc-1, argv + 1); } -static int target_array2mem(Jim_Interp *interp, struct target *target, int argc, Jim_Obj *const *argv) + +static int target_array2mem(Jim_Interp *interp, struct target *target, + int argc, Jim_Obj *const *argv) { long l; uint32_t width; @@ -3789,11 +3800,13 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target) return JIM_OK; } -static int jim_target_configure(Jim_Interp *interp, int argc, Jim_Obj *const *argv) +static int +jim_target_configure(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { Jim_GetOptInfo goi; + Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1); - goi.isconfigure = strcmp(Jim_GetString(argv[0], NULL), "configure") == 0; + goi.isconfigure = !strcmp(Jim_GetString(argv[0], NULL), "configure"); int need_args = 1 + goi.isconfigure; if (goi.argc < need_args) { @@ -3988,13 +4001,15 @@ static int jim_target_md(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return JIM_OK; } -static int jim_target_mem2array(Jim_Interp *interp, int argc, Jim_Obj *const *argv) +static int jim_target_mem2array(Jim_Interp *interp, + int argc, Jim_Obj *const *argv) { struct target *target = Jim_CmdPrivData(interp); return target_mem2array(interp, target, argc - 1, argv + 1); } -static int jim_target_array2mem(Jim_Interp *interp, int argc, Jim_Obj *const *argv) +static int jim_target_array2mem(Jim_Interp *interp, + int argc, Jim_Obj *const *argv) { struct target *target = Jim_CmdPrivData(interp); return target_array2mem(interp, target, argc - 1, argv + 1); @@ -4219,108 +4234,123 @@ static const struct command_registration target_instance_command_handlers[] = { { .name = "configure", .mode = COMMAND_CONFIG, - .jim_handler = &jim_target_configure, - .usage = "[<target_options> ...]", + .jim_handler = jim_target_configure, .help = "configure a new target for use", + .usage = "[target_attribute ...]", }, { .name = "cget", .mode = COMMAND_ANY, - .jim_handler = &jim_target_configure, - .usage = "<target_type> [<target_options> ...]", - .help = "configure a new target for use", + .jim_handler = jim_target_configure, + .help = "returns the specified target attribute", + .usage = "target_attribute", }, { .name = "mww", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_mw, - .usage = "<address> <data> [<count>]", + .jim_handler = jim_target_mw, .help = "Write 32-bit word(s) to target memory", + .usage = "address data [count]", }, { .name = "mwh", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_mw, - .usage = "<address> <data> [<count>]", + .jim_handler = jim_target_mw, .help = "Write 16-bit half-word(s) to target memory", + .usage = "address data [count]", }, { .name = "mwb", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_mw, - .usage = "<address> <data> [<count>]", + .jim_handler = jim_target_mw, .help = "Write byte(s) to target memory", + .usage = "address data [count]", }, { .name = "mdw", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_md, - .usage = "<address> [<count>]", + .jim_handler = jim_target_md, .help = "Display target memory as 32-bit words", + .usage = "address [count]", }, { .name = "mdh", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_md, - .usage = "<address> [<count>]", + .jim_handler = jim_target_md, .help = "Display target memory as 16-bit half-words", + .usage = "address [count]", }, { .name = "mdb", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_md, - .usage = "<address> [<count>]", + .jim_handler = jim_target_md, .help = "Display target memory as 8-bit bytes", + .usage = "address [count]", }, { .name = "array2mem", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_array2mem, + .jim_handler = jim_target_array2mem, + .help = "Writes Tcl array of 8/16/32 bit numbers " + "to target memory", + .usage = "arrayname bitwidth address count", }, { .name = "mem2array", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_mem2array, + .jim_handler = jim_target_mem2array, + .help = "Loads Tcl array of 8/16/32 bit numbers " + "from target memory", + .usage = "arrayname bitwidth address count", }, { .name = "eventlist", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_event_list, + .jim_handler = jim_target_event_list, + .help = "displays a table of events defined for this target", }, { .name = "curstate", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_current_state, + .jim_handler = jim_target_current_state, + .help = "displays the current state of this target", }, { .name = "arp_examine", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_examine, + .jim_handler = jim_target_examine, + .help = "used internally for reset processing", }, { .name = "arp_poll", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_poll, + .jim_handler = jim_target_poll, + .help = "used internally for reset processing", }, { .name = "arp_reset", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_reset, + .jim_handler = jim_target_reset, + .help = "used internally for reset processing", }, { .name = "arp_halt", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_halt, + .jim_handler = jim_target_halt, + .help = "used internally for reset processing", }, { .name = "arp_waitstate", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_wait_state, + .jim_handler = jim_target_wait_state, + .help = "used internally for reset processing", }, { .name = "invoke-event", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_invoke_event, + .jim_handler = jim_target_invoke_event, + .help = "invoke handler for specified event", + .usage = "event_name", }, COMMAND_REGISTRATION_DONE }; @@ -4472,7 +4502,7 @@ static int target_create(Jim_GetOptInfo *goi) } *tpp = target; } - + /* now - create the new target name command */ const const struct command_registration target_subcommands[] = { { @@ -4615,51 +4645,54 @@ static const struct command_registration target_subcommand_handlers[] = { { .name = "init", .mode = COMMAND_CONFIG, - .handler = &handle_target_init_command, + .handler = handle_target_init_command, .help = "initialize targets", }, { .name = "create", + /* REVISIT this should be COMMAND_CONFIG ... */ .mode = COMMAND_ANY, - .jim_handler = &jim_target_create, - .usage = "<name> <type> ...", - .help = "Returns the currently selected target", + .jim_handler = jim_target_create, + .usage = "name type '-chain-position' name [options ...]", + .help = "Creates and selects a new target", }, { .name = "current", .mode = COMMAND_ANY, - .jim_handler = &jim_target_current, + .jim_handler = jim_target_current, .help = "Returns the currently selected target", }, { .name = "types", .mode = COMMAND_ANY, - .jim_handler = &jim_target_types, - .help = "Returns the available target types as a list of strings", + .jim_handler = jim_target_types, + .help = "Returns the available target types as " + "a list of strings", }, { .name = "names", .mode = COMMAND_ANY, - .jim_handler = &jim_target_names, + .jim_handler = jim_target_names, .help = "Returns the names of all targets as a list of strings", }, { .name = "number", .mode = COMMAND_ANY, - .jim_handler = &jim_target_number, - .usage = "<number>", - .help = "Returns the name of target <n>", + .jim_handler = jim_target_number, + .usage = "number", + .help = "Returns the name of the numbered target " + "(DEPRECATED)", }, { .name = "count", .mode = COMMAND_ANY, - .jim_handler = &jim_target_count, - .help = "Returns the number of targets as an integer", + .jim_handler = jim_target_count, + .help = "Returns the number of targets as an integer " + "(DEPRECATED)", }, COMMAND_REGISTRATION_DONE }; - struct FastLoad { uint32_t address; @@ -4833,11 +4866,11 @@ COMMAND_HANDLER(handle_fast_load_command) static const struct command_registration target_command_handlers[] = { { .name = "targets", - .handler = &handle_targets_command, + .handler = handle_targets_command, .mode = COMMAND_ANY, - .help = "change current command line target (one parameter) " - "or list targets (no parameters)", - .usage = "[<new_current_target>]", + .help = "change current default target (one parameter) " + "or prints table of all targets (no parameters)", + .usage = "[target]", }, { .name = "target", @@ -4857,69 +4890,75 @@ int target_register_commands(struct command_context *cmd_ctx) static const struct command_registration target_exec_command_handlers[] = { { .name = "fast_load_image", - .handler = &handle_fast_load_image_command, + .handler = handle_fast_load_image_command, .mode = COMMAND_ANY, - .help = "Load image into memory, mainly for profiling purposes", - .usage = "<file> <address> ['bin'|'ihex'|'elf'|'s19'] " - "[min_address] [max_length]", + .help = "Load image into server memory for later use by " + "fast_load; primarily for profiling", + .usage = "filename address ['bin'|'ihex'|'elf'|'s19'] " + "[min_address [max_length]]", }, { .name = "fast_load", - .handler = &handle_fast_load_command, + .handler = handle_fast_load_command, .mode = COMMAND_EXEC, .help = "loads active fast load image to current target " "- mainly for profiling purposes", }, { .name = "profile", - .handler = &handle_profile_command, + .handler = handle_profile_command, .mode = COMMAND_EXEC, .help = "profiling samples the CPU PC", }, /** @todo don't register virt2phys() unless target supports it */ { .name = "virt2phys", - .handler = &handle_virt2phys_command, + .handler = handle_virt2phys_command, .mode = COMMAND_ANY, .help = "translate a virtual address into a physical address", + .usage = "virual_address", }, - { .name = "reg", - .handler = &handle_reg_command, + .handler = handle_reg_command, .mode = COMMAND_EXEC, - .help = "display or set a register", + .help = "display or set a register; with no arguments, " + "displays all registers and their values", + .usage = "[(register_name|register_number) [value]]", }, - { .name = "poll", - .handler = &handle_poll_command, + .handler = handle_poll_command, .mode = COMMAND_EXEC, - .help = "poll target state", + .help = "poll target state; or reconfigure background polling", + .usage = "['on'|'off']", }, { .name = "wait_halt", - .handler = &handle_wait_halt_command, + .handler = handle_wait_halt_command, .mode = COMMAND_EXEC, - .help = "wait for target halt", - .usage = "[time (s)]", + .help = "wait up to the specified number of milliseconds " + "(default 5) for a previously requested halt", + .usage = "[milliseconds]", }, { .name = "halt", - .handler = &handle_halt_command, + .handler = handle_halt_command, .mode = COMMAND_EXEC, - .help = "halt target", + .help = "request target to halt, then wait up to the specified" + "number of milliseconds (default 5) for it to complete", + .usage = "[milliseconds]", }, { .name = "resume", - .handler = &handle_resume_command, + .handler = handle_resume_command, .mode = COMMAND_EXEC, - .help = "resume target", - .usage = "[<address>]", + .help = "resume target execution from current PC or address", + .usage = "[address]", }, { .name = "reset", - .handler = &handle_reset_command, + .handler = handle_reset_command, .mode = COMMAND_EXEC, .usage = "[run|halt|init]", .help = "Reset all targets into the specified mode." @@ -4927,133 +4966,127 @@ static const struct command_registration target_exec_command_handlers[] = { }, { .name = "soft_reset_halt", - .handler = &handle_soft_reset_halt_command, + .handler = handle_soft_reset_halt_command, .mode = COMMAND_EXEC, .help = "halt the target and do a soft reset", }, { - .name = "step", - .handler = &handle_step_command, + .handler = handle_step_command, .mode = COMMAND_EXEC, - .help = "step one instruction from current PC or [addr]", - .usage = "[<address>]", + .help = "step one instruction from current PC or address", + .usage = "[address]", }, { - .name = "mdw", - .handler = &handle_md_command, + .handler = handle_md_command, .mode = COMMAND_EXEC, .help = "display memory words", - .usage = "[phys] <addr> [count]", + .usage = "['phys'] address [count]", }, { .name = "mdh", - .handler = &handle_md_command, + .handler = handle_md_command, .mode = COMMAND_EXEC, .help = "display memory half-words", - .usage = "[phys] <addr> [count]", + .usage = "['phys'] address [count]", }, { .name = "mdb", - .handler = &handle_md_command, + .handler = handle_md_command, .mode = COMMAND_EXEC, .help = "display memory bytes", - .usage = "[phys] <addr> [count]", + .usage = "['phys'] address [count]", }, { - .name = "mww", - .handler = &handle_mw_command, + .handler = handle_mw_command, .mode = COMMAND_EXEC, .help = "write memory word", - .usage = "[phys] <addr> <value> [count]", + .usage = "['phys'] address value [count]", }, { .name = "mwh", - .handler = &handle_mw_command, + .handler = handle_mw_command, .mode = COMMAND_EXEC, .help = "write memory half-word", - .usage = "[phys] <addr> <value> [count]", + .usage = "['phys'] address value [count]", }, { .name = "mwb", - .handler = &handle_mw_command, + .handler = handle_mw_command, .mode = COMMAND_EXEC, .help = "write memory byte", - .usage = "[phys] <addr> <value> [count]", + .usage = "['phys'] address value [count]", }, { - .name = "bp", - .handler = &handle_bp_command, + .handler = handle_bp_command, .mode = COMMAND_EXEC, - .help = "list or set breakpoint", - .usage = "[<address> <length> [hw]]", + .help = "list or set hardware or software breakpoint", + .usage = "[address length ['hw']]", }, { .name = "rbp", - .handler = &handle_rbp_command, + .handler = handle_rbp_command, .mode = COMMAND_EXEC, .help = "remove breakpoint", - .usage = "<address>", + .usage = "address", }, { - .name = "wp", - .handler = &handle_wp_command, + .handler = handle_wp_command, .mode = COMMAND_EXEC, - .help = "list or set watchpoint", - .usage = "[<address> <length> <r/w/a> [value] [mask]]", + .help = "list (no params) or create watchpoints", + .usage = "[address length [('r'|'w'|'a') value [mask]]]", }, { .name = "rwp", - .handler = &handle_rwp_command, + .handler = handle_rwp_command, .mode = COMMAND_EXEC, .help = "remove watchpoint", - .usage = "<address>", - + .usage = "address", }, { .name = "load_image", - .handler = &handle_load_image_command, + .handler = handle_load_image_command, .mode = COMMAND_EXEC, - .usage = "<file> <address> ['bin'|'ihex'|'elf'|'s19'] " + .usage = "filename address ['bin'|'ihex'|'elf'|'s19'] " "[min_address] [max_length]", }, { .name = "dump_image", - .handler = &handle_dump_image_command, + .handler = handle_dump_image_command, .mode = COMMAND_EXEC, - .usage = "<file> <address> <size>", + .usage = "filename address size", }, { .name = "verify_image", - .handler = &handle_verify_image_command, + .handler = handle_verify_image_command, .mode = COMMAND_EXEC, - .usage = "<file> [offset] [type]", + .usage = "filename [offset [type]]", }, { .name = "test_image", - .handler = &handle_test_image_command, + .handler = handle_test_image_command, .mode = COMMAND_EXEC, - .usage = "<file> [offset] [type]", + .usage = "filename [offset [type]]", }, { .name = "ocd_mem2array", .mode = COMMAND_EXEC, - .jim_handler = &jim_mem2array, - .help = "read memory and return as a TCL array " + .jim_handler = jim_mem2array, + .help = "read 8/16/32 bit memory and return as a TCL array " "for script processing", - .usage = "<arrayname> <width=32|16|8> <address> <count>", + .usage = "arrayname bitwidth address count", }, { .name = "ocd_array2mem", .mode = COMMAND_EXEC, - .jim_handler = &jim_array2mem, + .jim_handler = jim_array2mem, .help = "convert a TCL array to memory locations " - "and write the values", - .usage = "<arrayname> <width=32|16|8> <address> <count>", + "and write the 8/16/32 bit values", + .usage = "arrayname bitwidth address count", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/target/target_request.c b/src/target/target_request.c index d22b8a2..ec3d48e 100644 --- a/src/target/target_request.c +++ b/src/target/target_request.c @@ -303,10 +303,10 @@ COMMAND_HANDLER(handle_target_request_debugmsgs_command) static const struct command_registration target_req_exec_command_handlers[] = { { .name = "debugmsgs", - .handler = &handle_target_request_debugmsgs_command, + .handler = handle_target_request_debugmsgs_command, .mode = COMMAND_EXEC, - .help = "set reception of debug messages from target", - .usage = "(enable|disable)", + .help = "display and/or modify reception of debug messages from target", + .usage = "['enable'|'charmsg'|'disable']", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/target/trace.c b/src/target/trace.c index 56a18a4..a8ec143 100644 --- a/src/target/trace.c +++ b/src/target/trace.c @@ -159,18 +159,18 @@ COMMAND_HANDLER(handle_trace_history_command) static const struct command_registration trace_exec_command_handlers[] = { { .name = "history", - .handler = &handle_trace_history_command, + .handler = handle_trace_history_command, .mode... [truncated message content] |