From: OpenOCD-Gerrit <ope...@us...> - 2020-09-05 16:11:52
|
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 aa628304e2a5a629ffee136089c0abee48db355b (commit) via 60f104f45013ce0237df651e19f30181966a7256 (commit) from 1457a1ab425febd3dfceeb8c908b69135ff0b8b6 (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 aa628304e2a5a629ffee136089c0abee48db355b Author: Antonio Borneo <bor...@gm...> Date: Sun Jul 12 00:57:34 2020 +0200 helper: fix minor typos Change-Id: I785e388148c0329e51cb0b39ab30e8ee44f5a7cd Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: http://openocd.zylin.com/5801 Tested-by: jenkins diff --git a/src/helper/bin2char.sh b/src/helper/bin2char.sh index 85a0fd6a8..128ea9af6 100755 --- a/src/helper/bin2char.sh +++ b/src/helper/bin2char.sh @@ -4,7 +4,7 @@ echo "Usage: $0" echo echo "Read binary data from standard input and write it as a comma separated" - echo "list of hexadecimal byte values to standard ouput. The output is usable" + echo "list of hexadecimal byte values to standard output. The output is usable" echo "as a C array initializer. It is terminated with a comma so it can be" echo "continued e.g. for zero termination." exit 1 diff --git a/src/helper/command.h b/src/helper/command.h index 886bde86b..b0c84bb43 100644 --- a/src/helper/command.h +++ b/src/helper/command.h @@ -168,7 +168,7 @@ struct command_invocation { * * This is *especially* important for commands such as writing * to flash or verifying memory. The reason is that those commands - * can be used by programs to determine if the operation succeded + * can be used by programs to determine if the operation succeeded * or not. If the operation failed, then a program can try * an alternative approach. * @@ -199,7 +199,7 @@ struct command { * Commands should be registered by filling in one or more of these * structures and passing them to [un]register_commands(). * - * A conventioal format should be used for help strings, to provide both + * A conventional format should be used for help strings, to provide both * usage and basic information: * @code * "@<options@> ... - some explanation text" @@ -252,7 +252,7 @@ int register_commands(struct command_context *cmd_ctx, struct command *parent, const struct command_registration *cmds); /** - * Unregisters all commands from the specfied context. + * Unregisters all commands from the specified context. * @param cmd_ctx The context that will be cleared of registered commands. * @param parent If given, only clear commands from under this one command. * @returns ERROR_OK on success, or an error code. @@ -265,7 +265,7 @@ struct command *command_find_in_context(struct command_context *cmd_ctx, /** * Update the private command data field for a command and all descendents. - * This is used when creating a new heirarchy of commands that depends + * This is used when creating a new hierarchy of commands that depends * on obtaining a dynamically created context. The value will be available * in command handlers by using the CMD_DATA macro. * @param c The command (group) whose data pointer(s) will be updated. @@ -362,7 +362,7 @@ DECLARE_PARSE_WRAPPER(_target_addr, target_addr_t); * * This function may cause the calling function to return immediately, * so it should be used carefully to avoid leaking resources. In most - * situations, parsing should be completed in full before proceding + * situations, parsing should be completed in full before proceeding * to allocate resources, and this strategy will most prevents leaks. */ #define COMMAND_PARSE_NUMBER(type, in, out) \ diff --git a/src/helper/jim-nvp.h b/src/helper/jim-nvp.h index 7b4a491d3..4c4dc8ff4 100644 --- a/src/helper/jim-nvp.h +++ b/src/helper/jim-nvp.h @@ -127,7 +127,7 @@ void Jim_SetResult_NvpUnknown(Jim_Interp *interp, /** Debug: convert argc/argv into a printable string for printf() debug * - * \param interp - the interpeter + * \param interp - the interpreter * \param argc - arg count * \param argv - the objects * @@ -150,7 +150,7 @@ const char *Jim_Debug_ArgvString(Jim_Interp *interp, int argc, Jim_Obj *const *a * Some TCL objects have various "configuration" values. * For example - in Tcl/Tk the "buttons" have many options. * - * Usefull when dealing with command options. + * Useful when dealing with command options. * that may come in any order... * * Does not support "-foo = 123" type options. diff --git a/src/helper/log.c b/src/helper/log.c index b05850df0..7440b70f6 100644 --- a/src/helper/log.c +++ b/src/helper/log.c @@ -469,7 +469,7 @@ void kept_alive(void) gdb_timeout_warning(delta_time); } -/* if we sleep for extended periods of time, we must invoke keep_alive() intermittantly */ +/* if we sleep for extended periods of time, we must invoke keep_alive() intermittently */ void alive_sleep(uint64_t ms) { uint64_t napTime = 10; @@ -493,7 +493,7 @@ void busy_sleep(uint64_t ms) } } -/* Maximum size of socket error message retreived from operation system */ +/* Maximum size of socket error message retrieved from operation system */ #define MAX_SOCKET_ERR_MSG_LENGTH 256 /* Provide log message for the last socket error. diff --git a/src/helper/log.h b/src/helper/log.h index eac535deb..0c6623f01 100644 --- a/src/helper/log.h +++ b/src/helper/log.h @@ -40,7 +40,7 @@ * LOG_LVL_SILENT - turn off all output. In lieu of try + catch this can be used as a * feeble ersatz. * LOG_LVL_USER - user messages. Could be anything from information - * to progress messags. These messages do not represent + * to progress messages. These messages do not represent * incorrect or unexpected behaviour, just normal execution. * LOG_LVL_ERROR - fatal errors, that are likely to cause program abort * LOG_LVL_WARNING - non-fatal errors, that may be resolved later diff --git a/src/helper/update_jep106.pl b/src/helper/update_jep106.pl index caec0664f..561e04b00 100755 --- a/src/helper/update_jep106.pl +++ b/src/helper/update_jep106.pl @@ -6,7 +6,7 @@ use File::Basename; if (@ARGV != 1) { die "Usage: $0 <JEP106 PDF document>\n\n" . "Convert the JEDEC document containing manufacturer identification codes\n" - . "to an array initializer suitable for incusion into jep106.c. The latest\n" + . "to an array initializer suitable for inclusion into jep106.c. The latest\n" . "version of the document can be found here:\n" . "http://www.jedec.org/standards-documents/results/jep106\n"; }; diff --git a/src/helper/util.c b/src/helper/util.c index 56baf95d1..dcd59e6ea 100644 --- a/src/helper/util.c +++ b/src/helper/util.c @@ -47,7 +47,7 @@ static const struct command_registration util_command_handlers[] = { .mode = COMMAND_ANY, .jim_handler = util_Jim_Command_ms, .help = - "Returns ever increasing milliseconds. Used to calculuate differences in time.", + "Returns ever increasing milliseconds. Used to calculate differences in time.", .usage = "", }, COMMAND_REGISTRATION_DONE commit 60f104f45013ce0237df651e19f30181966a7256 Author: Antonio Borneo <bor...@gm...> Date: Sun Jan 27 15:49:34 2019 +0100 hla_transport: split command registration per transport All the HLA transports (hla_swd and hla_jtag) register the same set of commands. Such commands are mainly aimed at handling JTAG compatibility that is required for the transport hla_jtag only. Split per transport the command registration and limit the commands to only those required by the transport itself. Replace the command "hla newtap" with the transport specific "swd newdap" or "jtag newtap". Deprecate the command "hla". Change-Id: I79c78fa97b707482608516d3824151a4d07644c0 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: http://openocd.zylin.com/4877 Tested-by: jenkins diff --git a/src/jtag/hla/hla_transport.c b/src/jtag/hla/hla_transport.c index 338357748..10028260d 100644 --- a/src/jtag/hla/hla_transport.c +++ b/src/jtag/hla/hla_transport.c @@ -46,24 +46,37 @@ COMMAND_HANDLER(hl_transport_reset_command) } static const struct command_registration -hl_transport_stlink_subcommand_handlers[] = { +hl_swd_transport_subcommand_handlers[] = { { - .name = "newtap", + .name = "newdap", .mode = COMMAND_CONFIG, .jim_handler = jim_hl_newtap, - .help = "Create a new TAP instance named basename.tap_type, " - "and appends it to the scan chain.", - .usage = "basename tap_type '-irlen' count " - "['-expected_id' number] ", + .help = "declare a new SWD DAP", }, + COMMAND_REGISTRATION_DONE +}; +static const struct command_registration hl_swd_transport_command_handlers[] = { + { + .name = "swd", + .mode = COMMAND_ANY, + .help = "SWD command group", + .usage = "", + .chain = hl_swd_transport_subcommand_handlers, + }, COMMAND_REGISTRATION_DONE }; static const struct command_registration hl_transport_jtag_subcommand_handlers[] = { { - .chain = hl_transport_stlink_subcommand_handlers, + .name = "newtap", + .mode = COMMAND_CONFIG, + .jim_handler = jim_hl_newtap, + .help = "Create a new TAP instance named basename.tap_type, " + "and appends it to the scan chain.", + .usage = "basename tap_type '-irlen' count " + "['-expected_id' number] ", }, { .name = "init", @@ -120,18 +133,11 @@ hl_transport_jtag_subcommand_handlers[] = { COMMAND_REGISTRATION_DONE }; -static const struct command_registration stlink_transport_command_handlers[] = { - - { - .name = "hla", - .mode = COMMAND_ANY, - .help = "perform hl adapter actions", - .usage = "", - .chain = hl_transport_stlink_subcommand_handlers, - }, +static const struct command_registration hl_jtag_transport_command_handlers[] = { { .name = "jtag", .mode = COMMAND_ANY, + .help = "perform jtag tap actions", .usage = "", .chain = hl_transport_jtag_subcommand_handlers, }, @@ -144,11 +150,6 @@ static const struct command_registration stlink_transport_command_handlers[] = { COMMAND_REGISTRATION_DONE }; -static int hl_transport_register_commands(struct command_context *cmd_ctx) -{ - return register_commands(cmd_ctx, NULL, - stlink_transport_command_handlers); -} static int hl_transport_init(struct command_context *cmd_ctx) { @@ -187,34 +188,35 @@ static int hl_transport_init(struct command_context *cmd_ctx) return hl_interface_init_target(t); } -static int hl_transport_select(struct command_context *ctx) +static int hl_jtag_transport_select(struct command_context *cmd_ctx) { - LOG_DEBUG("hl_transport_select"); - - int retval; + LOG_DEBUG("hl_jtag_transport_select"); /* NOTE: interface init must already have been done. * That works with only C code ... no Tcl glue required. */ - retval = hl_transport_register_commands(ctx); - - if (retval != ERROR_OK) - return retval; + return register_commands(cmd_ctx, NULL, + hl_jtag_transport_command_handlers); +} - return ERROR_OK; +static int hl_swd_transport_select(struct command_context *cmd_ctx) +{ + LOG_DEBUG("hl_swd_transport_select"); + return register_commands(cmd_ctx, NULL, + hl_swd_transport_command_handlers); } static struct transport hl_swd_transport = { .name = "hla_swd", - .select = hl_transport_select, + .select = hl_swd_transport_select, .init = hl_transport_init, .override_target = hl_interface_override_target, }; static struct transport hl_jtag_transport = { .name = "hla_jtag", - .select = hl_transport_select, + .select = hl_jtag_transport_select, .init = hl_transport_init, .override_target = hl_interface_override_target, }; diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 90b675f18..82327a39b 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -226,4 +226,13 @@ proc xds110_supply_voltage args { eval xds110 supply $args } +proc hla {cmd args} { + tailcall "hla $cmd" {*}$args +} + +proc "hla newtap" {args} { + echo "DEPRECATED! use 'swj_newdap' not 'hla newtap'" + eval swj_newdap $args +} + # END MIGRATION AIDS diff --git a/tcl/target/swj-dp.tcl b/tcl/target/swj-dp.tcl index 1d274cb12..3fb0263f1 100644 --- a/tcl/target/swj-dp.tcl +++ b/tcl/target/swj-dp.tcl @@ -24,11 +24,12 @@ if [catch {transport select}] { } proc swj_newdap {chip tag args} { - if [using_hla] { - eval hla newtap $chip $tag $args - } elseif [using_jtag] { + if [using_jtag] { eval jtag newtap $chip $tag $args } elseif [using_swd] { eval swd newdap $chip $tag $args + } else { + echo "Error: transport '[ transport select ]' not supported by swj_newdap" + shutdown } } ----------------------------------------------------------------------- Summary of changes: src/helper/bin2char.sh | 2 +- src/helper/command.h | 10 +++---- src/helper/jim-nvp.h | 4 +-- src/helper/log.c | 4 +-- src/helper/log.h | 2 +- src/helper/update_jep106.pl | 2 +- src/helper/util.c | 2 +- src/jtag/hla/hla_transport.c | 66 +++++++++++++++++++++++--------------------- src/jtag/startup.tcl | 9 ++++++ tcl/target/swj-dp.tcl | 7 +++-- 10 files changed, 60 insertions(+), 48 deletions(-) hooks/post-receive -- Main OpenOCD repository |