arm_adi_v5: Also clear sticky overrun bit on init

Some targets start up with the sticky overrun bit set. On such targets
we need to clear it in order to avoid subsequent incorrect reads.

Change-Id: I3e939a9e092de6fcea9494d3179a3386aa1701d2
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8420
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
Peter Collingbourne 2024-07-30 18:03:33 -07:00 committed by Antonio Borneo
parent d3f50ea914
commit 7eb9a48f2d
1 changed files with 5 additions and 4 deletions

View File

@ -795,11 +795,12 @@ int dap_dp_init(struct adiv5_dap *dap)
dap->dp_ctrl_stat = CDBGPWRUPREQ | CSYSPWRUPREQ;
/*
* This write operation clears the sticky error bit in jtag mode only and
* is ignored in swd mode. It also powers-up system and debug domains in
* both jtag and swd modes, if not done before.
* This write operation clears the sticky error and overrun bits in jtag
* mode only and is ignored in swd mode. It also powers-up system and
* debug domains in both jtag and swd modes, if not done before.
*/
retval = dap_queue_dp_write(dap, DP_CTRL_STAT, dap->dp_ctrl_stat | SSTICKYERR);
retval = dap_queue_dp_write(dap, DP_CTRL_STAT,
dap->dp_ctrl_stat | SSTICKYERR | SSTICKYORUN);
if (retval != ERROR_OK)
return retval;