drivers/ft232r: Group adapter commands 09/6409/3
authorMarc Schink <dev@zapb.de>
Sun, 1 Aug 2021 12:20:22 +0000 (14:20 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 14 Aug 2021 12:37:36 +0000 (13:37 +0100)
Use a command group 'ft232r' with subcommands instead of individual
commands with 'ft232r_' prefix.

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

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

index 40f4ab28419a8c60d878d34170161b4829d7527f..340e6b65b025a05a77487ff6c011a6e6d3f5a14a 100644 (file)
@@ -2632,47 +2632,47 @@ FT232R
 These interfaces have several commands, used to configure the driver
 before initializing the JTAG scan chain:
 
-@deffn {Config Command} {ft232r_vid_pid} @var{vid} @var{pid}
+@deffn {Config Command} {ft232r vid_pid} @var{vid} @var{pid}
 The vendor ID and product ID of the adapter. If not specified, default
 0x0403:0x6001 is used.
 @end deffn
 
-@deffn {Config Command} {ft232r_serial_desc} @var{serial}
+@deffn {Config Command} {ft232r serial_desc} @var{serial}
 Specifies the @var{serial} of the adapter to use, in case the
 vendor provides unique IDs and more than one adapter is connected to
 the host. If not specified, serial numbers are not considered.
 @end deffn
 
-@deffn {Config Command} {ft232r_jtag_nums} @var{tck} @var{tms} @var{tdi} @var{tdo}
+@deffn {Config Command} {ft232r jtag_nums} @var{tck} @var{tms} @var{tdi} @var{tdo}
 Set four JTAG GPIO numbers at once.
 If not specified, default 0 3 1 2 or TXD CTS RXD RTS is used.
 @end deffn
 
-@deffn {Config Command} {ft232r_tck_num} @var{tck}
+@deffn {Config Command} {ft232r tck_num} @var{tck}
 Set TCK GPIO number. If not specified, default 0 or TXD is used.
 @end deffn
 
-@deffn {Config Command} {ft232r_tms_num} @var{tms}
+@deffn {Config Command} {ft232r tms_num} @var{tms}
 Set TMS GPIO number. If not specified, default 3 or CTS is used.
 @end deffn
 
-@deffn {Config Command} {ft232r_tdi_num} @var{tdi}
+@deffn {Config Command} {ft232r tdi_num} @var{tdi}
 Set TDI GPIO number. If not specified, default 1 or RXD is used.
 @end deffn
 
-@deffn {Config Command} {ft232r_tdo_num} @var{tdo}
+@deffn {Config Command} {ft232r tdo_num} @var{tdo}
 Set TDO GPIO number. If not specified, default 2 or RTS is used.
 @end deffn
 
-@deffn {Config Command} {ft232r_trst_num} @var{trst}
+@deffn {Config Command} {ft232r trst_num} @var{trst}
 Set TRST GPIO number. If not specified, default 4 or DTR is used.
 @end deffn
 
-@deffn {Config Command} {ft232r_srst_num} @var{srst}
+@deffn {Config Command} {ft232r srst_num} @var{srst}
 Set SRST GPIO number. If not specified, default 6 or DCD is used.
 @end deffn
 
-@deffn {Config Command} {ft232r_restore_serial} @var{word}
+@deffn {Config Command} {ft232r restore_serial} @var{word}
 Restore serial port after JTAG. This USB bitmode control word
 (16-bit) will be sent before quit. Lower byte should
 set GPIO direction register to a "sane" state:
index 3c0292561170376c1f1dea2c35088c1f9cd1e8e1..22c0fe5dddf48c3860e4b7c738cfd39361d62a50 100644 (file)
@@ -560,72 +560,72 @@ COMMAND_HANDLER(ft232r_handle_restore_serial_command)
        return ERROR_OK;
 }
 
-static const struct command_registration ft232r_command_handlers[] = {
+static const struct command_registration ft232r_subcommand_handlers[] = {
        {
-               .name = "ft232r_serial_desc",
+               .name = "serial_desc",
                .handler = ft232r_handle_serial_desc_command,
                .mode = COMMAND_CONFIG,
                .help = "USB serial descriptor of the adapter",
                .usage = "serial string",
        },
        {
-               .name = "ft232r_vid_pid",
+               .name = "vid_pid",
                .handler = ft232r_handle_vid_pid_command,
                .mode = COMMAND_CONFIG,
                .help = "USB VID and PID of the adapter",
                .usage = "vid pid",
        },
        {
-               .name = "ft232r_jtag_nums",
+               .name = "jtag_nums",
                .handler = ft232r_handle_jtag_nums_command,
                .mode = COMMAND_CONFIG,
                .help = "gpio numbers for tck, tms, tdi, tdo. (in that order)",
                .usage = "<0-7|TXD-RI> <0-7|TXD-RI> <0-7|TXD-RI> <0-7|TXD-RI>",
        },
        {
-               .name = "ft232r_tck_num",
+               .name = "tck_num",
                .handler = ft232r_handle_tck_num_command,
                .mode = COMMAND_CONFIG,
                .help = "gpio number for tck.",
                .usage = "<0-7|TXD|RXD|RTS|CTS|DTR|DSR|DCD|RI>",
        },
        {
-               .name = "ft232r_tms_num",
+               .name = "tms_num",
                .handler = ft232r_handle_tms_num_command,
                .mode = COMMAND_CONFIG,
                .help = "gpio number for tms.",
                .usage = "<0-7|TXD|RXD|RTS|CTS|DTR|DSR|DCD|RI>",
        },
        {
-               .name = "ft232r_tdo_num",
+               .name = "tdo_num",
                .handler = ft232r_handle_tdo_num_command,
                .mode = COMMAND_CONFIG,
                .help = "gpio number for tdo.",
                .usage = "<0-7|TXD|RXD|RTS|CTS|DTR|DSR|DCD|RI>",
        },
        {
-               .name = "ft232r_tdi_num",
+               .name = "tdi_num",
                .handler = ft232r_handle_tdi_num_command,
                .mode = COMMAND_CONFIG,
                .help = "gpio number for tdi.",
                .usage = "<0-7|TXD|RXD|RTS|CTS|DTR|DSR|DCD|RI>",
        },
        {
-               .name = "ft232r_srst_num",
+               .name = "srst_num",
                .handler = ft232r_handle_srst_num_command,
                .mode = COMMAND_CONFIG,
                .help = "gpio number for srst.",
                .usage = "<0-7|TXD|RXD|RTS|CTS|DTR|DSR|DCD|RI>",
        },
        {
-               .name = "ft232r_trst_num",
+               .name = "trst_num",
                .handler = ft232r_handle_trst_num_command,
                .mode = COMMAND_CONFIG,
                .help = "gpio number for trst.",
                .usage = "<0-7|TXD|RXD|RTS|CTS|DTR|DSR|DCD|RI>",
        },
        {
-               .name = "ft232r_restore_serial",
+               .name = "restore_serial",
                .handler = ft232r_handle_restore_serial_command,
                .mode = COMMAND_CONFIG,
                .help = "bitmode control word that restores serial port.",
@@ -634,6 +634,17 @@ static const struct command_registration ft232r_command_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
+static const struct command_registration ft232r_command_handlers[] = {
+       {
+               .name = "ft232r",
+               .mode = COMMAND_ANY,
+               .help = "perform ft232r management",
+               .chain = ft232r_subcommand_handlers,
+               .usage = "",
+       },
+       COMMAND_REGISTRATION_DONE
+};
+
 /*
  * Synchronous bitbang protocol implementation.
  */
index 5763310f4aae6e164ea31234f5f52253c5bc6bdd..d5b2ae221aae90c7b8ddbcaf30d92a59db9dd53a 100644 (file)
@@ -675,4 +675,64 @@ proc usb_blaster_firmware args {
        eval usb_blaster firmware $args
 }
 
+lappend _telnet_autocomplete_skip ft232r_serial_desc
+proc ft232r_serial_desc args {
+       echo "DEPRECATED! use 'ft232r serial_desc' not 'ft232r_serial_desc'"
+       eval ft232r serial_desc $args
+}
+
+lappend _telnet_autocomplete_skip ft232r_vid_pid
+proc ft232r_vid_pid args {
+       echo "DEPRECATED! use 'ft232r vid_pid' not 'ft232r_vid_pid'"
+       eval ft232r vid_pid $args
+}
+
+lappend _telnet_autocomplete_skip ft232r_jtag_nums
+proc ft232r_jtag_nums args {
+       echo "DEPRECATED! use 'ft232r jtag_nums' not 'ft232r_jtag_nums'"
+       eval ft232r jtag_nums $args
+}
+
+lappend _telnet_autocomplete_skip ft232r_tck_num
+proc ft232r_tck_num args {
+       echo "DEPRECATED! use 'ft232r tck_num' not 'ft232r_tck_num'"
+       eval ft232r tck_num $args
+}
+
+lappend _telnet_autocomplete_skip ft232r_tms_num
+proc ft232r_tms_num args {
+       echo "DEPRECATED! use 'ft232r tms_num' not 'ft232r_tms_num'"
+       eval ft232r tms_num $args
+}
+
+lappend _telnet_autocomplete_skip ft232r_tdo_num
+proc ft232r_tdo_num args {
+       echo "DEPRECATED! use 'ft232r tdo_num' not 'ft232r_tdo_num'"
+       eval ft232r tdo_num $args
+}
+
+lappend _telnet_autocomplete_skip ft232r_tdi_num
+proc ft232r_tdi_num args {
+       echo "DEPRECATED! use 'ft232r tdi_num' not 'ft232r_tdi_num'"
+       eval ft232r tdi_num $args
+}
+
+lappend _telnet_autocomplete_skip ft232r_srst_num
+proc ft232r_srst_num args {
+       echo "DEPRECATED! use 'ft232r srst_num' not 'ft232r_srst_num'"
+       eval ft232r srst_num $args
+}
+
+lappend _telnet_autocomplete_skip ft232r_trst_num
+proc ft232r_trst_num args {
+       echo "DEPRECATED! use 'ft232r trst_num' not 'ft232r_trst_num'"
+       eval ft232r trst_num $args
+}
+
+lappend _telnet_autocomplete_skip ft232r_restore_serial
+proc ft232r_restore_serial args {
+       echo "DEPRECATED! use 'ft232r restore_serial' not 'ft232r_restore_serial'"
+       eval ft232r restore_serial $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)