formatting.
git-svn-id: svn://svn.berlios.de/openocd/trunk@345 b42882b7-edfa-0310-969c-e2dbd0fdcd60__archive__
parent
a08d86e88d
commit
375c5f85d2
|
@ -1352,45 +1352,45 @@ int jtag_interface_init(struct command_context_s *cmd_ctx)
|
||||||
int jtag_init(struct command_context_s *cmd_ctx)
|
int jtag_init(struct command_context_s *cmd_ctx)
|
||||||
{
|
{
|
||||||
int i, validate_tries = 0;
|
int i, validate_tries = 0;
|
||||||
jtag_device_t *device;
|
jtag_device_t *device;
|
||||||
|
|
||||||
DEBUG("-");
|
DEBUG("-");
|
||||||
|
|
||||||
if (!jtag && jtag_interface_init(cmd_ctx) != ERROR_OK)
|
if (!jtag && jtag_interface_init(cmd_ctx) != ERROR_OK)
|
||||||
return ERROR_JTAG_INIT_FAILED;
|
return ERROR_JTAG_INIT_FAILED;
|
||||||
|
|
||||||
device = jtag_devices;
|
device = jtag_devices;
|
||||||
jtag_ir_scan_size = 0;
|
jtag_ir_scan_size = 0;
|
||||||
jtag_num_devices = 0;
|
jtag_num_devices = 0;
|
||||||
while (device != NULL)
|
while (device != NULL)
|
||||||
{
|
{
|
||||||
jtag_ir_scan_size += device->ir_length;
|
jtag_ir_scan_size += device->ir_length;
|
||||||
jtag_num_devices++;
|
jtag_num_devices++;
|
||||||
device = device->next;
|
device = device->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
jtag_add_statemove(TAP_TLR);
|
jtag_add_statemove(TAP_TLR);
|
||||||
jtag_execute_queue();
|
jtag_execute_queue();
|
||||||
|
|
||||||
/* examine chain first, as this could discover the real chain layout */
|
/* examine chain first, as this could discover the real chain layout */
|
||||||
if (jtag_examine_chain() != ERROR_OK)
|
if (jtag_examine_chain() != ERROR_OK)
|
||||||
{
|
{
|
||||||
ERROR("trying to validate configured JTAG chain anyway...");
|
ERROR("trying to validate configured JTAG chain anyway...");
|
||||||
}
|
}
|
||||||
|
|
||||||
while (jtag_validate_chain() != ERROR_OK)
|
while (jtag_validate_chain() != ERROR_OK)
|
||||||
{
|
{
|
||||||
validate_tries++;
|
validate_tries++;
|
||||||
if (validate_tries > 5)
|
if (validate_tries > 5)
|
||||||
{
|
{
|
||||||
ERROR("Could not validate JTAG chain, exit");
|
ERROR("Could not validate JTAG chain, exit");
|
||||||
jtag = NULL;
|
jtag = NULL;
|
||||||
return ERROR_JTAG_INVALID_INTERFACE;
|
return ERROR_JTAG_INVALID_INTERFACE;
|
||||||
}
|
}
|
||||||
usleep(10000);
|
usleep(10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||||
|
@ -1406,21 +1406,21 @@ int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char
|
||||||
|
|
||||||
/* interface name is a mandatory argument */
|
/* interface name is a mandatory argument */
|
||||||
if (argc < 1 || args[0][0] == '\0')
|
if (argc < 1 || args[0][0] == '\0')
|
||||||
{
|
{
|
||||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; jtag_interfaces[i]; i++)
|
for (i=0; jtag_interfaces[i]; i++)
|
||||||
{
|
{
|
||||||
if (strcmp(args[0], jtag_interfaces[i]->name) == 0)
|
if (strcmp(args[0], jtag_interfaces[i]->name) == 0)
|
||||||
{
|
{
|
||||||
if (jtag_interfaces[i]->register_commands(cmd_ctx) != ERROR_OK)
|
if (jtag_interfaces[i]->register_commands(cmd_ctx) != ERROR_OK)
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|
||||||
jtag_interface = jtag_interfaces[i];
|
jtag_interface = jtag_interfaces[i];
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* no valid interface was found (i.e. the configuration option,
|
/* no valid interface was found (i.e. the configuration option,
|
||||||
* didn't match one of the compiled-in interfaces
|
* didn't match one of the compiled-in interfaces
|
||||||
|
|
Loading…
Reference in New Issue