aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc Schink <dev@zapb.de>2021-07-30 17:50:21 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2021-08-14 13:33:07 +0100
commitde5c752102b54ca91895094fa6b867f0c20d21ac (patch)
treeb7d6757c4d7a4f4de2df4f104c33bd4a4358c8bf /src
parent3ce92fa33ded60a0f03f51dae49dcb0236c33a6f (diff)
downloadriscv-openocd-de5c752102b54ca91895094fa6b867f0c20d21ac.zip
riscv-openocd-de5c752102b54ca91895094fa6b867f0c20d21ac.tar.gz
riscv-openocd-de5c752102b54ca91895094fa6b867f0c20d21ac.tar.bz2
drivers/openjtag: Group adapter commands
Use a command group 'openjtag' with subcommands instead of individual commands with 'openjtag_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: Ie1b1bf0b7c03e7703cfb074e554288384bf7b1b9 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/6387 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/jtag/drivers/openjtag.c17
-rw-r--r--src/jtag/startup.tcl12
2 files changed, 26 insertions, 3 deletions
diff --git a/src/jtag/drivers/openjtag.c b/src/jtag/drivers/openjtag.c
index 7efb0e5..123134f 100644
--- a/src/jtag/drivers/openjtag.c
+++ b/src/jtag/drivers/openjtag.c
@@ -870,16 +870,16 @@ COMMAND_HANDLER(openjtag_handle_variant_command)
return ERROR_OK;
}
-static const struct command_registration openjtag_command_handlers[] = {
+static const struct command_registration openjtag_subcommand_handlers[] = {
{
- .name = "openjtag_device_desc",
+ .name = "device_desc",
.handler = openjtag_handle_device_desc_command,
.mode = COMMAND_CONFIG,
.help = "set the USB device description of the OpenJTAG",
.usage = "description-string",
},
{
- .name = "openjtag_variant",
+ .name = "variant",
.handler = openjtag_handle_variant_command,
.mode = COMMAND_CONFIG,
.help = "set the OpenJTAG variant",
@@ -888,6 +888,17 @@ static const struct command_registration openjtag_command_handlers[] = {
COMMAND_REGISTRATION_DONE
};
+static const struct command_registration openjtag_command_handlers[] = {
+ {
+ .name = "openjtag",
+ .mode = COMMAND_ANY,
+ .help = "perform openjtag management",
+ .chain = openjtag_subcommand_handlers,
+ .usage = "",
+ },
+ COMMAND_REGISTRATION_DONE
+};
+
static struct jtag_interface openjtag_interface = {
.execute_queue = openjtag_execute_queue,
};
diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl
index d6413e4..f2e4ec3 100644
--- a/src/jtag/startup.tcl
+++ b/src/jtag/startup.tcl
@@ -261,6 +261,18 @@ proc ftdi_tdo_sample_edge args {
eval ftdi tdo_sample_edge $args
}
+lappend _telnet_autocomplete_skip openjtag_device_desc
+proc openjtag_device_desc args {
+ echo "DEPRECATED! use 'openjtag device_desc' not 'openjtag_device_desc'"
+ eval openjtag device_desc $args
+}
+
+lappend _telnet_autocomplete_skip openjtag_variant
+proc openjtag_variant args {
+ echo "DEPRECATED! use 'openjtag variant' not 'openjtag_variant'"
+ eval openjtag variant $args
+}
+
lappend _telnet_autocomplete_skip parport_port
proc parport_port args {
echo "DEPRECATED! use 'parport port' not 'parport_port'"