diff options
author | Spencer Oliver <spen@spen-soft.co.uk> | 2012-02-21 10:13:21 +0000 |
---|---|---|
committer | Andreas Fritiofson <andreas.fritiofson@gmail.com> | 2012-02-26 01:14:39 +0000 |
commit | 5793056d96fd88845cde0d107c002a5fce413909 (patch) | |
tree | 1baf2d9979ea3305d123f3de5cffbd7731cf1503 | |
parent | d431af34fe0a9695397fb76536a4ac2dbdac126f (diff) | |
download | riscv-openocd-5793056d96fd88845cde0d107c002a5fce413909.zip riscv-openocd-5793056d96fd88845cde0d107c002a5fce413909.tar.gz riscv-openocd-5793056d96fd88845cde0d107c002a5fce413909.tar.bz2 |
jtag: use correct tap -ignore-version mask
when -ignore-version is used we should mask of the upper 4bits not 8bits.
Change-Id: I9ffe24c2aeeb414677357a647609fdf018890194
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/473
Tested-by: jenkins
-rw-r--r-- | doc/openocd.texi | 2 | ||||
-rw-r--r-- | src/jtag/core.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/doc/openocd.texi b/doc/openocd.texi index 1aaac58..323136f 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3369,7 +3369,7 @@ hardware to find these values. option. When vendors put out multiple versions of a chip, or use the same JTAG-level ID for several largely-compatible chips, it may be more practical to ignore the version field than to update config files to handle all of -the various chip IDs. +the various chip IDs. The version field is defined as bit 28-31 of the IDCODE. @item @code{-ircapture} @var{NUMBER} @*The bit pattern loaded by the TAP into the JTAG shift register on entry to the @sc{ircapture} state, such as 0x01. diff --git a/src/jtag/core.c b/src/jtag/core.c index 6de168e..a36345b 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -958,8 +958,8 @@ static bool jtag_examine_chain_match_tap(const struct jtag_tap *tap) if (0 == tap->expected_ids_cnt && !idcode) return true; - /* optionally ignore the JTAG version field */ - uint32_t mask = tap->ignore_version ? ~(0xff << 24) : ~0; + /* optionally ignore the JTAG version field - bits 28-31 of IDCODE */ + uint32_t mask = tap->ignore_version ? ~(0xf << 28) : ~0; idcode &= mask; |