extern jtag_interface_t usbprog_interface;
#endif
+#if BUILD_JLINK == 1
+ extern jtag_interface_t jlink_interface;
+#endif
+
jtag_interface_t *jtag_interfaces[] = {
#if BUILD_ECOSBOARD == 1
&eCosBoard_interface,
#endif
#if BUILD_USBPROG == 1
&usbprog_interface,
+#endif
+#if BUILD_JLINK == 1
+ &jlink_interface,
#endif
NULL,
};
void MINIDRIVER(interface_jtag_add_dr_out)(int device_num,
int num_fields,
- int *num_bits,
- u32 *value,
+ const int *num_bits,
+ const u32 *value,
enum tap_state end_state)
{
int i;
*/
if ((jtag_reset_config & RESET_HAS_SRST)&&
(jtag_reset_config & RESET_HAS_TRST)&&
- ((jtag_reset_config & RESET_SRST_PULLS_TRST)==0)&&
- ((jtag_reset_config & RESET_TRST_PULLS_SRST)==0))
+ ((jtag_reset_config & RESET_SRST_PULLS_TRST)==0))
{
if (((req_tlr_or_trst&&!jtag_trst)||
(!req_tlr_or_trst&&jtag_trst))&&
((req_srst&&!jtag_srst)||
(!req_srst&&jtag_srst)))
{
- LOG_ERROR("BUG: transition of req_tlr_or_trst and req_srst in the same jtag_add_reset() call is undefined");
+ // FIX!!! srst_pulls_trst allows 1,1 => 0,0 transition....
+ //LOG_ERROR("BUG: transition of req_tlr_or_trst and req_srst in the same jtag_add_reset() call is undefined");
}
}
int MINIDRIVER(interface_jtag_execute_queue)(void)
{
int retval;
-
+
+ if (jtag==NULL)
+ {
+ LOG_ERROR("No JTAG interface configured yet. Issue 'init' command in startup scripts before communicating with targets.");
+ return ERROR_FAIL;
+ }
+
retval = jtag->execute_queue();
cmd_queue_free();
return ERROR_FAIL;
}
-static int default_speedDiv(int speed, int *khz)
+static int default_speed_div(int speed, int *khz)
{
- LOG_ERROR("Translation from jtag_speed to khz not implemented");
return ERROR_FAIL;
}
{
jtag_interface->khz = default_khz;
}
- if (jtag_interface->speedDiv == NULL)
+ if (jtag_interface->speed_div == NULL)
{
- jtag_interface->speedDiv = default_speedDiv;
+ jtag_interface->speed_div = default_speed_div;
}
return ERROR_OK;
}
* in which case jtag isn't initialized */
if (jtag)
{
- jtag->speedDiv(jtag_speed, &speed1);
- jtag->speedDiv(jtag_speed_post_reset, &speed2);
+ jtag->speed_div(jtag_speed, &speed1);
+ jtag->speed_div(jtag_speed_post_reset, &speed2);
jtag->speed(cur_speed);
}
}
LOG_DEBUG("have interface set up");
int speed_div1, speed_div2;
if (jtag->khz(speed1, &speed_div1)!=ERROR_OK)
+ {
+ speed1 = speed2 = 0;
return ERROR_OK;
+ }
if (jtag->khz(speed2, &speed_div2)!=ERROR_OK)
+ {
+ speed1 = speed2 = 0;
return ERROR_OK;
+ }
if (argc >= 1)
cur_speed = jtag_speed = jtag_speed_post_reset = speed_div1;