]> git.sur5r.net Git - openocd/blobdiff - src/jtag/jtag.h
pull up verify_capture_ir one level in api stack
[openocd] / src / jtag / jtag.h
index 0699516c9b5fbe1d541fbf3805e0ceb36380be26..656741f9b36b0cc800842c8f5c3db52f7e008ea0 100644 (file)
@@ -273,10 +273,10 @@ typedef struct scan_field_s
        u8*         out_value;          /* value to be scanned into the device */
        u8*         in_value;           /* pointer to a 32-bit memory location to take data scanned out */
        /* in_check_value/mask, in_handler_error_handler, in_handler_priv can be used by the in handler, otherwise they contain garbage  */
-       u8*          in_check_value;    /* used to validate scan results */
-       u8*          in_check_mask;     /* check specified bits against check_value */
-       in_handler_t in_handler;        /* process received buffer using this handler */
-       void*        in_handler_priv;   /* additional information for the in_handler */
+       u8*          in_check_value;    /* deprecated! only used from jtag_set_check_value. used to validate scan results */
+       u8*          in_check_mask;     /* deprecated! only used from jtag_set_check_value.  check specified bits against check_value */
+       in_handler_t in_handler;        /* deprecated! SET TO NULL. DO NOT USE! process received buffer using this handler */
+       void*        in_handler_priv;   /* deprecated! only used by obsolete in_handler implementations */
 } scan_field_t;
 
 enum scan_type {
@@ -559,8 +559,14 @@ extern int  jtag_register_commands(struct command_context_s* cmd_ctx);
  *
  */
 extern void jtag_add_ir_scan(int num_fields, scan_field_t* fields, tap_state_t endstate);
+/* same as jtag_add_ir_scan except no verify is performed */
+extern void jtag_add_ir_scan_noverify(int num_fields, scan_field_t *fields, tap_state_t state);
 extern int  interface_jtag_add_ir_scan(int num_fields, scan_field_t* fields, tap_state_t endstate);
 extern void jtag_add_dr_scan(int num_fields, scan_field_t* fields, tap_state_t endstate);
+/* same as jtag_add_dr_scan but the scan is executed immediately. sets jtag_error if there
+ * was a failure.
+ */
+extern void jtag_add_dr_scan_now(int num_fields, scan_field_t* fields, tap_state_t endstate);
 extern int  interface_jtag_add_dr_scan(int num_fields, scan_field_t* fields, tap_state_t endstate);
 extern void jtag_add_plain_ir_scan(int num_fields, scan_field_t* fields, tap_state_t endstate);
 extern int  interface_jtag_add_plain_ir_scan(int num_fields, scan_field_t* fields, tap_state_t endstate);
@@ -580,10 +586,10 @@ extern int  interface_jtag_add_tlr(void);
  * of the same interface over time. Even if the OpenOCD code
  * is unchanged, the actual path taken may vary over time
  * and versions of interface firmware or PCB revisions.
- * 
+ *
  * Use jtag_add_pathmove() when specific transition sequences
  * are required.
- * 
+ *
  * Do not use jtag_add_pathmove() unless you need to, but do use it
  * if you have to.
  *
@@ -696,13 +702,44 @@ int  interface_jtag_add_clocks(int num_cycles);
  */
 extern int            jtag_execute_queue(void);
 
+/* same as jtag_execute_queue() but does not clear the error flag */
+extern void jtag_execute_queue_noclear(void);
+
+/* this flag is set when an error occurs while executing the queue. cleared
+ * by jtag_execute_queue()
+ *
+ * this flag can also be set from application code if some error happens
+ * during processing that should be reported during jtag_execute_queue().
+ */
+extern int jtag_error;
+
+static __inline__ void jtag_set_error(int error)
+{
+       if ((error==ERROR_OK)||(jtag_error!=ERROR_OK))
+       {
+               /* keep first error */
+               return;
+       }
+       jtag_error=error;
+}
+
+
+
 /* can be implemented by hw+sw */
 extern int            interface_jtag_execute_queue(void);
 extern int            jtag_power_dropout(int* dropout);
 extern int            jtag_srst_asserted(int* srst_asserted);
 
 /* JTAG support functions */
-extern void           jtag_set_check_value(scan_field_t* field, u8* value, u8* mask, error_handler_t* in_error_handler);
+struct invalidstruct
+{
+
+};
+
+extern void           jtag_set_check_value(scan_field_t* field, u8* value, u8* mask, struct invalidstruct *obsolete);
+/* execute jtag queue and check value and use mask if mask is != NULL. invokes
+ * jtag_set_error() with any error. */
+extern void jtag_check_value_mask(scan_field_t *field, u8 *value, u8 *mask);
 extern enum scan_type jtag_scan_type(scan_command_t* cmd);
 extern int            jtag_scan_size(scan_command_t* cmd);
 extern int            jtag_read_buffer(u8* buffer, scan_command_t* cmd);