From: David B. <dbr...@us...> - 2010-01-10 07:21:14
|
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 ab4307e693dad8181f1570b5cdd7f132661a608b (commit) via 5cb1dcfad34aab7de64ef85f6227f28f3711dd85 (commit) via 0811f6b192674788a00e02fbbfe29e0a2a138ea2 (commit) via ad5fd390634799ecabddc32d0ce415ef72036b4a (commit) via ff647e6bb4180a7c376b61caeb14951ba84d5717 (commit) from 1dd5277ba3eb8c5938832b41c2bf6cb5bf19146e (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 ab4307e693dad8181f1570b5cdd7f132661a608b Author: David Brownell <dbr...@us...> Date: Sat Jan 9 22:15:57 2010 -0800 jtag/tcl help/usage fixups The usual: expand several helptexts to be more correct and to use full sentences; make the usage messages use the same EBNF as the User's Guide; use function names for their addresses. Also add a comment about that odd jtag_command_handlers_to_move[] thing. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index 00b1038..7329cee 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -269,26 +269,39 @@ static int Jim_Command_flush_count(Jim_Interp *interp, int argc, Jim_Obj *const return JIM_OK; } +/* REVISIT Just what about these should "move" ... ? + * These registrations, into the main JTAG table? + * + * There's a minor compatibility issue, these all show up twice; + * that's not desirable: + * - jtag drscan ... NOT DOCUMENTED! + * - drscan ... + * + * The "irscan" command (for example) doesn't show twice. + */ static const struct command_registration jtag_command_handlers_to_move[] = { { .name = "drscan", .mode = COMMAND_EXEC, - .jim_handler = &Jim_Command_drscan, - .help = "execute DR scan <device> " - "<num_bits> <value> <num_bits1> <value2> ...", + .jim_handler = Jim_Command_drscan, + .help = "Execute Data Register (DR) scan for one TAP. " + "Other TAPs must be in BYPASS mode.", + .usage = "tap_name [num_bits value]* ['-endstate' state_name]", }, { .name = "flush_count", .mode = COMMAND_EXEC, - .jim_handler = &Jim_Command_flush_count, - .help = "returns number of times the JTAG queue has been flushed", + .jim_handler = Jim_Command_flush_count, + .help = "Returns the number of times the JTAG queue " + "has been flushed.", }, { .name = "pathmove", .mode = COMMAND_EXEC, - .jim_handler = &Jim_Command_pathmove, - .usage = "<state1>,<state2>,<state3>... ", - .help = "move JTAG to state1 then to state2, state3, etc.", + .jim_handler = Jim_Command_pathmove, + .usage = "start_state state1 [state2 [state3 ...]]", + .help = "Move JTAG state machine from current state " + "(start_state) to state1, then state2, state3, etc.", }, COMMAND_REGISTRATION_DONE }; @@ -658,7 +671,8 @@ static void jtag_tap_handle_event(struct jtag_tap *tap, enum jtag_event e) } } -static int jim_jtag_interface(Jim_Interp *interp, int argc, Jim_Obj *const *argv) +static int +jim_jtag_interface(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { Jim_GetOptInfo goi; Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1); @@ -845,73 +859,88 @@ static const struct command_registration jtag_subcommand_handlers[] = { { .name = "init", .mode = COMMAND_ANY, - .handler = &handle_jtag_init_command, + .handler = handle_jtag_init_command, .help = "initialize jtag scan chain", }, { .name = "interface", .mode = COMMAND_ANY, - .jim_handler = &jim_jtag_interface, - .help = "Returns the selected interface", + .jim_handler = jim_jtag_interface, + .help = "Returns the name of the currently selected interface.", }, { .name = "arp_init", .mode = COMMAND_ANY, - .jim_handler = &jim_jtag_arp_init, + .jim_handler = jim_jtag_arp_init, + .help = "Validates JTAG scan chain against the list of " + "declared TAPs using just the four standard JTAG " + "signals.", }, { .name = "arp_init-reset", .mode = COMMAND_ANY, - .jim_handler = &jim_jtag_arp_init_reset, + .jim_handler = jim_jtag_arp_init_reset, + .help = "Uses TRST and SRST to try resetting everything on " + "the JTAG scan chain, then performs 'jtag arp_init'." }, { .name = "newtap", .mode = COMMAND_CONFIG, - .jim_handler = &jim_jtag_newtap, - .help = "Create a new TAP instance", - .usage = "<name> <type> -irlen <count> [-ircapture <count>] " - "[-irmask <count>] [-enable|-disable]", + .jim_handler = jim_jtag_newtap, + .help = "Create a new TAP instance named basename.tap_type, " + "and appends it to the scan chain.", + .usage = "basename tap_type '-irlen' count " + "['-enable'|'-disable'] " + "['-expected_id' number] " + "['-ignore-version'] " + "['-ircapture' number] " + "['-mask' number] ", }, { .name = "tapisenabled", .mode = COMMAND_EXEC, - .jim_handler = &jim_jtag_tap_enabler, - .help = "Returns a integer indicating TAP state (0/1)", - .usage = "<name>", + .jim_handler = jim_jtag_tap_enabler, + .help = "Returns a Tcl boolean (0/1) indicating whether " + "the TAP is enabled (1) or not (0).", + .usage = "tap_name", }, { .name = "tapenable", .mode = COMMAND_EXEC, - .jim_handler = &jim_jtag_tap_enabler, - .help = "Enable the specified TAP", - .usage = "<name>", + .jim_handler = jim_jtag_tap_enabler, + .help = "Try to enable the specified TAP using the " + "'tap-enable' TAP event.", + .usage = "tap_name", }, { .name = "tapdisable", .mode = COMMAND_EXEC, - .jim_handler = &jim_jtag_tap_enabler, - .help = "Enable the specified TAP", - .usage = "<name>", + .jim_handler = jim_jtag_tap_enabler, + .help = "Try to disable the specified TAP using the " + "'tap-disable' TAP event.", + .usage = "tap_name", }, { .name = "configure", .mode = COMMAND_EXEC, - .jim_handler = &jim_jtag_configure, - .help = "Enable the specified TAP", - .usage = "<name> [<key> <value> ...]", + .jim_handler = jim_jtag_configure, + .help = "Provide a Tcl handler for the specified " + "TAP event.", + .usage = "tap_name '-event' event_name handler", }, { .name = "cget", .mode = COMMAND_EXEC, - .jim_handler = &jim_jtag_configure, - .help = "Enable the specified TAP", - .usage = "<name> [<key> <value> ...]", + .jim_handler = jim_jtag_configure, + .help = "Return any Tcl handler for the specified " + "TAP event.", + .usage = "tap_name '-event' event_name", }, { .name = "names", .mode = COMMAND_ANY, - .jim_handler = &jim_jtag_names, - .help = "Returns list of all JTAG tap names", + .jim_handler = jim_jtag_names, + .help = "Returns list of all JTAG tap names.", }, { .chain = jtag_command_handlers_to_move, @@ -1574,34 +1603,38 @@ COMMAND_HANDLER(handle_tms_sequence_command) static const struct command_registration jtag_command_handlers[] = { { .name = "interface", - .handler = &handle_interface_command, + .handler = handle_interface_command, .mode = COMMAND_CONFIG, - .help = "select a JTAG interface", - .usage = "<driver_name>", + .help = "Select a JTAG interface", + .usage = "driver_name", }, { .name = "interface_list", - .handler = &handle_interface_list_command, + .handler = handle_interface_list_command, .mode = COMMAND_ANY, - .help = "list all built-in interfaces", + .help = "List all built-in interfaces", }, { .name = "jtag_khz", - .handler = &handle_jtag_khz_command, + .handler = handle_jtag_khz_command, .mode = COMMAND_ANY, - .help = "set maximum jtag speed (if supported)", - .usage = "<khz:0=rtck>", + .help = "With an argument, change to the specified maximum " + "jtag speed. Pass 0 to require adaptive clocking. " + "With or without argument, display current setting.", + .usage = "[khz]", }, { .name = "jtag_rclk", - .handler = &handle_jtag_rclk_command, + .handler = handle_jtag_rclk_command, .mode = COMMAND_ANY, - .help = "set JTAG speed to RCLK or use fallback speed", - .usage = "<fallback_speed_khz>", + .help = "With an argument, change to to use adaptive clocking " + "if possible; else to use the fallback speed. " + "With or without argument, display current setting.", + .usage = "[fallback_speed_khz]", }, { .name = "reset_config", - .handler = &handle_reset_config_command, + .handler = handle_reset_config_command, .mode = COMMAND_ANY, .help = "configure JTAG reset behavior", .usage = "[none|trst_only|srst_only|trst_and_srst] " @@ -1612,79 +1645,87 @@ static const struct command_registration jtag_command_handlers[] = { }, { .name = "jtag_nsrst_delay", - .handler = &handle_jtag_nsrst_delay_command, + .handler = handle_jtag_nsrst_delay_command, .mode = COMMAND_ANY, .help = "delay after deasserting srst in ms", - .usage = "<ms>", + .usage = "[milliseconds]", }, { .name = "jtag_ntrst_delay", - .handler = &handle_jtag_ntrst_delay_command, + .handler = handle_jtag_ntrst_delay_command, .mode = COMMAND_ANY, .help = "delay after deasserting trst in ms", - .usage = "<ms>" + .usage = "[milliseconds]", }, { .name = "jtag_nsrst_assert_width", - .handler = &handle_jtag_nsrst_assert_width_command, + .handler = handle_jtag_nsrst_assert_width_command, .mode = COMMAND_ANY, .help = "delay after asserting srst in ms", - .usage = "<ms>" + .usage = "[milliseconds]", }, { .name = "jtag_ntrst_assert_width", - .handler = &handle_jtag_ntrst_assert_width_command, + .handler = handle_jtag_ntrst_assert_width_command, .mode = COMMAND_ANY, .help = "delay after asserting trst in ms", - .usage = "<ms>" + .usage = "[milliseconds]", }, { .name = "scan_chain", - .handler = &handle_scan_chain_command, + .handler = handle_scan_chain_command, .mode = COMMAND_EXEC, .help = "print current scan chain configuration", }, { .name = "jtag_reset", - .handler = &handle_jtag_reset_command, + .handler = handle_jtag_reset_command, .mode = COMMAND_EXEC, - .help = "toggle reset lines", - .usage = "<trst> <srst>", + .help = "Set reset line values. Value '1' is active, " + "value '0' is inactive.", + .usage = "trst_active srst_active", }, { .name = "runtest", - .handler = &handle_runtest_command, + .handler = handle_runtest_command, .mode = COMMAND_EXEC, - .help = "move to Run-Test/Idle, and execute <num_cycles>", - .usage = "<num_cycles>" + .help = "Move to Run-Test/Idle, and issue TCK for num_cycles.", + .usage = "num_cycles" }, { .name = "irscan", - .handler = &handle_irscan_command, + .handler = handle_irscan_command, .mode = COMMAND_EXEC, - .help = "execute IR scan", - .usage = "<device> <instr> [dev2] [instr2] ...", + .help = "Execute Instruction Register (DR) scan. The " + "specified opcodes are put into each TAP's IR, " + "and other TAPs are put in BYPASS.", + .usage = "[tap_name instruction]* ['-endstate' state_name]", }, { .name = "verify_ircapture", - .handler = &handle_verify_ircapture_command, + .handler = handle_verify_ircapture_command, .mode = COMMAND_ANY, - .help = "verify value captured during Capture-IR", - .usage = "<enable | disable>", + .help = "Display or assign flag controlling whether to " + "verify values captured during Capture-IR.", + .usage = "['enable'|'disable']", }, { .name = "verify_jtag", - .handler = &handle_verify_jtag_command, + .handler = handle_verify_jtag_command, .mode = COMMAND_ANY, - .help = "verify value capture", - .usage = "<enable | disable>", + .help = "Display or assign flag controlling whether to " + "verify values captured during IR and DR scans.", + .usage = "['enable'|'disable']", }, { .name = "tms_sequence", - .handler = &handle_tms_sequence_command, + .handler = handle_tms_sequence_command, .mode = COMMAND_ANY, - .help = "choose short(default) or long tms_sequence", - .usage = "<short | long>", + .help = "Display or change what style TMS sequences to use " + "for JTAG state transitions: short (default) or " + "long. Only for working around JTAG bugs.", + /* Specifically for working around DRIVER bugs... */ + .usage = "['short'|'long']", }, { .name = "jtag", commit 5cb1dcfad34aab7de64ef85f6227f28f3711dd85 Author: David Brownell <dbr...@us...> Date: Sat Jan 9 22:14:08 2010 -0800 ZY1000 help/usage fixups The usual: same EBNF as in the User's Guide, full sentence helptext, function names *are* their addresses. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c index 7c5f440..e66a8b5 100644 --- a/src/jtag/zy1000/zy1000.c +++ b/src/jtag/zy1000/zy1000.c @@ -832,29 +832,32 @@ void embeddedice_write_dcc(struct jtag_tap *tap, int reg_addr, uint8_t *buffer, static const struct command_registration zy1000_commands[] = { { .name = "power", - .handler = &handle_power_command, + .handler = handle_power_command, .mode = COMMAND_ANY, - .help = "turn power switch to target on/off. No arguments - print status.", - .usage = "power <on/off>", + .help = "Turn power switch to target on/off. " + "With no arguments, prints status.", + .usage = "('on'|'off)", }, { .name = "zy1000_version", .mode = COMMAND_ANY, - .jim_handler = &jim_zy1000_version, - .help = "print version info for zy1000", + .jim_handler = jim_zy1000_version, + .help = "Print version info for zy1000.", + .usage = "['openocd'|'zy1000'|'date'|'time'|'pcb'|'fpga']", }, { .name = "powerstatus", .mode = COMMAND_ANY, - .jim_handler = & zylinjtag_Jim_Command_powerstatus, - .help = "print power status of target", + .jim_handler = zylinjtag_Jim_Command_powerstatus, + .help = "Returns power status of target", }, #ifdef CYGPKG_HAL_NIOS2 { .name = "updatezy1000firmware", .mode = COMMAND_ANY, - .jim_handler = &jim_zy1000_writefirmware, + .jim_handler = jim_zy1000_writefirmware, .help = "writes firmware to flash", + /* .usage = "some_string", */ }, #endif COMMAND_REGISTRATION_DONE commit 0811f6b192674788a00e02fbbfe29e0a2a138ea2 Author: David Brownell <dbr...@us...> Date: Sat Jan 9 22:09:08 2010 -0800 jtag: presto, parport help/usage updates Presto: add doxygen file comment. Parport: note a couple gaps in layout config. Both: use the uniform EBNF for usage, bugfix helptexts, use function name as its address not "&name". Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c index b280d04..a38ccfd 100644 --- a/src/jtag/drivers/parport.c +++ b/src/jtag/drivers/parport.c @@ -437,10 +437,13 @@ COMMAND_HANDLER(parport_handle_parport_cable_command) /* only if the cable name wasn't overwritten by cmdline */ if (parport_cable == 0) { + /* REVISIT first verify that it's listed in cables[] ... */ parport_cable = malloc(strlen(CMD_ARGV[0]) + sizeof(char)); strcpy(parport_cable, CMD_ARGV[0]); } + /* REVISIT it's probably worth returning the current value ... */ + return ERROR_OK; } @@ -484,34 +487,37 @@ COMMAND_HANDLER(parport_handle_parport_toggling_time_command) static const struct command_registration parport_command_handlers[] = { { .name = "parport_port", - .handler = &parport_handle_parport_port_command, + .handler = parport_handle_parport_port_command, .mode = COMMAND_CONFIG, - .help = "either the address of the I/O port " - "or the number of the '/dev/parport' device", - .usage = "[<port|devname>]", + .help = "Display the address of the I/O port (e.g. 0x378) " + "or the number of the '/dev/parport' device used. " + "If a parameter is provided, first change that port.", + .usage = "[port_number]", }, { .name = "parport_cable", - .handler = &parport_handle_parport_cable_command, + .handler = parport_handle_parport_cable_command, .mode = COMMAND_CONFIG, - .help = "the layout of the parallel port cable " - "used to connect to the target", - .usage = "[<layout>]", + .help = "Set the layout of the parallel port cable " + "used to connect to the target.", + /* REVISIT there's no way to list layouts we know ... */ + .usage = "[layout]", }, { .name = "parport_write_on_exit", - .handler = &parport_handle_write_on_exit_command, + .handler = parport_handle_write_on_exit_command, .mode = COMMAND_CONFIG, - .help = "configure the parallel driver to write " - "a known value to the parallel interface", - .usage = "[<on|off>]", + .help = "Configure the parallel driver to write " + "a known value to the parallel interface on exit.", + .usage = "('on'|'off')", }, { .name = "parport_toggling_time", - .handler = &parport_handle_parport_toggling_time_command, + .handler = parport_handle_parport_toggling_time_command, .mode = COMMAND_CONFIG, - .help = "time <ns> it takes for the hardware to toggle TCK", - .usage = "[<ns>]", + .help = "Displays or assigns how many nanoseconds it " + "takes for the hardware to toggle TCK.", + .usage = "[nanoseconds]", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/jtag/drivers/presto.c b/src/jtag/drivers/presto.c index 0baf561..ababf09 100644 --- a/src/jtag/drivers/presto.c +++ b/src/jtag/drivers/presto.c @@ -17,6 +17,11 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ + +/** + * @file Holds driver for PRESTO programmer from ASIX. + * http://tools.asix.net/prg_presto.htm + */ #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -742,10 +747,10 @@ COMMAND_HANDLER(presto_handle_serial_command) static const struct command_registration presto_command_handlers[] = { { .name = "presto_serial", - .handler = &presto_handle_serial_command, + .handler = presto_handle_serial_command, .mode = COMMAND_CONFIG, - .help = "configure serial port", - .usage = "<devname>", + .help = "Configure USB serial number of Presto device.", + .usage = "serial_string", }, COMMAND_REGISTRATION_DONE }; commit ad5fd390634799ecabddc32d0ce415ef72036b4a Author: David Brownell <dbr...@us...> Date: Sat Jan 9 22:05:55 2010 -0800 jtag/gw16012 usage/help updates Use standard BNF. Improve/correct helptext for its "parport_port" command. Function address is just its name. diff --git a/src/jtag/drivers/gw16012.c b/src/jtag/drivers/gw16012.c index 38e5dd7..0e9f3fe 100644 --- a/src/jtag/drivers/gw16012.c +++ b/src/jtag/drivers/gw16012.c @@ -565,10 +565,12 @@ COMMAND_HANDLER(gw16012_handle_parport_port_command) static const struct command_registration gw16012_command_handlers[] = { { .name = "parport_port", - .handler = &gw16012_handle_parport_port_command, + .handler = gw16012_handle_parport_port_command, .mode = COMMAND_CONFIG, - .help = "configure the parallel port to use", - .usage = "<port_num>", + .help = "Display the address of the I/O port (e.g. 0x378) " + "or the number of the '/dev/parport' device used. " + "If a parameter is provided, first change that port.", + .usage = "[port_number]", }, COMMAND_REGISTRATION_DONE }; commit ff647e6bb4180a7c376b61caeb14951ba84d5717 Author: David Brownell <dbr...@us...> Date: Sat Jan 9 21:56:11 2010 -0800 parport (mostly) doc fixes The "parport_port" commands generally don't *require* a port_number; they're of the "apply any parameter, then print result" variety. Update the User's Guide accordingly. Some of those commands are intended to be write-once: parport_port, and parport_cable. Say so. Use proper EBNF for the parport_write_on_exit parameter. Parport address 0xc8b8 is evidently mutant. Say so in the "parport.cfg" file, to avoid breaking anyone with that mutant config. But update the User's Guide to include a sane example for the LP2 port. Finally document the "presto_serial" command. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index f8956a3..6466d6d 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2073,9 +2073,11 @@ $_TARGETNAME configure -event reset-assert \ Gateworks GW16012 JTAG programmer. This has one driver-specific command: -@deffn {Config Command} {parport_port} number -Specifies either the address of the I/O port (default: 0x378 for LPT1) or -the number of the @file{/dev/parport} device. +@deffn {Config Command} {parport_port} [port_number] +Display either the address of the I/O port +(default: 0x378 for LPT1) or the number of the @file{/dev/parport} device. +If a parameter is provided, first switch to use that port. +This is a write-once setting. @end deffn @end deffn @@ -2094,7 +2096,8 @@ These interfaces have several commands, used to configure the driver before initializing the JTAG scan chain: @deffn {Config Command} {parport_cable} name -The layout of the parallel port cable used to connect to the target. +Set the layout of the parallel port cable used to connect to the target. +This is a write-once setting. Currently valid cable @var{name} values include: @itemize @minus @@ -2122,9 +2125,11 @@ several clones, such as the Olimex ARM-JTAG @end itemize @end deffn -@deffn {Config Command} {parport_port} number -Either the address of the I/O port (default: 0x378 for LPT1) or the number of -the @file{/dev/parport} device +@deffn {Config Command} {parport_port} [port_number] +Display either the address of the I/O port +(default: 0x378 for LPT1) or the number of the @file{/dev/parport} device. +If a parameter is provided, first switch to use that port. +This is a write-once setting. When using PPDEV to access the parallel port, use the number of the parallel port: @option{parport_port 0} (the default). If @option{parport_port 0x378} is specified @@ -2167,25 +2172,26 @@ match for the jtag_khz rate you specified; be conservative. @end quotation @end deffn -@deffn {Config Command} {parport_write_on_exit} (on|off) +@deffn {Config Command} {parport_write_on_exit} (@option{on}|@option{off}) This will configure the parallel driver to write a known -cable-specific value to the parallel interface on exiting OpenOCD +cable-specific value to the parallel interface on exiting OpenOCD. @end deffn For example, the interface configuration file for a -classic ``Wiggler'' cable might look something like this: +classic ``Wiggler'' cable on LPT2 might look something like this: @example interface parport -parport_port 0xc8b8 +parport_port 0x278 parport_cable wiggler @end example @end deffn @deffn {Interface Driver} {presto} ASIX PRESTO USB JTAG programmer. -@c command: presto_serial str -@c sets serial number +@deffn {Config Command} {presto_serial} serial_string +Configures the USB serial number of the Presto device to use. +@end deffn @end deffn @deffn {Interface Driver} {rlink} diff --git a/tcl/interface/parport.cfg b/tcl/interface/parport.cfg index 2a2668d..22be8f3 100644 --- a/tcl/interface/parport.cfg +++ b/tcl/interface/parport.cfg @@ -1,6 +1,8 @@ # # Parallel port wiggler (many clones available) on port 0xc8b8 # +# REVISIT this address seems very wrong. +# Surely 0x378/LPT1 or 0x278/LPT2 ... interface parport parport_port 0xc8b8 ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 32 +++++--- src/jtag/drivers/gw16012.c | 8 +- src/jtag/drivers/parport.c | 36 +++++---- src/jtag/drivers/presto.c | 11 ++- src/jtag/tcl.c | 189 +++++++++++++++++++++++++++----------------- src/jtag/zy1000/zy1000.c | 19 +++-- tcl/interface/parport.cfg | 2 + 7 files changed, 181 insertions(+), 116 deletions(-) hooks/post-receive -- Main OpenOCD repository |