return t + offset;
}
-void cmd_queue_free()
+void cmd_queue_free(void)
{
cmd_queue_page_t *page = cmd_queue_pages;
cmd_queue_pages = NULL;
}
-static void jtag_prelude1()
+static void jtag_prelude1(void)
{
if (jtag_trst == 1)
{
void jtag_sleep(u32 us)
{
- usleep(us);
+ alive_sleep(us/1000);
}
/* Try to examine chain layout according to IEEE 1149.1 ยง12
*/
-int jtag_examine_chain()
+int jtag_examine_chain(void)
{
jtag_device_t *device = jtag_devices;
scan_field_t field;
if ((idcode & 1) == 0)
{
/* LSB must not be 0, this indicates a device in bypass */
- device_count++;
-
- LOG_WARNING("Device was in bypass after TRST/TMS reset");
+ LOG_WARNING("Device does not have IDCODE");
+ idcode=0;
bit_count += 1;
}
break;
}
- if (device)
- {
- device->idcode = idcode;
- device = device->next;
- }
- device_count++;
-
manufacturer = (idcode & 0xffe) >> 1;
part = (idcode & 0xffff000) >> 12;
version = (idcode & 0xf0000000) >> 28;
bit_count += 32;
}
+ if (device)
+ {
+ device->idcode = idcode;
+ device = device->next;
+ }
+ device_count++;
}
/* see if number of discovered devices matches configuration */
return ERROR_OK;
}
-int jtag_validate_chain()
+int jtag_validate_chain(void)
{
jtag_device_t *device = jtag_devices;
int total_ir_length = 0;
if (validate_tries > 5)
{
- LOG_ERROR("Could not validate JTAG chain, exit");
+ LOG_ERROR("Could not validate JTAG chain");
return ERROR_JTAG_INVALID_INTERFACE;
}
- usleep(10000);
+ alive_sleep(10);
}
return ERROR_OK;
static int default_speed_div(int speed, int *khz)
{
+ LOG_ERROR("Translation from jtag_speed to khz not implemented");
return ERROR_FAIL;
}
{
} else
{
- retval=ERROR_COMMAND_SYNTAX_ERROR;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
command_print(cmd_ctx, "jtag_speed: %d", jtag_speed);
{
} else
{
- retval=ERROR_COMMAND_SYNTAX_ERROR;
+ return ERROR_COMMAND_SYNTAX_ERROR;
+ }
+
+ if (jtag!=NULL)
+ {
+ if ((retval=jtag->speed_div(jtag_speed, &speed_khz))!=ERROR_OK)
+ return retval;
}
+
command_print(cmd_ctx, "jtag_khz: %d", speed_khz);
return retval;