From: Antonio Borneo Date: Thu, 7 Oct 2021 17:34:27 +0000 (+0200) Subject: jtag/aice: switch to command 'adapter serial' X-Git-Tag: v0.12.0-rc1~397 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=a3b69dee622066d3a2b70c32775818d82b5ffb54 jtag/aice: switch to command 'adapter serial' The driver aice defines the command 'aice serial' to specify the serial string of the adapter, but actually does not use this value in the code. Remove and deprecate the driver command, and use 'adapter serial'. Change-Id: I892e0a4e1b41a7a87adf54a5736abf7419f32979 Signed-off-by: Antonio Borneo Reviewed-on: https://review.openocd.org/c/openocd/+/6648 Tested-by: jenkins --- diff --git a/src/jtag/aice/aice_interface.c b/src/jtag/aice/aice_interface.c index c7556c018f..cb126c6b17 100644 --- a/src/jtag/aice/aice_interface.c +++ b/src/jtag/aice/aice_interface.c @@ -20,6 +20,7 @@ #include "config.h" #endif +#include #include #include #include @@ -269,7 +270,7 @@ COMMAND_HANDLER(aice_handle_aice_info_command) LOG_DEBUG("aice_handle_aice_info_command"); command_print(CMD, "Description: %s", param.device_desc); - command_print(CMD, "Serial number: %s", param.serial); + command_print(CMD, "Serial number: %s", adapter_get_required_serial()); if (strncmp(aice_port->name, "aice_pipe", 9) == 0) command_print(CMD, "Adapter: %s", param.adapter_name); @@ -308,18 +309,6 @@ COMMAND_HANDLER(aice_handle_aice_desc_command) return ERROR_OK; } -COMMAND_HANDLER(aice_handle_aice_serial_command) -{ - LOG_DEBUG("aice_handle_aice_serial_command"); - - if (CMD_ARGC == 1) - param.serial = strdup(CMD_ARGV[0]); - else - LOG_ERROR("expected exactly one argument to aice serial "); - - return ERROR_OK; -} - COMMAND_HANDLER(aice_handle_aice_vid_pid_command) { LOG_DEBUG("aice_handle_aice_vid_pid_command"); @@ -438,13 +427,6 @@ static const struct command_registration aice_subcommand_handlers[] = { .help = "set the aice device description", .usage = "[description string]", }, - { - .name = "serial", - .handler = &aice_handle_aice_serial_command, - .mode = COMMAND_CONFIG, - .help = "set the serial number of the AICE device", - .usage = "[serial string]", - }, { .name = "vid_pid", .handler = &aice_handle_aice_vid_pid_command, diff --git a/src/jtag/aice/aice_port.h b/src/jtag/aice/aice_port.h index d3d6a1a2c9..159368888e 100644 --- a/src/jtag/aice/aice_port.h +++ b/src/jtag/aice/aice_port.h @@ -107,8 +107,6 @@ struct aice_port_param_s { /** */ const char *device_desc; /** */ - const char *serial; - /** */ uint16_t vid; /** */ uint16_t pid; diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index d5b2ae221a..b6c185ef24 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -735,4 +735,10 @@ proc ft232r_restore_serial args { eval ft232r restore_serial $args } +lappend _telnet_autocomplete_skip "aice serial" +proc "aice serial" {args} { + echo "DEPRECATED! use 'adapter serial' not 'aice serial'" + eval adapter serial $args +} + # END MIGRATION AIDS diff --git a/tcl/interface/nds32-aice.cfg b/tcl/interface/nds32-aice.cfg index 3b21025b51..fcc33ec28f 100644 --- a/tcl/interface/nds32-aice.cfg +++ b/tcl/interface/nds32-aice.cfg @@ -6,7 +6,7 @@ adapter driver aice aice desc "Andes AICE adapter" -aice serial "C001-42163" +# adapter serial "C001-42163" aice vid_pid 0x1CFC 0x0000 aice port aice_usb reset_config trst_and_srst