summaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorTomek CEDRO <cederom@tlen.pl>2012-02-09 18:36:39 +0100
committerTomek CEDRO <cederom@tlen.pl>2012-02-09 18:36:39 +0100
commit4dbc039a5fb25b55b14b01fc1ebdf5feb8cbc2c3 (patch)
treed44bfb76d46d32fe35fbd6b2a993f19104982400 /src/transport
parent0b12d8ce85e24b769893b020829cb2eda2b5cd6d (diff)
downloadopenocd_libswd-4dbc039a5fb25b55b14b01fc1ebdf5feb8cbc2c3.tar.gz
openocd_libswd-4dbc039a5fb25b55b14b01fc1ebdf5feb8cbc2c3.tar.bz2
openocd_libswd-4dbc039a5fb25b55b14b01fc1ebdf5feb8cbc2c3.tar.xz
openocd_libswd-4dbc039a5fb25b55b14b01fc1ebdf5feb8cbc2c3.zip
EXPERIMENTAL - many read operations can be enqueued and flushed at once. Target read functions should now work with double pointers in order to return data on flush and not produce flush on read.
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/swd_core.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/transport/swd_core.c b/src/transport/swd_core.c
index 544e6277..f4ae8bea 100644
--- a/src/transport/swd_core.c
+++ b/src/transport/swd_core.c
@@ -53,7 +53,7 @@ extern struct jtag_interface *jtag_interface;
int oocd_swd_queue_idcode_read(struct adiv5_dap *dap, uint8_t *ack, uint32_t *data){
int retval;
- retval=swd_dp_read_idcode(dap->ctx, SWD_OPERATION_EXECUTE, (int**) &data);
+ retval=swd_dp_read_idcode(dap->ctx, SWD_OPERATION_ENQUEUE, (int**) &data);
if (retval<0) {
LOG_ERROR("swd_dp_read_idcode() error: %s ", swd_error_string(retval));
return ERROR_FAIL;
@@ -62,12 +62,12 @@ int oocd_swd_queue_idcode_read(struct adiv5_dap *dap, uint8_t *ack, uint32_t *da
int oocd_swd_queue_dp_read(struct adiv5_dap *dap, unsigned reg, uint32_t *data){
int retval, *rdata;
- retval=swd_dp_read((swd_ctx_t *)dap->ctx, SWD_OPERATION_EXECUTE, reg, &rdata);
+ retval=swd_dp_read((swd_ctx_t *)dap->ctx, SWD_OPERATION_ENQUEUE, reg, &rdata);
if (retval<0){
LOG_ERROR("swd_dp_read() error: %s ", swd_error_string(retval));
return ERROR_FAIL;
}
- if (data!=NULL) *data=(uint32_t)*rdata;
+ if (data!=NULL) data=(uint32_t*)rdata;
return ERROR_OK;
}
@@ -83,12 +83,12 @@ int oocd_swd_queue_dp_write(struct adiv5_dap *dap, unsigned reg, uint32_t data){
int oocd_swd_queue_ap_read(struct adiv5_dap *dap, unsigned reg, uint32_t *data){
int retval, *rdata;
- retval=swd_ap_read((swd_ctx_t *)dap->ctx, SWD_OPERATION_EXECUTE, (char) reg, &rdata);
+ retval=swd_ap_read((swd_ctx_t *)dap->ctx, SWD_OPERATION_ENQUEUE, (char) reg, &rdata);
if (retval<0){
LOG_ERROR("swd_ap_read() error: %s ", swd_error_string(retval));
return ERROR_FAIL;
}
- if (data!=NULL) *data=*rdata;
+ if (data!=NULL) data=(uint32_t*)rdata;
return ERROR_OK;
}
@@ -106,7 +106,7 @@ int oocd_swd_queue_ap_abort(struct adiv5_dap *dap, uint8_t *ack){
int retval;
int abort_flags = SWD_DP_ABORT_ORUNERRCLR | SWD_DP_ABORT_WDERRCLR | SWD_DP_ABORT_STKERRCLR \
| SWD_DP_ABORT_STKCMPCLR | SWD_DP_ABORT_DAPABORT;
- retval=swd_dp_write((swd_ctx_t *)dap->ctx, SWD_OPERATION_EXECUTE, SWD_DP_ABORT_ADDR, &abort_flags);
+ retval=swd_dp_write((swd_ctx_t *)dap->ctx, SWD_OPERATION_ENQUEUE, SWD_DP_ABORT_ADDR, &abort_flags);
if (retval<0){
LOG_ERROR("swd_dp_write(ABORT) error: %s ", swd_error_string(retval));
return ERROR_FAIL;