summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordbrownell <dbrownell@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-10-07 18:51:11 +0000
committerdbrownell <dbrownell@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-10-07 18:51:11 +0000
commit246ff4f6019ed59fe47295b3753728b3e4c0dc40 (patch)
tree531c138afc77d3ca8e0406edab66bde966f566e0 /src
parent7035b37e71c8c8805a2148c7c454537b903b0d51 (diff)
downloadopenocd+libswd-246ff4f6019ed59fe47295b3753728b3e4c0dc40.tar.gz
openocd+libswd-246ff4f6019ed59fe47295b3753728b3e4c0dc40.tar.bz2
openocd+libswd-246ff4f6019ed59fe47295b3753728b3e4c0dc40.tar.xz
openocd+libswd-246ff4f6019ed59fe47295b3753728b3e4c0dc40.zip
Better fix for TAPs violating the JTAG spec for IR-Capture.
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
Diffstat (limited to 'src')
-rw-r--r--src/jtag/core.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c
index 0b752ea4..e6bde518 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -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);