]> git.sur5r.net Git - openocd/blobdiff - src/jtag/jtag.c
- removed obsolete cmd JLINK_TAP_SEQUENCE_COMMAND, use EMU_CMD_HW_JTAG instead
[openocd] / src / jtag / jtag.c
index a2af81eb5a9cbc943c943da4ee72e8887f5b5c14..cd4b255a90ae07ab6e95262a3bbaa098223a3c56 100644 (file)
@@ -193,6 +193,10 @@ static int hasKHz = 0;
        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,
@@ -226,6 +230,9 @@ jtag_interface_t *jtag_interfaces[] = {
 #endif
 #if BUILD_USBPROG == 1
        &usbprog_interface,
+#endif
+#if BUILD_JLINK == 1
+       &jlink_interface,
 #endif
        NULL,
 };
@@ -667,8 +674,8 @@ int MINIDRIVER(interface_jtag_add_dr_scan)(int num_fields, scan_field_t *fields,
 
 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;
@@ -923,15 +930,15 @@ void jtag_add_reset(int req_tlr_or_trst, int req_srst)
        */
        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");
                }
        }
        
@@ -1253,7 +1260,13 @@ enum scan_type jtag_scan_type(scan_command_t *cmd)
 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();