aboutsummaryrefslogtreecommitdiff
path: root/src/target/arm_adi_v5.h
diff options
context:
space:
mode:
authorMatthias Welwarsky <matthias@welwarsky.de>2015-12-28 22:33:51 +0100
committerPaul Fertser <fercerpav@gmail.com>2016-01-22 13:00:27 +0000
commit5373085b4d7ab600d0325634f3adc846f92169af (patch)
tree574b1b26523b99812b87969749bfad3621df0bf4 /src/target/arm_adi_v5.h
parenta185eaad9d2fd25e3e53398a235e08f07f360e74 (diff)
downloadriscv-openocd-5373085b4d7ab600d0325634f3adc846f92169af.zip
riscv-openocd-5373085b4d7ab600d0325634f3adc846f92169af.tar.gz
riscv-openocd-5373085b4d7ab600d0325634f3adc846f92169af.tar.bz2
adiv5: introduce optional dap_sync() function
dap_sync() executes all commands in the JTAG queue and then checks if a WAIT condition happened inside the last batch. If yes, a recovery is invoked. If not, processing continues without checking for errors. This function should be called in long AP read or writes, e.g. while uploading a new application binary, at intermediate points within the transfer where the cost of flushing the JTAG queue and checking the journal doesn't affect performance too much. Change-Id: I99eeaf47cdf951e15e589a04e74b90b5ce911386 Signed-off-by: Matthias Welwarsky <matthias@welwarsky.de> Reviewed-on: http://openocd.zylin.com/3181 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Diffstat (limited to 'src/target/arm_adi_v5.h')
-rw-r--r--src/target/arm_adi_v5.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h
index 44d3962..f001d6a 100644
--- a/src/target/arm_adi_v5.h
+++ b/src/target/arm_adi_v5.h
@@ -274,6 +274,10 @@ struct dap_ops {
/** Executes all queued DAP operations. */
int (*run)(struct adiv5_dap *dap);
+
+ /** Executes all queued DAP operations but doesn't check
+ * sticky error conditions */
+ int (*sync)(struct adiv5_dap *dap);
};
/*
@@ -397,6 +401,14 @@ static inline int dap_run(struct adiv5_dap *dap)
return dap->ops->run(dap);
}
+static inline int dap_sync(struct adiv5_dap *dap)
+{
+ assert(dap->ops != NULL);
+ if (dap->ops->sync)
+ return dap->ops->sync(dap);
+ return ERROR_OK;
+}
+
static inline int dap_dp_read_atomic(struct adiv5_dap *dap, unsigned reg,
uint32_t *value)
{