summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/openocd.texi8
-rw-r--r--src/jtag/core.c10
2 files changed, 12 insertions, 6 deletions
diff --git a/doc/openocd.texi b/doc/openocd.texi
index 716c4523..d80ef492 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -1253,7 +1253,7 @@ to source such a config file twice, with different
values for @code{CHIPNAME}, so
it adds a different TAP each time.
-If there are one or more nonzero @option{-expected-id} values,
+If there are nonzero @option{-expected-id} values,
OpenOCD attempts to verify the actual tap id against those values.
It will issue error messages if there is mismatch, which
can help to pinpoint problems in OpenOCD configurations.
@@ -2373,11 +2373,13 @@ You may use @code{-enable} to highlight the default state
(the TAP is linked in).
@xref{Enabling and Disabling TAPs}.
@item @code{-expected-id} @var{number}
-@*A non-zero value represents the expected 32-bit IDCODE
-found when the JTAG chain is examined.
+@*A non-zero @var{number} represents a 32-bit IDCODE
+which you expect to find when the scan chain is examined.
These codes are not required by all JTAG devices.
@emph{Repeat the option} as many times as required if more than one
ID code could appear (for example, multiple versions).
+Specify @var{number} as zero to suppress warnings about IDCODE
+values that were found but not included in the list.
@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 78f67db3..056fa990 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -959,10 +959,14 @@ static bool jtag_examine_chain_match_tap(const struct jtag_tap_s *tap)
{
if (tap->idcode == tap->expected_ids[ii])
return true;
+
+ /* treat "-expected-id 0" as a "don't-warn" wildcard */
+ if (0 == tap->expected_ids[ii])
+ return true;
}
- /* If none of the expected ids matched, log an error */
- jtag_examine_chain_display(LOG_LVL_ERROR, "UNEXPECTED",
+ /* If none of the expected ids matched, warn */
+ jtag_examine_chain_display(LOG_LVL_WARNING, "UNEXPECTED",
tap->dotted_name, tap->idcode);
for (ii = 0; ii < tap->expected_ids_cnt; ii++)
{
@@ -1025,7 +1029,7 @@ static int jtag_examine_chain(void)
}
tap->idcode = idcode;
- // ensure the TAP ID does matches what was expected
+ /* ensure the TAP ID matches what was expected */
if (!jtag_examine_chain_match_tap(tap))
return ERROR_JTAG_INIT_FAILED;
}