drivers/usb_blaster: Group adapter commands 07/6407/3
authorMarc Schink <dev@zapb.de>
Sun, 1 Aug 2021 12:12:23 +0000 (14:12 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 14 Aug 2021 12:37:19 +0000 (13:37 +0100)
Use a command group 'usb_blaster' with subcommands instead of individual
commands with 'usb_blaster_' prefix.

The old commands are still available for backward compatibility but
marked as deprecated.

Change-Id: I2ae3d96ba864c20d7db67c74677781a62bfc4eb5
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/6407
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
doc/openocd.texi
src/jtag/drivers/usb_blaster/usb_blaster.c
src/jtag/startup.tcl

index 3e5e4cba71fb75256d05147103e3a842fb1707a6..40f4ab28419a8c60d878d34170161b4829d7527f 100644 (file)
@@ -2728,28 +2728,28 @@ USB JTAG/USB-Blaster compatibles over one of the userspace libraries
 for FTDI chips. These interfaces have several commands, used to
 configure the driver before initializing the JTAG scan chain:
 
-@deffn {Config Command} {usb_blaster_device_desc} description
+@deffn {Config Command} {usb_blaster device_desc} description
 Provides the USB device description (the @emph{iProduct string})
 of the FTDI FT245 device. If not
 specified, the FTDI default value is used. This setting is only valid
 if compiled with FTD2XX support.
 @end deffn
 
-@deffn {Config Command} {usb_blaster_vid_pid} vid pid
+@deffn {Config Command} {usb_blaster vid_pid} vid pid
 The vendor ID and product ID of the FTDI FT245 device. If not specified,
 default values are used.
 Currently, only one @var{vid}, @var{pid} pair may be given, e.g. for
 Altera USB-Blaster (default):
 @example
-usb_blaster_vid_pid 0x09FB 0x6001
+usb_blaster vid_pid 0x09FB 0x6001
 @end example
 The following VID/PID is for Kolja Waschk's USB JTAG:
 @example
-usb_blaster_vid_pid 0x16C0 0x06AD
+usb_blaster vid_pid 0x16C0 0x06AD
 @end example
 @end deffn
 
-@deffn {Command} {usb_blaster_pin} (@option{pin6}|@option{pin8}) (@option{0}|@option{1}|@option{s}|@option{t})
+@deffn {Command} {usb_blaster pin} (@option{pin6}|@option{pin8}) (@option{0}|@option{1}|@option{s}|@option{t})
 Sets the state or function of the unused GPIO pins on USB-Blasters
 (pins 6 and 8 on the female JTAG header). These pins can be used as
 SRST and/or TRST provided the appropriate connections are made on the
@@ -2757,18 +2757,18 @@ target board.
 
 For example, to use pin 6 as SRST:
 @example
-usb_blaster_pin pin6 s
+usb_blaster pin pin6 s
 reset_config srst_only
 @end example
 @end deffn
 
-@deffn {Config Command} {usb_blaster_lowlevel_driver} (@option{ftdi}|@option{ublast2})
+@deffn {Config Command} {usb_blaster lowlevel_driver} (@option{ftdi}|@option{ublast2})
 Chooses the low level access method for the adapter. If not specified,
 @option{ftdi} is selected unless it wasn't enabled during the
 configure stage. USB-Blaster II needs @option{ublast2}.
 @end deffn
 
-@deffn {Config Command} {usb_blaster_firmware} @var{path}
+@deffn {Config Command} {usb_blaster firmware} @var{path}
 This command specifies @var{path} to access USB-Blaster II firmware
 image. To be used with USB-Blaster II only.
 @end deffn
index 8519d197a56f9433dc9dd5e9c843a16ce336b00c..cc1d4758fc9956d06892b80bceaf748cd07a4671 100644 (file)
@@ -1030,16 +1030,16 @@ COMMAND_HANDLER(ublast_firmware_command)
 }
 
 
-static const struct command_registration ublast_command_handlers[] = {
+static const struct command_registration ublast_subcommand_handlers[] = {
        {
-               .name = "usb_blaster_device_desc",
+               .name = "device_desc",
                .handler = ublast_handle_device_desc_command,
                .mode = COMMAND_CONFIG,
                .help = "set the USB device description of the USB-Blaster",
                .usage = "description-string",
        },
        {
-               .name = "usb_blaster_vid_pid",
+               .name = "vid_pid",
                .handler = ublast_handle_vid_pid_command,
                .mode = COMMAND_CONFIG,
                .help = "the vendor ID and product ID of the USB-Blaster and "
@@ -1048,21 +1048,21 @@ static const struct command_registration ublast_command_handlers[] = {
                .usage = "vid pid vid_uninit pid_uninit",
        },
        {
-               .name = "usb_blaster_lowlevel_driver",
+               .name = "lowlevel_driver",
                .handler = ublast_handle_lowlevel_drv_command,
                .mode = COMMAND_CONFIG,
                .help = "set the lowlevel access for the USB Blaster (ftdi, ublast2)",
                .usage = "(ftdi|ublast2)",
        },
        {
-               .name = "usb_blaster_pin",
+               .name = "pin",
                .handler = ublast_handle_pin_command,
                .mode = COMMAND_ANY,
                .help = "show or set pin state for the unused GPIO pins",
                .usage = "(pin6|pin8) (0|1|s|t)",
        },
                {
-               .name = "usb_blaster_firmware",
+               .name = "firmware",
                .handler = &ublast_firmware_command,
                .mode = COMMAND_CONFIG,
                .help = "configure the USB-Blaster II firmware location",
@@ -1071,6 +1071,17 @@ static const struct command_registration ublast_command_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
+static const struct command_registration ublast_command_handlers[] = {
+       {
+               .name = "usb_blaster",
+               .mode = COMMAND_ANY,
+               .help = "perform usb_blaster management",
+               .chain = ublast_subcommand_handlers,
+               .usage = "",
+       },
+       COMMAND_REGISTRATION_DONE
+};
+
 static struct jtag_interface usb_blaster_interface = {
        .supported = DEBUG_CAP_TMS_SEQ,
        .execute_queue = ublast_execute_queue,
index 80d21e7bde1e7ef44651ea313342f822f9e3e0fa..5763310f4aae6e164ea31234f5f52253c5bc6bdd 100644 (file)
@@ -645,4 +645,34 @@ proc buspirate_port args {
        eval buspirate port $args
 }
 
+lappend _telnet_autocomplete_skip usb_blaster_device_desc
+proc usb_blaster_device_desc args {
+       echo "DEPRECATED! use 'usb_blaster device_desc' not 'usb_blaster_device_desc'"
+       eval usb_blaster device_desc $args
+}
+
+lappend _telnet_autocomplete_skip usb_blaster_vid_pid
+proc usb_blaster_vid_pid args {
+       echo "DEPRECATED! use 'usb_blaster vid_pid' not 'usb_blaster_vid_pid'"
+       eval usb_blaster vid_pid $args
+}
+
+lappend _telnet_autocomplete_skip usb_blaster_lowlevel_driver
+proc usb_blaster_lowlevel_driver args {
+       echo "DEPRECATED! use 'usb_blaster lowlevel_driver' not 'usb_blaster_lowlevel_driver'"
+       eval usb_blaster lowlevel_driver $args
+}
+
+lappend _telnet_autocomplete_skip usb_blaster_pin
+proc usb_blaster_pin args {
+       echo "DEPRECATED! use 'usb_blaster pin' not 'usb_blaster_pin'"
+       eval usb_blaster pin $args
+}
+
+lappend _telnet_autocomplete_skip usb_blaster_firmware
+proc usb_blaster_firmware args {
+       echo "DEPRECATED! use 'usb_blaster firmware' not 'usb_blaster_firmware'"
+       eval usb_blaster firmware $args
+}
+
 # END MIGRATION AIDS

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)