summaryrefslogtreecommitdiff
path: root/src/target/mips_m4k.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-10-14 06:21:17 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-10-14 06:21:17 +0000
commit539527ab74f73bfd27d055d7ca20d30176be5e17 (patch)
tree0cbc6b696813a313807a63f3d0810d760ac339b4 /src/target/mips_m4k.c
parent3600e7c6e04117b192e428adb7ff7d9515c982f5 (diff)
downloadopenocd_libswd-539527ab74f73bfd27d055d7ca20d30176be5e17.tar.gz
openocd_libswd-539527ab74f73bfd27d055d7ca20d30176be5e17.tar.bz2
openocd_libswd-539527ab74f73bfd27d055d7ca20d30176be5e17.tar.xz
openocd_libswd-539527ab74f73bfd27d055d7ca20d30176be5e17.zip
John McCarthy <jgmcc@magma.ca> cleans up the usage of the
ejtag_info->ejtag_ctrl variable. It was being overwritten by the value read back from the EJTAG CONTROL register. Because of the way this register works you do not want to use the value returned to write the register, you always want to write the bits explicitly. The second patch just reduces the DMA retries to 0 in anticipation of removing the retry code altogether. git-svn-id: svn://svn.berlios.de/openocd/trunk@1049 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/mips_m4k.c')
-rw-r--r--src/target/mips_m4k.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c
index 3508ebd1..be7f59ec 100644
--- a/src/target/mips_m4k.c
+++ b/src/target/mips_m4k.c
@@ -132,13 +132,14 @@ int mips_m4k_poll(target_t *target)
int retval;
mips32_common_t *mips32 = target->arch_info;
mips_ejtag_t *ejtag_info = &mips32->ejtag_info;
+ u32 ejtag_ctrl = ejtag_info->ejtag_ctrl;
/* read ejtag control reg */
jtag_add_end_state(TAP_RTI);
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_CONTROL, NULL);
- mips_ejtag_drscan_32(ejtag_info, &ejtag_info->ejtag_ctrl);
+ mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl);
- if (ejtag_info->ejtag_ctrl & EJTAG_CTRL_BRKST)
+ if (ejtag_ctrl & EJTAG_CTRL_BRKST)
{
if ((target->state == TARGET_RUNNING) || (target->state == TARGET_RESET))
{
@@ -167,19 +168,19 @@ int mips_m4k_poll(target_t *target)
target->state = TARGET_RUNNING;
}
- if (ejtag_info->ejtag_ctrl & EJTAG_CTRL_ROCC)
+ if (ejtag_ctrl & EJTAG_CTRL_ROCC)
{
/* we have detected a reset, clear flag
* otherwise ejtag will not work */
jtag_add_end_state(TAP_RTI);
- ejtag_info->ejtag_ctrl &= ~EJTAG_CTRL_ROCC;
+ ejtag_ctrl = ejtag_info->ejtag_ctrl & ~EJTAG_CTRL_ROCC;
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_CONTROL, NULL);
- mips_ejtag_drscan_32(ejtag_info, &ejtag_info->ejtag_ctrl);
+ mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl);
LOG_DEBUG("Reset Detected");
}
-// LOG_DEBUG("ctrl=0x%08X", ejtag_info->ejtag_ctrl);
+// LOG_DEBUG("ctrl=0x%08X", ejtag_ctrl);
return ERROR_OK;
}