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>
This commit is contained in:
Marc Schink 2021-07-30 17:50:21 +02:00 committed by Antonio Borneo
parent 3ce92fa33d
commit de5c752102
3 changed files with 28 additions and 5 deletions

View File

@ -3298,7 +3298,7 @@ See @file{interface/sysfsgpio-raspberrypi.cfg} for a sample config.
OpenJTAG compatible USB adapter. OpenJTAG compatible USB adapter.
This defines some driver-specific commands: This defines some driver-specific commands:
@deffn {Config Command} {openjtag_variant} variant @deffn {Config Command} {openjtag variant} variant
Specifies the variant of the OpenJTAG adapter (see @uref{http://www.openjtag.org/}). Specifies the variant of the OpenJTAG adapter (see @uref{http://www.openjtag.org/}).
Currently valid @var{variant} values include: Currently valid @var{variant} values include:
@ -3309,7 +3309,7 @@ Currently valid @var{variant} values include:
@end itemize @end itemize
@end deffn @end deffn
@deffn {Config Command} {openjtag_device_desc} string @deffn {Config Command} {openjtag device_desc} string
The USB device description string of the adapter. The USB device description string of the adapter.
This value is only used with the standard variant. This value is only used with the standard variant.
@end deffn @end deffn

View File

@ -870,16 +870,16 @@ COMMAND_HANDLER(openjtag_handle_variant_command)
return ERROR_OK; 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, .handler = openjtag_handle_device_desc_command,
.mode = COMMAND_CONFIG, .mode = COMMAND_CONFIG,
.help = "set the USB device description of the OpenJTAG", .help = "set the USB device description of the OpenJTAG",
.usage = "description-string", .usage = "description-string",
}, },
{ {
.name = "openjtag_variant", .name = "variant",
.handler = openjtag_handle_variant_command, .handler = openjtag_handle_variant_command,
.mode = COMMAND_CONFIG, .mode = COMMAND_CONFIG,
.help = "set the OpenJTAG variant", .help = "set the OpenJTAG variant",
@ -888,6 +888,17 @@ static const struct command_registration openjtag_command_handlers[] = {
COMMAND_REGISTRATION_DONE 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 = { static struct jtag_interface openjtag_interface = {
.execute_queue = openjtag_execute_queue, .execute_queue = openjtag_execute_queue,
}; };

View File

@ -261,6 +261,18 @@ proc ftdi_tdo_sample_edge args {
eval 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 lappend _telnet_autocomplete_skip parport_port
proc parport_port args { proc parport_port args {
echo "DEPRECATED! use 'parport port' not 'parport_port'" echo "DEPRECATED! use 'parport port' not 'parport_port'"