usleep(us);
}
-int cwvx_device_num = -1, cwvx_version_num, cwvx_part_num;
-
/* Try to examine chain layout according to IEEE 1149.1 ยง12
*/
int jtag_examine_chain()
LOG_INFO("JTAG device found: 0x%8.8x (Manufacturer: 0x%3.3x, Part: 0x%4.4x, Version: 0x%1.1x)",
idcode, manufacturer, part, version);
- /* Total hacky hack! PORGES */
- if (manufacturer == 0x1a2) {
- cwvx_device_num = device_count-1;
- cwvx_part_num = part;
- cwvx_version_num = version;
- }
-
bit_count += 32;
}
}
int jtag_interface_init(struct command_context_s *cmd_ctx)
{
+ if (jtag)
+ return ERROR_OK;
+
if (!jtag_interface)
{
/* nothing was previously specified by "interface" command */
{
int validate_tries = 0;
jtag_device_t *device;
+ int retval;
LOG_DEBUG("-");
- if (!jtag && jtag_interface_init(cmd_ctx) != ERROR_OK)
- return ERROR_JTAG_INIT_FAILED;
-
device = jtag_devices;
jtag_ir_scan_size = 0;
jtag_num_devices = 0;
}
jtag_add_tlr();
- jtag_execute_queue();
+ if ((retval=jtag_execute_queue())==ERROR_OK)
+ return retval;
/* examine chain first, as this could discover the real chain layout */
if (jtag_examine_chain() != ERROR_OK)
int jtag_init_reset(struct command_context_s *cmd_ctx)
{
int retval;
+
+ if ((retval=jtag_interface_init(cmd_ctx)) != ERROR_OK)
+ return retval;
+
LOG_DEBUG("Trying to bring the JTAG controller to life by asserting TRST / tms");
/* Reset can happen after a power cycle.
int jtag_init(struct command_context_s *cmd_ctx)
{
+ int retval;
+ if ((retval=jtag_interface_init(cmd_ctx)) != ERROR_OK)
+ return retval;
if (jtag_init_inner(cmd_ctx)==ERROR_OK)
{
return ERROR_OK;
return ERROR_COMMAND_SYNTAX_ERROR;
}
- if (!jtag && jtag_interface_init(cmd_ctx) != ERROR_OK)
+ if (jtag_interface_init(cmd_ctx) != ERROR_OK)
return ERROR_JTAG_INIT_FAILED;
jtag_add_reset(trst, srst);