Better fix for TAPs violating the JTAG spec for IR-Capture.
authordbrownell <dbrownell@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Wed, 7 Oct 2009 18:51:11 +0000 (18:51 +0000)
committerdbrownell <dbrownell@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Wed, 7 Oct 2009 18:51:11 +0000 (18:51 +0000)
Instead of just assuming all IDCODE-deprived TAPs violate the
JTAG spec (they don't!), just require TAPs with such problems
to be declared with proper ircapture/irmask values.  Example,
with mask and value of zero.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2823 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/jtag/core.c

index 0b752ea426037c58a8317a66b0e6fda210bf4b0a..e6bde518f61659cb9e8aef3f99174433b54ba9a2 100644 (file)
@@ -1108,22 +1108,24 @@ static int jtag_validate_ircapture(void)
                        break;
                }
 
-               if (tap->hasidcode)
-               {
-                       /* Validate the two LSBs, which must be 01 per JTAG spec.
-                        * REVISIT we might be able to verify some MSBs too, using
-                        * ircapture/irmask attributes.
-                        */
-                       val = buf_get_u32(ir_test, chain_pos, tap->ir_length);
-                       if ((val & 0x3) != 1) {
-                               LOG_ERROR("%s: IR capture error; saw 0x%0*x not 0x..1",
-                                               jtag_tap_name(tap),
-                                               (tap->ir_length + 7) / tap->ir_length,
-                                               val);
-
-                               retval = ERROR_JTAG_INIT_FAILED;
-                               goto done;
-                       }
+               /* Validate the two LSBs, which must be 01 per JTAG spec.
+                *
+                * Or ... more bits could be provided by TAP declaration.
+                * Plus, some taps (notably in i.MX series chips) violate
+                * this part of the JTAG spec, so their capture mask/value
+                * attributes might disable this test.
+                */
+               val = buf_get_u32(ir_test, chain_pos, tap->ir_length);
+               if ((val & tap->ir_capture_mask) != tap->ir_capture_value) {
+                       LOG_ERROR("%s: IR capture error; saw 0x%0*x not 0x%0*x",
+                                       jtag_tap_name(tap),
+                                       (tap->ir_length + 7) / tap->ir_length,
+                                       val,
+                                       (tap->ir_length + 7) / tap->ir_length,
+                                       tap->ir_capture_value);
+
+                       retval = ERROR_JTAG_INIT_FAILED;
+                       goto done;
                }
                LOG_DEBUG("%s: IR capture 0x%0*x", jtag_tap_name(tap),
                                (tap->ir_length + 7) / tap->ir_length, val);

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)