device = device->next;
i++;
}
-
- return NULL;
+
+ ERROR("jtag device number %d not defined", num);
+ exit(-1);
}
void* cmd_queue_alloc(size_t size)
return ERROR_JTAG_NOT_IMPLEMENTED;
}
- if (jtag->support_pathmove)
- {
- /* allocate memory for a new list member */
- *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- last_comand_pointer = &((*last_cmd)->next);
- (*last_cmd)->next = NULL;
- (*last_cmd)->type = JTAG_PATHMOVE;
+ /* allocate memory for a new list member */
+ *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
+ last_comand_pointer = &((*last_cmd)->next);
+ (*last_cmd)->next = NULL;
+ (*last_cmd)->type = JTAG_PATHMOVE;
+
+ (*last_cmd)->cmd.pathmove = cmd_queue_alloc(sizeof(pathmove_command_t));
+ (*last_cmd)->cmd.pathmove->num_states = num_states;
+ (*last_cmd)->cmd.pathmove->path = cmd_queue_alloc(sizeof(enum tap_state) * num_states);
- (*last_cmd)->cmd.pathmove = cmd_queue_alloc(sizeof(pathmove_command_t));
- (*last_cmd)->cmd.pathmove->num_states = num_states;
- (*last_cmd)->cmd.pathmove->path = cmd_queue_alloc(sizeof(enum tap_state) * num_states);
-
- for (i = 0; i < num_states; i++)
- (*last_cmd)->cmd.pathmove->path[i] = path[i];
- }
- else
- {
- /* validate the desired path, and see if it fits a default path */
- int begin = 0;
- int end = 0;
- int j;
-
- for (i = 0; i < num_states; i++)
- {
- for (j = i; j < num_states; j++)
- {
- if (tap_move_map[path[j]] != -1)
- {
- end = j;
- break;
- }
- }
-
- if (begin - end <= 7) /* a default path spans no more than 7 states */
- {
- jtag_add_statemove(path[end]);
- }
- else
- {
- ERROR("encountered a TAP path that can't be fulfilled by default paths");
- return ERROR_JTAG_NOT_IMPLEMENTED;
- }
-
- i = end;
- }
- }
+ for (i = 0; i < num_states; i++)
+ (*last_cmd)->cmd.pathmove->path[i] = path[i];
if (cmd_queue_cur_state == TAP_TLR && cmd_queue_end_state != TAP_TLR)
jtag_call_event_callbacks(JTAG_TRST_RELEASED);
free(captured_char);
free(in_check_value_char);
+
+ retval = ERROR_JTAG_QUEUE_FAILED;
}
}
return retval;
}
-int jtag_cancel_queue(void)
-{
- cmd_queue_free();
- jtag_command_queue = NULL;
- last_comand_pointer = &jtag_command_queue;
-
- return ERROR_OK;
-}
-
int jtag_reset_callback(enum jtag_event event, void *priv)
{
jtag_device_t *device = priv;
register_command(cmd_ctx, NULL, "jtag_speed", handle_jtag_speed_command,
COMMAND_ANY, "set jtag speed (if supported) <speed>");
register_command(cmd_ctx, NULL, "jtag_device", handle_jtag_device_command,
- COMMAND_CONFIG, NULL);
+ COMMAND_CONFIG, "jtag_device <ir_length> <ir_expected> <ir_mask>");
register_command(cmd_ctx, NULL, "reset_config", handle_reset_config_command,
COMMAND_CONFIG, NULL);
register_command(cmd_ctx, NULL, "jtag_nsrst_delay", handle_jtag_nsrst_delay_command,