jtag: replace command "jtag_reset" with "adapter [de]assert"
Replace the JTAG transport specific command with a more generic one. Deprecate "jtag_reset" and update the documentation. While there, fix an error in the documentation, where the command "jtag_reset" was used in place of command "reset_config". Change-Id: I41a988d37ce69f7b35a960cbaf5306aab0299b99 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5286 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
committed by
Tomas Vanek
parent
fafe6dfc9c
commit
c07b774e8f
@@ -134,6 +134,22 @@ proc jtag_nsrst_assert_width args {
|
||||
eval adapter_nsrst_assert_width $args
|
||||
}
|
||||
|
||||
proc jtag_reset args {
|
||||
echo "DEPRECATED! use 'adapter [de]assert' not 'jtag_reset'"
|
||||
switch $args {
|
||||
"0 0"
|
||||
{eval adapter deassert trst deassert srst}
|
||||
"0 1"
|
||||
{eval adapter deassert trst assert srst}
|
||||
"1 0"
|
||||
{eval adapter assert trst deassert srst}
|
||||
"1 1"
|
||||
{eval adapter assert trst assert srst}
|
||||
default
|
||||
{return -code 1 -level 1 "jtag_reset: syntax error"}
|
||||
}
|
||||
}
|
||||
|
||||
# stlink migration helpers
|
||||
proc stlink_device_desc args {
|
||||
echo "DEPRECATED! use 'hla_device_desc' not 'stlink_device_desc'"
|
||||
|
||||
@@ -1059,34 +1059,6 @@ COMMAND_HANDLER(handle_jtag_rclk_command)
|
||||
return retval;
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(handle_jtag_reset_command)
|
||||
{
|
||||
if (CMD_ARGC != 2)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
int trst = -1;
|
||||
if (CMD_ARGV[0][0] == '1')
|
||||
trst = 1;
|
||||
else if (CMD_ARGV[0][0] == '0')
|
||||
trst = 0;
|
||||
else
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
int srst = -1;
|
||||
if (CMD_ARGV[1][0] == '1')
|
||||
srst = 1;
|
||||
else if (CMD_ARGV[1][0] == '0')
|
||||
srst = 0;
|
||||
else
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
if (adapter_init(CMD_CTX) != ERROR_OK)
|
||||
return ERROR_JTAG_INIT_FAILED;
|
||||
|
||||
jtag_add_reset(trst, srst);
|
||||
return jtag_execute_queue();
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(handle_runtest_command)
|
||||
{
|
||||
if (CMD_ARGC != 1)
|
||||
@@ -1331,14 +1303,6 @@ static const struct command_registration jtag_command_handlers[] = {
|
||||
.help = "print current scan chain configuration",
|
||||
.usage = ""
|
||||
},
|
||||
{
|
||||
.name = "jtag_reset",
|
||||
.handler = handle_jtag_reset_command,
|
||||
.mode = COMMAND_EXEC,
|
||||
.help = "Set reset line values. Value '1' is active, "
|
||||
"value '0' is inactive.",
|
||||
.usage = "trst_active srst_active",
|
||||
},
|
||||
{
|
||||
.name = "runtest",
|
||||
.handler = handle_runtest_command,
|
||||
|
||||
Reference in New Issue
Block a user