arm_adi_v5: fix mem_ap_read_buf_u32() JTAG nastiness..

Moved JTAG code out of transport-neutral file (arm_adi_v5.c) into
transport specific file (adi_v5_jtag.c).
Added ap_block_read to dap_ops interface (arm_adi_v5.h) to support
the move.

Change-Id: I796d3984f138aad052b97c77ac9c12ffd1158f74
Signed-off-by: mike brown <mike@theshedworks.org.uk>
Reviewed-on: http://openocd.zylin.com/1277
Tested-by: jenkins
Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
mike brown
2013-03-18 17:19:14 +00:00
committed by Spencer Oliver
parent 0875e64ddb
commit 2a8a89edcb
3 changed files with 65 additions and 50 deletions

View File

@@ -216,6 +216,9 @@ struct dap_ops {
/** AP register write. */
int (*queue_ap_write)(struct adiv5_dap *dap, unsigned reg,
uint32_t data);
/** AP read block. */
int (*queue_ap_read_block)(struct adiv5_dap *dap, unsigned reg,
uint32_t blocksize, uint8_t *buffer);
/** AP operation abort. */
int (*queue_ap_abort)(struct adiv5_dap *dap, uint8_t *ack);
@@ -321,6 +324,24 @@ static inline int dap_queue_ap_write(struct adiv5_dap *dap,
return dap->ops->queue_ap_write(dap, reg, data);
}
/**
* Queue an AP block read.
*
* @param dap The DAP used for reading.
* @param reg The number of the AP register being read.
* @param blocksize The number of the AP register being read.
* @param buffer Pointer saying where to store the data
* (in host endianness).
*
* @return ERROR_OK for success, else a fault code.
*/
static inline int dap_queue_ap_read_block(struct adiv5_dap *dap,
unsigned reg, unsigned blocksize, uint8_t *buffer)
{
assert(dap->ops != NULL);
return dap->ops->queue_ap_read_block(dap, reg, blocksize, buffer);
}
/**
* Queue an AP abort operation. The current AP transaction is aborted,
* including any update of the transaction counter. The AP is left in