X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fjtag%2Fcore.c;h=86ba706bac1743511f188331c22ad43f653467dc;hb=cf8a3c3d7075abad3c88cd604f8add4d06898abc;hp=5d5803a3604a4c2350d72f5dfc19c82195801cf1;hpb=2c14497d0a87ecebcfc9a7768f6de75898f261bf;p=openocd.git diff --git a/src/jtag/core.c b/src/jtag/core.c index 5d5803a360..86ba706bac 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -1371,6 +1371,11 @@ int adapter_init(struct command_context *cmd_ctx) return retval; } + if (jtag->speed == NULL) { + LOG_INFO("This adapter doesn't support configurable speed"); + return ERROR_OK; + } + if (CLOCK_MODE_UNSELECTED == clock_mode) { LOG_ERROR("An adapter speed is not selected in the init script." " Insert a call to adapter_khz or jtag_rclk to proceed."); @@ -1549,7 +1554,17 @@ int jtag_init_reset(struct command_context *cmd_ctx) if ((jtag_reset_config & RESET_SRST_PULLS_TRST) == 0) jtag_add_reset(0, 1); } - jtag_add_reset(0, 0); + + /* some targets enable us to connect with srst asserted */ + if (jtag_reset_config & RESET_CNCT_UNDER_SRST) { + if (jtag_reset_config & RESET_SRST_NO_GATING) + jtag_add_reset(0, 1); + else { + LOG_WARNING("\'srst_nogate\' reset_config option is required"); + jtag_add_reset(0, 0); + } + } else + jtag_add_reset(0, 0); retval = jtag_execute_queue(); if (retval != ERROR_OK) return retval; @@ -1572,6 +1587,14 @@ int jtag_init(struct command_context *cmd_ctx) /* guard against oddball hardware: force resets to be inactive */ jtag_add_reset(0, 0); + + /* some targets enable us to connect with srst asserted */ + if (jtag_reset_config & RESET_CNCT_UNDER_SRST) { + if (jtag_reset_config & RESET_SRST_NO_GATING) + jtag_add_reset(0, 1); + else + LOG_WARNING("\'srst_nogate\' reset_config option is required"); + } retval = jtag_execute_queue(); if (retval != ERROR_OK) return retval;