diff --git a/doc/openocd.texi b/doc/openocd.texi index 9540e69f3..2202a8d98 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -12675,7 +12675,7 @@ If your device/vendor is not supported you have to use the first variant. @end deffn -@deffn {Command} {$hub_name ipdbg start} @option{-tool @var{number}} @option{-port @var{number}} +@deffn {Command} {$hub_name start} @option{-tool @var{number}} @option{-port @var{number}} Starts a IPDBG JTAG-Host server. The remaining arguments can be specified in any order. Command options: @@ -12685,7 +12685,7 @@ Command options: @end itemize @end deffn -@deffn {Command} {$hub_name ipdbg stop} @option{-tool @var{number}} +@deffn {Command} {$hub_name stop} @option{-tool @var{number}} Stops a IPDBG JTAG-Host server. Command options: @itemize @bullet @@ -12696,21 +12696,21 @@ Command options: Examples: @example ipdbg create-hub xc6s.ipdbghub -tap xc6s.tap -hub 0x02 -xc6s.ipdbghub ipdbg start -port 4242 -tool 4 +xc6s.ipdbghub start -port 4242 -tool 4 @end example Creates a IPDBG Hub and starts a server listening on tcp-port 4242 which connects to tool 4. The connection is through the TAP of a Xilinx Spartan 6 on USER1 instruction (tested with a papillion pro board). @example ipdbg create-hub max10m50.ipdbghub -tap max10m50.tap -hub 0x00C -vir -max10m50.ipdbghub ipdbg start -tool 1 -port 60000 +max10m50.ipdbghub start -tool 1 -port 60000 @end example Starts a server listening on tcp-port 60000 which connects to tool 1 (data_up_1/data_down_1). The connection is through the TAP of a Intel MAX10 virtual jtag component (sld_instance_index is 0; sld_ir_width is smaller than 5). @example ipdbg create-hub xc7.ipdbghub -pld xc7.pld -xc7.ipdbghub ipdbg start -port 5555 -tool 0 +xc7.ipdbghub start -port 5555 -tool 0 @end example Starts a server listening on tcp-port 5555 which connects to tool 0 (data_up_0/data_down_0). The TAP and ir value used to reach the JTAG Hub is given by the pld driver. diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 5c466c628..f24e57ab0 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -1205,7 +1205,7 @@ proc "pld device" {driver tap_name {opt 0}} { lappend _telnet_autocomplete_skip "ipdbg -start" proc "ipdbg -start" {args} { - echo "DEPRECATED! use 'ipdbg create-hub' and 'chip.ipdbghub ipdbg start ...', not 'ipdbg -start ...'" + echo "DEPRECATED! use 'ipdbg create-hub' and 'chip.ipdbghub start ...', not 'ipdbg -start ...'" set tap_name "" set pld_name "" set tool_num "1" @@ -1271,17 +1271,14 @@ proc "ipdbg -start" {args} { return } - echo "name: $hub_name" - echo "ipdbg create-hub $hub_name $args" - catch {eval ipdbg create-hub $hub_name $args} - eval $hub_name ipdbg start -tool $tool_num -port $port_num + eval $hub_name start -tool $tool_num -port $port_num } lappend _telnet_autocomplete_skip "ipdbg -stop" proc "ipdbg -stop" {args} { - echo "DEPRECATED! use 'chip.ipdbghub ipdbg stop ...', not 'ipdbg -stop ...'" + echo "DEPRECATED! use 'chip.ipdbghub stop ...', not 'ipdbg -stop ...'" set tap_name "" set pld_name "" set tool_num "1" @@ -1328,7 +1325,11 @@ proc "ipdbg -stop" {args} { return } - eval $hub_name ipdbg stop -tool $tool_num + eval $hub_name stop -tool $tool_num +} + +proc ipdbg {cmd args} { + tailcall "ipdbg $cmd" {*}$args } # END MIGRATION AIDS diff --git a/src/server/ipdbg.c b/src/server/ipdbg.c index 859fdb035..466717c46 100644 --- a/src/server/ipdbg.c +++ b/src/server/ipdbg.c @@ -885,23 +885,6 @@ COMMAND_HANDLER(handle_ipdbg_stop_command) return ipdbg_stop(hub, tool); } -static const struct command_registration ipdbg_hostserver_subcommand_handlers[] = { - { - .name = "start", - .mode = COMMAND_EXEC, - .handler = handle_ipdbg_start_command, - .help = "Starts a IPDBG Host server.", - .usage = "-tool number -port port" - }, { - .name = "stop", - .mode = COMMAND_EXEC, - .handler = handle_ipdbg_stop_command, - .help = "Stops a IPDBG Host server.", - .usage = "-tool number" - }, - COMMAND_REGISTRATION_DONE -}; - static COMMAND_HELPER(ipdbg_config_queuing, struct ipdbg_hub *hub, unsigned int size) { if (!hub) @@ -944,13 +927,18 @@ COMMAND_HANDLER(handle_ipdbg_cfg_queuing_command) static const struct command_registration ipdbg_hub_subcommand_handlers[] = { { - .name = "ipdbg", + .name = "start", .mode = COMMAND_EXEC, - .help = "IPDBG Hub commands.", - .usage = "", - .chain = ipdbg_hostserver_subcommand_handlers - }, - { + .handler = handle_ipdbg_start_command, + .help = "Starts a IPDBG Host server.", + .usage = "-tool number -port port" + }, { + .name = "stop", + .mode = COMMAND_EXEC, + .handler = handle_ipdbg_stop_command, + .help = "Stops a IPDBG Host server.", + .usage = "-tool number" + }, { .name = "queuing", .handler = handle_ipdbg_cfg_queuing_command, .mode = COMMAND_ANY, @@ -1151,7 +1139,6 @@ static const struct command_registration ipdbg_command_handlers[] = { }, COMMAND_REGISTRATION_DONE }; - int ipdbg_register_commands(struct command_context *cmd_ctx) { return register_commands(cmd_ctx, NULL, ipdbg_command_handlers); diff --git a/tcl/board/bemicro_cycloneiii.cfg b/tcl/board/bemicro_cycloneiii.cfg index 3c92b500c..591a07047 100644 --- a/tcl/board/bemicro_cycloneiii.cfg +++ b/tcl/board/bemicro_cycloneiii.cfg @@ -18,7 +18,7 @@ source [find fpga/altera-cycloneiii.cfg] #openocd -f board/bemicro_cycloneiii.cfg -c "init" -c "pld load cycloneiii.pld cycloneiii_blinker.rbf" # "ipdbg create-hub cycloneiii.ipdbghub -tap cycloneiii.tap -ir 0x00e" -# "cycloneiii.ipdbghub ipdbg start -tool 0 -port 5555" +# "cycloneiii.ipdbghub start -tool 0 -port 5555" set JTAGSPI_CHAIN_ID cycloneiii.pld diff --git a/tcl/board/digilent_cmod_s7.cfg b/tcl/board/digilent_cmod_s7.cfg index 4fa45a17a..b975f9d37 100644 --- a/tcl/board/digilent_cmod_s7.cfg +++ b/tcl/board/digilent_cmod_s7.cfg @@ -16,7 +16,7 @@ adapter speed 10000 source [find cpld/xilinx-xc7.cfg] # "ipdbg create-hub xc7.ipdbghub -tap xc7.tap -ir 0x02" -# "xc7.ipdbghub ipdbg start -tool 0 -port 5555" +# "xc7.ipdbghub start -tool 0 -port 5555" #openocd -f board/digilent_cmod_s7.cfg -c "init" -c "pld load xc7.pld shared_folder/cmod_s7_fast.bit" set JTAGSPI_CHAIN_ID xc7.pld diff --git a/tcl/board/ecp5_evaluation.cfg b/tcl/board/ecp5_evaluation.cfg index 71769f607..1aafac494 100644 --- a/tcl/board/ecp5_evaluation.cfg +++ b/tcl/board/ecp5_evaluation.cfg @@ -17,7 +17,7 @@ source [find fpga/lattice_ecp5.cfg] #openocd -f board/ecp5_evaluation.cfg -c "init" -c "pld load ecp5.pld shared_folder/ecp5_blinker_impl1.bit" #ipdbg create-hub ecp5.ipdbghub -tap ecp5.tap -ir 0x32 -#ecp5.ipdbghub ipdbg start -tool 0 -port 5555 +#ecp5.ipdbghub start -tool 0 -port 5555 set JTAGSPI_CHAIN_ID ecp5.pld source [find cpld/jtagspi.cfg] diff --git a/tcl/board/gowin_runber.cfg b/tcl/board/gowin_runber.cfg index 6cb07362b..aaa316f7a 100644 --- a/tcl/board/gowin_runber.cfg +++ b/tcl/board/gowin_runber.cfg @@ -17,4 +17,4 @@ source [find fpga/gowin_gw1n.cfg] #openocd -f board/gowin_runber.cfg -c "init" -c "pld load 0 impl/pnr/gw1n_blinker.fs" #ipdbg create-hub gw1n.ipdbghub -tap gw1n.tap -ir 0x42 -#gw1n.ipdbghubipdbg start -tool 0 -port 5555 +#gw1n.ipdbghub start -tool 0 -port 5555 diff --git a/tcl/board/trion_t20_bga256.cfg b/tcl/board/trion_t20_bga256.cfg index ca44f0b8c..572329ff6 100644 --- a/tcl/board/trion_t20_bga256.cfg +++ b/tcl/board/trion_t20_bga256.cfg @@ -21,7 +21,7 @@ source [find fpga/efinix_trion.cfg] #openocd -f board/trion_t20_bga256.cfg -c "init" -c "pld load trion.pld outflow/trion_blinker.bit" #ipdbg create-hub trion.ipdbghub -tap trion.tap -ir 0x8 -#trion.ipdbghub ipdbg start -tool 0 -port 5555 +#trion.ipdbghub start -tool 0 -port 5555 set JTAGSPI_CHAIN_ID trion.pld source [find cpld/jtagspi.cfg]