diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/jtag/hla/hla_transport.c | 66 | ||||
-rw-r--r-- | src/jtag/startup.tcl | 9 |
2 files changed, 43 insertions, 32 deletions
diff --git a/src/jtag/hla/hla_transport.c b/src/jtag/hla/hla_transport.c index 3383577..1002826 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 90b675f..82327a3 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 |