summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrasko DRASKOVIC <drasko.draskovic@gmail.com>2011-04-04 15:33:04 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2011-04-05 08:21:29 +0200
commit719f9ecde32ab60bcb65913454a9340c5754cee4 (patch)
treeadcdaa11d563cc1623d2744adc94c81a1e3f69ea
parentbc9afcd4d1cb3fb09d7fae40eb355fa4987b9dec (diff)
downloadopenocd_libswd-719f9ecde32ab60bcb65913454a9340c5754cee4.tar.gz
openocd_libswd-719f9ecde32ab60bcb65913454a9340c5754cee4.tar.bz2
openocd_libswd-719f9ecde32ab60bcb65913454a9340c5754cee4.tar.xz
openocd_libswd-719f9ecde32ab60bcb65913454a9340c5754cee4.zip
Added mips_ejtag_drscan_32_out() for optimization.
-rw-r--r--src/target/mips32_pracc.c10
-rw-r--r--src/target/mips_ejtag.c15
-rw-r--r--src/target/mips_ejtag.h1
-rw-r--r--src/target/mips_m4k.c2
4 files changed, 22 insertions, 6 deletions
diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c
index ef132fe3..178f68e1 100644
--- a/src/target/mips32_pracc.c
+++ b/src/target/mips32_pracc.c
@@ -188,12 +188,12 @@ static int mips32_pracc_exec_read(struct mips32_pracc_context *ctx, uint32_t add
/* Send the data out */
mips_ejtag_set_instr(ctx->ejtag_info, EJTAG_INST_DATA);
- mips_ejtag_drscan_32(ctx->ejtag_info, &data);
+ mips_ejtag_drscan_32_out(ctx->ejtag_info, data);
/* Clear the access pending bit (let the processor eat!) */
ejtag_ctrl = ejtag_info->ejtag_ctrl & ~EJTAG_CTRL_PRACC;
mips_ejtag_set_instr(ctx->ejtag_info, EJTAG_INST_CONTROL);
- mips_ejtag_drscan_32(ctx->ejtag_info, &ejtag_ctrl);
+ mips_ejtag_drscan_32_out(ctx->ejtag_info, ejtag_ctrl);
return jtag_execute_queue();
}
@@ -213,7 +213,7 @@ static int mips32_pracc_exec_write(struct mips32_pracc_context *ctx, uint32_t ad
/* Clear access pending bit */
ejtag_ctrl = ejtag_info->ejtag_ctrl & ~EJTAG_CTRL_PRACC;
mips_ejtag_set_instr(ctx->ejtag_info, EJTAG_INST_CONTROL);
- mips_ejtag_drscan_32(ctx->ejtag_info, &ejtag_ctrl);
+ mips_ejtag_drscan_32_out(ctx->ejtag_info, ejtag_ctrl);
retval = jtag_execute_queue();
if (retval != ERROR_OK)
@@ -1026,12 +1026,12 @@ int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_are
return retval;
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_DATA);
- mips_ejtag_drscan_32(ejtag_info, &jmp_code[i]);
+ mips_ejtag_drscan_32_out(ejtag_info, jmp_code[i]);
/* Clear the access pending bit (let the processor eat!) */
ejtag_ctrl = ejtag_info->ejtag_ctrl & ~EJTAG_CTRL_PRACC;
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_CONTROL);
- mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl);
+ mips_ejtag_drscan_32_out(ejtag_info, ejtag_ctrl);
}
if ((retval = wait_for_pracc_rw(ejtag_info, &ejtag_ctrl)) != ERROR_OK)
diff --git a/src/target/mips_ejtag.c b/src/target/mips_ejtag.c
index 087be076..6229055d 100644
--- a/src/target/mips_ejtag.c
+++ b/src/target/mips_ejtag.c
@@ -121,6 +121,21 @@ int mips_ejtag_drscan_32(struct mips_ejtag *ejtag_info, uint32_t *data)
return ERROR_OK;
}
+void mips_ejtag_drscan_32_out(struct mips_ejtag *ejtag_info, uint32_t data)
+{
+ struct jtag_tap *tap;
+ tap = ejtag_info->tap;
+ assert(tap != NULL);
+
+ struct scan_field field;
+
+ field.num_bits = 32;
+ field.out_value = (uint8_t *)&data;
+ field.in_value = NULL;
+
+ jtag_add_dr_scan(tap, 1, &field, TAP_IDLE);
+}
+
int mips_ejtag_drscan_8(struct mips_ejtag *ejtag_info, uint32_t *data)
{
struct jtag_tap *tap;
diff --git a/src/target/mips_ejtag.h b/src/target/mips_ejtag.h
index aa890d2b..a6ed95a5 100644
--- a/src/target/mips_ejtag.h
+++ b/src/target/mips_ejtag.h
@@ -136,6 +136,7 @@ void mips_ejtag_set_instr(struct mips_ejtag *ejtag_info,
int mips_ejtag_enter_debug(struct mips_ejtag *ejtag_info);
int mips_ejtag_exit_debug(struct mips_ejtag *ejtag_info);
int mips_ejtag_get_idcode(struct mips_ejtag *ejtag_info, uint32_t *idcode);
+void mips_ejtag_drscan_32_out(struct mips_ejtag *ejtag_info, uint32_t data);
int mips_ejtag_drscan_32(struct mips_ejtag *ejtag_info, uint32_t *data);
void mips_ejtag_drscan_8_out(struct mips_ejtag *ejtag_info, uint8_t data);
int mips_ejtag_drscan_8(struct mips_ejtag *ejtag_info, uint32_t *data);
diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c
index 74d0d503..1166b874 100644
--- a/src/target/mips_m4k.c
+++ b/src/target/mips_m4k.c
@@ -274,7 +274,7 @@ static int mips_m4k_assert_reset(struct target *target)
uint32_t ejtag_ctrl = ejtag_info->ejtag_ctrl | EJTAG_CTRL_PRRST | EJTAG_CTRL_PERRST;
LOG_DEBUG("Using EJTAG reset (PRRST) to reset processor...");
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_CONTROL);
- mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl);
+ mips_ejtag_drscan_32_out(ejtag_info, ejtag_ctrl);
}
}