Replace internal knowledge in jtag3.c by a public API

In certain situations (CRC failure, device locked), that JTAG3
read functions need to return an indication to the caller that
it is OK to proceed, and allow erasing the device anyway.

Historically, the JTAG3 code passed the respective protocol
errors directly (and unexplained) up to the caller, leaving
the decision to the caller how to handle the situation.

Replace that by a more common return value API. New code should
prefer this API instead of any hardcoded return values.
This commit is contained in:
Joerg Wunsch
2022-06-15 23:32:22 +02:00
parent cb114233ef
commit 3082630430
5 changed files with 40 additions and 19 deletions

View File

@@ -145,6 +145,7 @@
# define RSP3_FAIL_UNSUPP_MEMORY 0x34 /* unsupported memory type */
# define RSP3_FAIL_WRONG_LENGTH 0x35 /* wrong lenth for mem access */
# define RSP3_FAIL_OCD_LOCKED 0x44 /* device is locked */
# define RSP3_FAIL_CRC_FAILURE 0x47 /* CRC failure in device */
# define RSP3_FAIL_NOT_UNDERSTOOD 0x91
/* ICE events */