From 44ad4fdcb026e513681f2d8c4c812652b13a389c Mon Sep 17 00:00:00 2001 From: Tomas Vanek Date: Mon, 9 Jan 2017 17:06:52 +0100 Subject: [PATCH] jtag/drivers cmsis-dap: do not limit speed so strictly Adapter clock frequency is set by 32-bit number and most adapters limit the highest speed safely. There is no reason to impose strict limit of 5000 kHz if some adapters can do more. While on it give informative error message in case of zero adapter_khz. Change-Id: I45c9804678e24496ea769ea9ca6036701b04dde9 Signed-off-by: Tomas Vanek Reviewed-on: http://openocd.zylin.com/3945 Tested-by: jenkins Reviewed-by: Freddie Chopin --- src/jtag/drivers/cmsis_dap_usb.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/jtag/drivers/cmsis_dap_usb.c b/src/jtag/drivers/cmsis_dap_usb.c index cffd5e7f1..86f796877 100644 --- a/src/jtag/drivers/cmsis_dap_usb.c +++ b/src/jtag/drivers/cmsis_dap_usb.c @@ -1499,13 +1499,11 @@ static int cmsis_dap_execute_queue(void) static int cmsis_dap_speed(int speed) { - if (speed > DAP_MAX_CLOCK) { - LOG_INFO("reduce speed request: %dkHz to %dkHz maximum", speed, DAP_MAX_CLOCK); - speed = DAP_MAX_CLOCK; - } + if (speed > DAP_MAX_CLOCK) + LOG_INFO("High speed (adapter_khz %d) may be limited by adapter firmware.", speed); if (speed == 0) { - LOG_INFO("RTCK not supported"); + LOG_ERROR("RTCK not supported. Set nonzero adapter_khz."); return ERROR_JTAG_NOT_IMPLEMENTED; }