From 441ea95f693316052f04486b927abb2b152ca547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Mon, 19 Jul 2010 14:42:54 +0200 Subject: [PATCH] adi_jtag_ error propagation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Øyvind Harboe --- src/target/adi_v5_jtag.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/target/adi_v5_jtag.c b/src/target/adi_v5_jtag.c index 185bd5437..8731a1a09 100644 --- a/src/target/adi_v5_jtag.c +++ b/src/target/adi_v5_jtag.c @@ -211,8 +211,10 @@ static int jtagdp_transaction_endcheck(struct adiv5_dap *dap) /* Post CTRL/STAT read; discard any previous posted read value * but collect its ACK status. */ - adi_jtag_scan_inout_check_u32(dap, JTAG_DP_DPACC, + retval = adi_jtag_scan_inout_check_u32(dap, JTAG_DP_DPACC, DP_CTRL_STAT, DPAP_READ, 0, &ctrlstat); + if (retval != ERROR_OK) + return retval; if ((retval = jtag_execute_queue()) != ERROR_OK) return retval; @@ -246,8 +248,10 @@ static int jtagdp_transaction_endcheck(struct adiv5_dap *dap) return ERROR_JTAG_DEVICE_ERROR; } - adi_jtag_scan_inout_check_u32(dap, JTAG_DP_DPACC, + retval = adi_jtag_scan_inout_check_u32(dap, JTAG_DP_DPACC, DP_CTRL_STAT, DPAP_READ, 0, &ctrlstat); + if (retval != ERROR_OK) + return retval; if ((retval = dap_run(dap)) != ERROR_OK) return retval; dap->ack = dap->ack & 0x7; @@ -292,12 +296,16 @@ static int jtagdp_transaction_endcheck(struct adiv5_dap *dap) LOG_ERROR("JTAG-DP STICKY ERROR"); /* Clear Sticky Error Bits */ - adi_jtag_scan_inout_check_u32(dap, JTAG_DP_DPACC, + retval = adi_jtag_scan_inout_check_u32(dap, JTAG_DP_DPACC, DP_CTRL_STAT, DPAP_WRITE, dap->dp_ctrl_stat | SSTICKYORUN | SSTICKYERR, NULL); - adi_jtag_scan_inout_check_u32(dap, JTAG_DP_DPACC, + if (retval != ERROR_OK) + return retval; + retval = adi_jtag_scan_inout_check_u32(dap, JTAG_DP_DPACC, DP_CTRL_STAT, DPAP_READ, 0, &ctrlstat); + if (retval != ERROR_OK) + return retval; if ((retval = dap_run(dap)) != ERROR_OK) return retval;