diff options
author | Marc Schink <dev@zapb.de> | 2021-08-01 14:20:22 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2021-08-14 13:37:36 +0100 |
commit | 186ed3311d061ba0237cb8889f9673366717fbf1 (patch) | |
tree | 4b72b8a421bb3c17bd708979e64d9f6f9e673e22 /src/jtag | |
parent | ae5c438b001ae8d57055e2c1ff0829eee108cfbc (diff) | |
download | riscv-openocd-186ed3311d061ba0237cb8889f9673366717fbf1.zip riscv-openocd-186ed3311d061ba0237cb8889f9673366717fbf1.tar.gz riscv-openocd-186ed3311d061ba0237cb8889f9673366717fbf1.tar.bz2 |
drivers/ft232r: Group adapter commands
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>
Diffstat (limited to 'src/jtag')
-rw-r--r-- | src/jtag/drivers/ft232r.c | 33 | ||||
-rw-r--r-- | src/jtag/startup.tcl | 60 |
2 files changed, 82 insertions, 11 deletions
diff --git a/src/jtag/drivers/ft232r.c b/src/jtag/drivers/ft232r.c index 3c02925..22c0fe5 100644 --- a/src/jtag/drivers/ft232r.c +++ b/src/jtag/drivers/ft232r.c @@ -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. */ diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 5763310..d5b2ae2 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -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 |