From a185eaad9d2fd25e3e53398a235e08f07f360e74 Mon Sep 17 00:00:00 2001 From: Matthias Welwarsky Date: Fri, 11 Dec 2015 15:12:56 +0100 Subject: adi_v5_jtag: implement DAP WAIT support ADIv5 specifies that DP and AP accesses may generate a WAIT response when the hardware is not able to complete a request for various reasons in time before the next request is sent. Currently, the software treats a WAIT response as a fatal error and aborts operation on the DAP. This patch implements WAIT handling by keeping a journal of all outstanding and completed accesses, including their response status. At certain times (when dap_run() is called), the journal is inspected for WAIT responses and all discarded accesses are replayed to complete them. Special care is taken to not re-execute already successfully completed operations. Change-Id: I2790070388cf1ab2e8c9a042d74eb3ef776aa583 Signed-off-by: Matthias Welwarsky Reviewed-on: http://openocd.zylin.com/3166 Tested-by: jenkins Reviewed-by: Paul Fertser --- src/target/arm_adi_v5.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/target/arm_adi_v5.h') diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index fed25ec2..44d3962c 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -31,6 +31,7 @@ * resources accessed through a MEM-AP. */ +#include #include "arm_jtag.h" /* FIXME remove these JTAG-specific decls when mem_ap_read_buf_u32() @@ -206,6 +207,9 @@ struct adiv5_ap { struct adiv5_dap { const struct dap_ops *ops; + /* dap transaction list for WAIT support */ + struct list_head cmd_journal; + struct jtag_tap *tap; /* Control config */ uint32_t dp_ctrl_stat; -- cgit v1.2.3-18-g5258