X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fjtag%2Fcore.c;h=86ba706bac1743511f188331c22ad43f653467dc;hp=63f319a3f96906c648d5781248556762f3f21210;hb=cf8a3c3d7075abad3c88cd604f8add4d06898abc;hpb=3d2dd4a3a31d730de244d2f35f351e826ced55b1 diff --git a/src/jtag/core.c b/src/jtag/core.c index 63f319a3f9..86ba706bac 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -894,7 +894,7 @@ void jtag_sleep(uint32_t us) /* A reserved manufacturer ID is used in END_OF_CHAIN_FLAG, so we * know that no valid TAP will have it as an IDCODE value. */ -#define END_OF_CHAIN_FLAG 0x000000ff +#define END_OF_CHAIN_FLAG 0xffffffff /* a larger IR length than we ever expect to autoprobe */ #define JTAG_IRLEN_MAX 60 @@ -962,10 +962,10 @@ static bool jtag_idcode_is_final(uint32_t idcode) { /* * Some devices, such as AVR8, will output all 1's instead - * of TDI input value at end of chain. Allow those values + * of TDI input value at end of chain. Allow those values * instead of failing. */ - return idcode == END_OF_CHAIN_FLAG || idcode == 0xFFFFFFFF; + return idcode == END_OF_CHAIN_FLAG; } /** @@ -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;