backed out changes from 483.
[openocd.git] / src / jtag / jtag.c
index 73acb6a09ecbb47a7658e77fedb5e0d7c3788ab2..a28250ffa14d291b79ffe726de30a2f1fb6855d6 100644 (file)
@@ -625,13 +625,14 @@ int MINIDRIVER(interface_jtag_add_dr_scan)(int num_fields, scan_field_t *fields,
                }
                if (!found)
                {
+#ifdef _DEBUG_JTAG_IO_
                        /* if a device isn't listed, the BYPASS register should be selected */
                        if (!jtag_get_device(i)->bypass)
                        {
                                ERROR("BUG: no scan data for a device not in BYPASS");
                                exit(-1);
                        }
-       
+#endif 
                        /* program the scan field to 1 bit length, and ignore it's value */
                        (*last_cmd)->cmd.scan->fields[field_count].num_bits = 1;
                        (*last_cmd)->cmd.scan->fields[field_count].out_value = NULL;
@@ -644,11 +645,14 @@ int MINIDRIVER(interface_jtag_add_dr_scan)(int num_fields, scan_field_t *fields,
                }
                else
                {
+#ifdef _DEBUG_JTAG_IO_
                        /* if a device is listed, the BYPASS register must not be selected */
                        if (jtag_get_device(i)->bypass)
                        {
-                               WARNING("scan data for a device in BYPASS");
+                               ERROR("BUG: scan data for a device in BYPASS");
+                               exit(-1);
                        }
+#endif
                }
        }
        return ERROR_OK;
@@ -699,13 +703,13 @@ void MINIDRIVER(interface_jtag_add_dr_out)(int device_num,
                        /* if a device is listed, the BYPASS register must not be selected */
                        if (jtag_get_device(i)->bypass)
                        {
-                               ERROR("scan data for a device in BYPASS");
+                               ERROR("BUG: scan data for a device in BYPASS");
                                exit(-1);
                        }
 #endif
                        for (j = 0; j < num_fields; j++)
                        {
-                               char out_value[4];
+                               u8 out_value[4];
                                scan_size = num_bits[j];
                                buf_set_u32(out_value, 0, scan_size, value[j]);
                                (*last_cmd)->cmd.scan->fields[field_count].num_bits = scan_size;
@@ -860,6 +864,20 @@ int jtag_add_pathmove(int num_states, enum tap_state *path)
        if (cmd_queue_end_state == TAP_TLR)
                jtag_call_event_callbacks(JTAG_TRST_ASSERTED);
        
+
+       enum tap_state cur_state=cmd_queue_cur_state;
+       int i;
+       for (i=0; i<num_states; i++)
+       {
+               if ((tap_transitions[cur_state].low != path[i])&&
+                               (tap_transitions[cur_state].high != path[i]))
+               {
+                       ERROR("BUG: %s -> %s isn't a valid TAP transition", tap_state_strings[cur_state], tap_state_strings[path[i]]);
+                       exit(-1);
+               }
+               cur_state = path[i];
+       }
+       
        cmd_queue_cur_state = path[num_states - 1];
 
        return interface_jtag_add_pathmove(num_states, path);
@@ -1543,7 +1561,7 @@ int jtag_init(struct command_context_s *cmd_ctx)
        {
                ERROR("trying to validate configured JTAG chain anyway...");
        }
-       
+
        while (jtag_validate_chain() != ERROR_OK)
        {
                validate_tries++;
@@ -1760,12 +1778,11 @@ int handle_jtag_speed_command(struct command_context_s *cmd_ctx, char *cmd, char
 
        if (argc > 0)
        {
+               jtag_speed = strtoul(args[0], NULL, 0);
                /* this command can be called during CONFIG, 
                 * in which case jtag isn't initialized */
                if (jtag)
-                       jtag->speed(strtoul(args[0], NULL, 0));
-               else
-                       jtag_speed = strtoul(args[0], NULL, 0);
+                       jtag->speed(jtag_speed);
        }
 
        return ERROR_OK;

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)