aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Fewell <efewell@ti.com>2020-03-04 17:24:33 -0600
committerAntonio Borneo <borneo.antonio@gmail.com>2020-03-24 17:17:45 +0000
commit87a4158acf56863d4e5e70afc33791f631b6c693 (patch)
treec525b6354071943309181f75b53817b8b1ef3a3c /src
parent76ba9bd0b373e0bddfe944e411550b0a0304b238 (diff)
downloadriscv-openocd-87a4158acf56863d4e5e70afc33791f631b6c693.zip
riscv-openocd-87a4158acf56863d4e5e70afc33791f631b6c693.tar.gz
riscv-openocd-87a4158acf56863d4e5e70afc33791f631b6c693.tar.bz2
drivers: xds110: Clean up command syntax and documentation
Arrange all commands under a top level xds110 command. Fix documentation to properly reflect the current functionality. Also updated the links in the document to the new permanent links for the XDS110 only support. Patch updated for comments from code review. Return ERROR_COMMAND_SYNTAX_ERROR for wrong number of args in commands. Added deprecated commands to src/jtag/startup.tcl. Change-Id: Ica45f65e1fdf7fa72866f4e28c4f6bce428d8ac9 Signed-off-by: Edward Fewell <efewell@ti.com> Reviewed-on: http://openocd.zylin.com/5495 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/jtag/drivers/xds110.c44
-rw-r--r--src/jtag/startup.tcl10
2 files changed, 29 insertions, 25 deletions
diff --git a/src/jtag/drivers/xds110.c b/src/jtag/drivers/xds110.c
index 085d85f..9ca200e 100644
--- a/src/jtag/drivers/xds110.c
+++ b/src/jtag/drivers/xds110.c
@@ -2028,11 +2028,8 @@ COMMAND_HANDLER(xds110_handle_serial_command)
xds110.serial[i] = (char)serial[i];
xds110.serial[len] = 0;
- } else {
- LOG_ERROR("XDS110: expected exactly one argument to xds110_serial "
- "<serial-number>");
- return ERROR_FAIL;
- }
+ } else
+ return ERROR_COMMAND_SYNTAX_ERROR;
return ERROR_OK;
}
@@ -2053,11 +2050,8 @@ COMMAND_HANDLER(xds110_handle_supply_voltage_command)
return ERROR_FAIL;
}
xds110.voltage = voltage;
- } else {
- LOG_ERROR("XDS110: expected one argument to xds110_supply_voltage "
- "<millivolts>");
- return ERROR_FAIL;
- }
+ } else
+ return ERROR_COMMAND_SYNTAX_ERROR;
return ERROR_OK;
}
@@ -2067,33 +2061,33 @@ static const struct command_registration xds110_subcommand_handlers[] = {
.name = "info",
.handler = &xds110_handle_info_command,
.mode = COMMAND_EXEC,
- .usage = "",
.help = "show XDS110 info",
- },
- COMMAND_REGISTRATION_DONE
-};
-
-static const struct command_registration xds110_command_handlers[] = {
- {
- .name = "xds110",
- .mode = COMMAND_ANY,
- .help = "perform XDS110 management",
- .usage = "<cmd>",
- .chain = xds110_subcommand_handlers,
+ .usage = "",
},
{
- .name = "xds110_serial",
+ .name = "serial",
.handler = &xds110_handle_serial_command,
.mode = COMMAND_CONFIG,
.help = "set the XDS110 probe serial number",
.usage = "serial_string",
},
{
- .name = "xds110_supply_voltage",
+ .name = "supply",
.handler = &xds110_handle_supply_voltage_command,
.mode = COMMAND_CONFIG,
.help = "set the XDS110 probe supply voltage",
- .usage = "supply_voltage (millivolts)",
+ .usage = "voltage_in_millivolts",
+ },
+ COMMAND_REGISTRATION_DONE
+};
+
+static const struct command_registration xds110_command_handlers[] = {
+ {
+ .name = "xds110",
+ .mode = COMMAND_ANY,
+ .help = "perform XDS110 management",
+ .usage = "",
+ .chain = xds110_subcommand_handlers,
},
COMMAND_REGISTRATION_DONE
};
diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl
index 8fc3ad5..f8c4ca0 100644
--- a/src/jtag/startup.tcl
+++ b/src/jtag/startup.tcl
@@ -216,4 +216,14 @@ proc ftdi_location args {
eval adapter usb location $args
}
+proc xds110_serial args {
+ echo "DEPRECATED! use 'xds110 serial' not 'xds110_serial'"
+ eval xds110 serial $args
+}
+
+proc xds110_supply_voltage args {
+ echo "DEPRECATED! use 'xds110 supply' not 'xds110_supply_voltage'"
+ eval xds110 supply $args
+}
+
# END MIGRATION AIDS