Index: src/helper/startup.tcl
===================================================================
--- src/helper/startup.tcl	(revision 2578)
+++ src/helper/startup.tcl	(working copy)
@@ -134,15 +134,6 @@
 	reset halt
 }
 
-# If RCLK is not supported, use fallback_speed_khz
-proc jtag_rclk {fallback_speed_khz} {
-	if {[catch {jtag_khz 0}]!=0} {
-		jtag_khz $fallback_speed_khz
-	}
-}
-
-add_help_text jtag_rclk "fallback_speed_khz - set JTAG speed to RCLK or use fallback speed"
-
 proc ocd_process_reset { MODE } {
 
 	# If this target must be halted...
Index: src/jtag/core.c
===================================================================
--- src/jtag/core.c	(revision 2578)
+++ src/jtag/core.c	(working copy)
@@ -101,6 +101,8 @@
 
 /* speed in kHz*/
 static int speed_khz = 0;
+/* speed to fallback to when RCLK is requested but not supported */
+static int rclk_fallback_speed_khz = 0;
 /* flag if the kHz speed was defined */
 static bool hasKHz = false;
 static int jtag_speed = 0;
@@ -1140,16 +1142,39 @@
 		LOG_ERROR("JTAG interface has to be specified, see \"interface\" command");
 		return ERROR_JTAG_INVALID_INTERFACE;
 	}
+
+	if (jtag_interface->init() != ERROR_OK)
+		return ERROR_JTAG_INIT_FAILED;
+
+	jtag = jtag_interface;
+
 	if (hasKHz)
 	{
-		jtag_interface->khz(jtag_get_speed_khz(), &jtag_speed);
+		int retval;
+		LOG_DEBUG("Setting up the JTAG clock speed selected in the configuration mode...");
+		if (rclk_fallback_speed_khz)
+		{
+			retval = jtag_config_rclk(rclk_fallback_speed_khz);
+		}
+		else
+		{
+			retval = jtag_config_khz(jtag_get_speed_khz());
+		}
+		if (retval)
+			LOG_ERROR("The requested clock speed could not be selected");
 		hasKHz = false;
 	}
 
-	if (jtag_interface->init() != ERROR_OK)
-		return ERROR_JTAG_INIT_FAILED;
+	int cur_speed = jtag_get_speed_khz();
+	int retval = jtag_get_speed_readable(&cur_speed);
+	if (ERROR_OK != retval)
+		return retval;
 
-	jtag = jtag_interface;
+	if (cur_speed)
+		LOG_INFO("clock speed %d kHz", cur_speed);
+	else
+		LOG_INFO("adaptive clock speed (RCLK)");
+
 	return ERROR_OK;
 }
 
@@ -1267,6 +1292,7 @@
 {
 	LOG_DEBUG("handle jtag khz");
 	jtag_set_speed_khz(khz);
+	rclk_fallback_speed_khz = 0;
 
 	int cur_speed = 0;
 	if (jtag != NULL)
@@ -1284,6 +1310,20 @@
 	return jtag_set_speed(cur_speed);
 }
 
+int jtag_config_rclk(unsigned fallback_speed_khz)
+{
+	LOG_DEBUG("handle jtag rclk");
+	jtag_set_speed_khz(0);
+	int retval = jtag_config_khz(jtag_get_speed_khz());
+	if ((ERROR_OK != retval) && fallback_speed_khz)
+	{
+		LOG_DEBUG("trying fallback speed...");
+		retval = jtag_config_khz(fallback_speed_khz);
+	}
+	rclk_fallback_speed_khz = fallback_speed_khz;
+	return retval;
+}
+
 int jtag_get_speed(void)
 {
 	return jtag_speed;
@@ -1298,9 +1338,9 @@
 	return jtag ? jtag->speed(speed) : ERROR_OK;
 }
 
-int jtag_get_speed_readable(int *speed)
+int jtag_get_speed_readable(int *khz)
 {
-	return jtag ? jtag->speed_div(jtag_get_speed(), speed) : ERROR_OK;
+	return jtag ? jtag->speed_div(jtag_get_speed(), khz) : ERROR_OK;
 }
 
 
Index: src/jtag/jtag.h
===================================================================
--- src/jtag/jtag.h	(revision 2578)
+++ src/jtag/jtag.h	(working copy)
@@ -257,6 +257,9 @@
 
 /// Attempt to configure the interface for the specified KHz.
 int jtag_config_khz(unsigned khz);
+/// Attempt to enable RTCK/RCLK. If that fails, fallback to the
+/// specified frequency.
+int jtag_config_rclk(unsigned fallback_speed_khz);
 /// Set the clock speed of the JTAG interface in KHz.
 void jtag_set_speed_khz(unsigned speed);
 /// Retreives the clock speed of the JTAG interface in KHz.
Index: src/jtag/tcl.c
===================================================================
--- src/jtag/tcl.c	(revision 2578)
+++ src/jtag/tcl.c	(working copy)
@@ -55,6 +55,7 @@
 static int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 static int handle_jtag_speed_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 static int handle_jtag_khz_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
+static int handle_jtag_rclk_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 static int handle_jtag_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 static int handle_reset_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 static int handle_jtag_nsrst_delay_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
@@ -577,6 +578,8 @@
 	register_command(cmd_ctx, NULL, "jtag_khz", handle_jtag_khz_command,
 		COMMAND_ANY, "set maximum jtag speed (if supported); "
 		"parameter is maximum khz, or 0 for adaptive clocking (RTCK).");
+	register_command(cmd_ctx, NULL, "jtag_rclk", handle_jtag_rclk_command,
+		COMMAND_ANY, "fallback_speed_khz - set JTAG speed to RCLK or use fallback speed");
 	register_command(cmd_ctx, NULL, "jtag_device", handle_jtag_device_command,
 		COMMAND_CONFIG, "(DEPRECATED) jtag_device <ir_length> <ir_expected> <ir_mask>");
 	register_command(cmd_ctx, NULL, "reset_config", handle_reset_config_command,
@@ -993,6 +996,36 @@
 	return retval;
 }
 
+static int handle_jtag_rclk_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+{
+	if (argc > 1)
+		return ERROR_COMMAND_SYNTAX_ERROR;
+
+	int retval = ERROR_OK;
+	if (argc == 1)
+	{
+		unsigned khz = 0;
+		int retval = parse_uint(args[0], &khz);
+		if (ERROR_OK != retval)
+			return retval;
+		retval = jtag_config_rclk(khz);
+		if (ERROR_OK != retval)
+			return retval;
+	}
+
+	int cur_khz = jtag_get_speed_khz();
+	retval = jtag_get_speed_readable(&cur_khz);
+	if (ERROR_OK != retval)
+		return retval;
+
+	if (cur_khz)
+		command_print(cmd_ctx, "RCLK not supported - fallback to %d kHz", cur_khz);
+	else
+		command_print(cmd_ctx, "RCLK - adaptive");
+
+	return retval;
+}
+
 static int handle_jtag_reset_command(struct command_context_s *cmd_ctx,
 		char *cmd, char **args, int argc)
 {
