rename jtag_khz as adapter_khz

Globally rename "jtag_khz" as "adapter_khz", and move it out of the "jtag"
command group ...  it needs to be used with non-JTAG transports

Includes a migration aid (in jtag/startup.tcl) so that old user scripts
won't break.  That aid should Sunset in about a year.  (We may want to
update it to include a nag message too.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
This commit is contained in:
David Brownell
2010-03-15 08:37:43 -07:00
parent 4b964a81ca
commit 96f9790279
49 changed files with 111 additions and 96 deletions

View File

@@ -1556,7 +1556,7 @@ unsigned jtag_get_speed_khz(void)
return speed_khz;
}
static int jtag_khz_to_speed(unsigned khz, int* speed)
static int adapter_khz_to_speed(unsigned khz, int* speed)
{
LOG_DEBUG("convert khz to interface specific speed value");
speed_khz = khz;
@@ -1576,11 +1576,11 @@ static int jtag_khz_to_speed(unsigned khz, int* speed)
static int jtag_rclk_to_speed(unsigned fallback_speed_khz, int* speed)
{
int retval = jtag_khz_to_speed(0, speed);
int retval = adapter_khz_to_speed(0, speed);
if ((ERROR_OK != retval) && fallback_speed_khz)
{
LOG_DEBUG("trying fallback speed...");
retval = jtag_khz_to_speed(fallback_speed_khz, speed);
retval = adapter_khz_to_speed(fallback_speed_khz, speed);
}
return retval;
}
@@ -1598,7 +1598,7 @@ int jtag_config_khz(unsigned khz)
LOG_DEBUG("handle jtag khz");
clock_mode = CLOCK_MODE_KHZ;
int speed = 0;
int retval = jtag_khz_to_speed(khz, &speed);
int retval = adapter_khz_to_speed(khz, &speed);
return (ERROR_OK != retval) ? retval : jtag_set_speed(speed);
}
@@ -1621,7 +1621,7 @@ int jtag_get_speed(void)
speed = jtag_speed;
break;
case CLOCK_MODE_KHZ:
jtag_khz_to_speed(jtag_get_speed_khz(), &speed);
adapter_khz_to_speed(jtag_get_speed_khz(), &speed);
break;
case CLOCK_MODE_RCLK:
jtag_rclk_to_speed(rclk_fallback_speed_khz, &speed);

View File

@@ -680,7 +680,7 @@ static struct bitq_interface presto_bitq = {
/* -------------------------------------------------------------------------- */
static int presto_jtag_khz(int khz, int *jtag_speed)
static int presto_adapter_khz(int khz, int *jtag_speed)
{
if (khz < 0)
{
@@ -797,7 +797,7 @@ struct jtag_interface presto_interface = {
.execute_queue = bitq_execute_queue,
.speed = presto_jtag_speed,
.khz = presto_jtag_khz,
.khz = presto_adapter_khz,
.speed_div = presto_jtag_speed_div,
.init = presto_jtag_init,
.quit = presto_jtag_quit,

View File

@@ -75,3 +75,12 @@ add_help_text srst_deasserted "Overridable procedure run when srst deassert is d
proc srst_asserted {} {
puts "Sensed nSRST asserted."
}
# BEGIN MIGRATION AIDS ... these adapter operations originally had
# JTAG-specific names despite the fact that the operations were not
# specific to JTAG.
#
# FIXME phase these aids out after about April 2011
#
proc jtag_khz args { eval adapter_khz $args }
# END MIGRATION AIDS

View File

@@ -1351,7 +1351,7 @@ COMMAND_HANDLER(handle_jtag_ntrst_assert_width_command)
return ERROR_OK;
}
COMMAND_HANDLER(handle_jtag_khz_command)
COMMAND_HANDLER(handle_adapter_khz_command)
{
if (CMD_ARGC > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1608,6 +1608,16 @@ COMMAND_HANDLER(handle_tms_sequence_command)
}
static const struct command_registration interface_command_handlers[] = {
{
.name = "adapter_khz",
.handler = handle_adapter_khz_command,
.mode = COMMAND_ANY,
.help = "With an argument, change to the specified maximum "
"jtag speed. For JTAG, 0 KHz signifies adaptive "
" clocking. "
"With or without argument, display current setting.",
.usage = "[khz]",
},
{
.name = "interface",
.handler = handle_interface_command,
@@ -1636,15 +1646,6 @@ int interface_register_commands(struct command_context *ctx)
}
static const struct command_registration jtag_command_handlers[] = {
{
.name = "jtag_khz",
.handler = handle_jtag_khz_command,
.mode = COMMAND_ANY,
.help = "With an argument, change to the specified maximum "
"jtag speed. Pass 0 to require adaptive clocking. "
"With or without argument, display current setting.",
.usage = "[khz]",
},
{
.name = "jtag_rclk",
.handler = handle_jtag_rclk_command,