- added str912 test example, and test result
[openocd.git] / src / jtag / bitq.c
index 9d1f43dc90d48b5090059916ca419afa24cc0cc9..7c47b8e8cd3e8aa636fdddf470af7e755fadc068 100644 (file)
@@ -50,7 +50,7 @@ unsigned long bitq_in_bufsize=32; /* min. buffer size */
  * input queue processing does not use jtag_read_buffer() to avoid unnecessary overhead
  * also the buffer for incomming data is reallocated only if necessary
  * no parameters, makes use of stored state information
- */ 
+ */
 void bitq_in_proc(void)
 {
        /* static information preserved between calls to increase performance */
@@ -60,7 +60,7 @@ void bitq_in_proc(void)
 
        scan_field_t *field;
        int tdo;
-       
+
        /* loop through the queue */
        while (bitq_in_state.cmd) {
                /* only JTAG_SCAN command may return data */
@@ -69,7 +69,7 @@ void bitq_in_proc(void)
                        while (bitq_in_state.field_idx<bitq_in_state.cmd->cmd.scan->num_fields) {
 
                                field=&bitq_in_state.cmd->cmd.scan->fields[bitq_in_state.field_idx];
-                               if (field->in_check_value || field->in_value || field->in_handler) {
+                               if ( field->in_value || field->in_handler) {
 
                                        if (bitq_in_state.bit_pos==0) {
                                                /* initialize field scanning */
@@ -88,10 +88,10 @@ void bitq_in_proc(void)
                                                                /* double the buffer size until it fits */
                                                                while (field->num_bits>bitq_in_bufsize*8) bitq_in_bufsize*=2;
                                                        }
-                                                       /* if necessary, allocate buffer and check for malloc error */ 
+                                                       /* if necessary, allocate buffer and check for malloc error */
                                                        if (bitq_in_buffer==NULL && (bitq_in_buffer=malloc(bitq_in_bufsize))==NULL) {
                                                                ERROR("malloc error");
-                                                               exit(-1);                
+                                                               exit(-1);
                                                        }
                                                        in_buff=(void *)bitq_in_buffer;
                                                }
@@ -114,34 +114,14 @@ void bitq_in_proc(void)
                                                else in_mask<<=1;
                                                bitq_in_state.bit_pos++;
                                        }
-                                       
-                                       if (field->in_check_value) {
-                                               /* match scanned in value */
-                                               for (in_idx=0; in_idx*8<field->num_bits; in_idx++) {
-                                                       if (field->in_check_mask) in_mask=field->in_check_mask[in_idx];
-                                                       else in_mask=0xff;
-                                                       if (field->num_bits-in_idx*8<8) in_mask>>=8-(field->num_bits-in_idx*8);
-                                                       if (field->in_check_value[in_idx]&in_mask!=in_buff[in_idx]&in_mask) {
-                                                               char *captured_char = buf_to_str(in_buff, (field->num_bits > 64) ? 64 : field->num_bits, 16);
-                                                               char *in_check_value_char = buf_to_str(field->in_check_value, (field->num_bits > 64) ? 64 : field->num_bits, 16);
-                                                               char *in_check_mask_char = buf_to_str(field->in_check_mask, (field->num_bits > 64) ? 64 : field->num_bits, 16);
-                                                               /* TODO: error reporting */
-                                                               WARNING("value captured during scan didn't pass the requested check: captured: 0x%s check_value: 0x%s check_mask: 0x%s", captured_char, in_check_value_char, in_check_mask_char);
-                                                               bitq_in_state.status=ERROR_JTAG_QUEUE_FAILED;
-                                                               free(captured_char);
-                                                               free(in_check_value_char);
-                                                               free(in_check_mask_char);
-                                                               break; /* leave the comparison loop upon first mismatch */                                              
-                                                       }
-                                               }
-                                       }
+
 
                                        if (field->in_handler && bitq_in_state.status==ERROR_OK) {
-                                               bitq_in_state.status=(*field->in_handler)(in_buff, field->in_handler_priv);
+                                               bitq_in_state.status=(*field->in_handler)(in_buff, field->in_handler_priv, field);
                                        }
 
                                }
-                               
+
                                bitq_in_state.field_idx++; /* advance to next field */
                                bitq_in_state.bit_pos=0; /* start next field from the first bit */
                        }
@@ -157,7 +137,7 @@ void bitq_in_proc(void)
 void bitq_io(int tms, int tdi, int tdo_req)
 {
        bitq_interface->out(tms, tdi, tdo_req);
-       /* check and process the input queue */ 
+       /* check and process the input queue */
        if (bitq_interface->in_rdy()) bitq_in_proc();
 }
 
@@ -182,7 +162,7 @@ void bitq_state_move(enum tap_state new_state)
                ERROR("TAP move from or to unstable state");
                exit(-1);
        }
-       
+
        tms_scan=TAP_MOVE(cur_state, new_state);
 
        for (i=0; i<7; i++) {
@@ -236,8 +216,8 @@ void bitq_scan_field(scan_field_t *field, int pause)
 
        u8 *out_ptr;
        u8 out_mask;
-       
-       if (field->in_check_value || field->in_value || field->in_handler) tdo_req=1;
+
+       if ( field->in_value || field->in_handler) tdo_req=1;
        else tdo_req=0;
 
        if (field->out_value==NULL) {
@@ -285,7 +265,7 @@ void bitq_scan(scan_command_t *cmd)
 int bitq_execute_queue(void)
 {
        jtag_command_t *cmd = jtag_command_queue; /* currently processed command */
-       
+
        bitq_in_state.cmd = jtag_command_queue;
        bitq_in_state.field_idx = 0;
        bitq_in_state.bit_pos = 0;

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)