diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2010-03-15 08:37:43 -0700 |
---|---|---|
committer | David Brownell <dbrownell@users.sourceforge.net> | 2010-03-15 08:37:43 -0700 |
commit | 96f9790279f74f39b35fc3ad09340fd03123180c (patch) | |
tree | 672f5b717c5f6edf3f7e1377341e37cd7f6497ee /src | |
parent | 4b964a81ca1423b808a056b457e3d458689d50fa (diff) | |
download | openocd_libswd-96f9790279f74f39b35fc3ad09340fd03123180c.tar.gz openocd_libswd-96f9790279f74f39b35fc3ad09340fd03123180c.tar.bz2 openocd_libswd-96f9790279f74f39b35fc3ad09340fd03123180c.tar.xz openocd_libswd-96f9790279f74f39b35fc3ad09340fd03123180c.zip |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/jtag/core.c | 10 | ||||
-rw-r--r-- | src/jtag/drivers/presto.c | 4 | ||||
-rw-r--r-- | src/jtag/startup.tcl | 9 | ||||
-rw-r--r-- | src/jtag/tcl.c | 21 | ||||
-rw-r--r-- | src/svf/svf.c | 2 |
5 files changed, 28 insertions, 18 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c index e7cb48d7..bdf968e9 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -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); diff --git a/src/jtag/drivers/presto.c b/src/jtag/drivers/presto.c index 72126a1e..10bed272 100644 --- a/src/jtag/drivers/presto.c +++ b/src/jtag/drivers/presto.c @@ -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, diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 4e6d5fc1..c49c43e1 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -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 diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index ce17e4b8..8faefd1a 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -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; @@ -1609,6 +1609,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, .mode = COMMAND_CONFIG, @@ -1637,15 +1647,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, .mode = COMMAND_ANY, diff --git a/src/svf/svf.c b/src/svf/svf.c index fba499c3..6e951e24 100644 --- a/src/svf/svf.c +++ b/src/svf/svf.c @@ -880,7 +880,7 @@ static int svf_run_command(struct command_context *cmd_ctx, char *cmd_str) // TODO: set jtag speed to if (svf_para.frequency > 0) { - command_run_linef(cmd_ctx, "jtag_khz %d", (int)svf_para.frequency / 1000); + command_run_linef(cmd_ctx, "adapter_khz %d", (int)svf_para.frequency / 1000); LOG_DEBUG("\tfrequency = %f", svf_para.frequency); } } |