aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSalvador Arroyo <sarroyofdez@yahoo.es>2013-02-23 22:53:35 +0100
committerSpencer Oliver <spen@spen-soft.co.uk>2013-04-02 15:13:06 +0000
commit2dde122b66b3bf1a4d3c2798fb4b369b66de9309 (patch)
tree11fd6fa710aae784019e77f56cd4023db9500b97 /src
parent1d040adb0dd838f4d49b87573ee912d5bc917886 (diff)
mips: mips32_pracc_fastdata_xfer() little modification
In this function after loading the handler code and the jump code there is a call to wait_for_pracc_rw() to verify that a pracc access is pending. Next the address is read to verify that the handler is running, the address should be at fastdata area. Next, another call is made to wait_for_pracc_rw(). This call is not needed, we now already that a pracc access is pending. Better we call this function before loading the end address to be sure it is loaded correctly. Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Change-Id: If311450ea634786fc28cf1a8e18ed24ce5257d20 Reviewed-on: http://openocd.zylin.com/1142 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/target/mips32_pracc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c
index 87e712bc..615cc3ff 100644
--- a/src/target/mips32_pracc.c
+++ b/src/target/mips32_pracc.c
@@ -944,6 +944,7 @@ int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_are
mips_ejtag_drscan_32_out(ejtag_info, ejtag_ctrl);
}
+ /* wait PrAcc pending bit for FASTDATA write */
retval = wait_for_pracc_rw(ejtag_info, &ejtag_ctrl);
if (retval != ERROR_OK)
return retval;
@@ -958,18 +959,18 @@ int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_are
if (address != MIPS32_PRACC_FASTDATA_AREA)
return ERROR_FAIL;
- /* wait PrAcc pending bit for FASTDATA write */
- retval = wait_for_pracc_rw(ejtag_info, &ejtag_ctrl);
- if (retval != ERROR_OK)
- return retval;
-
/* Send the load start address */
val = addr;
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_FASTDATA);
mips_ejtag_fastdata_scan(ejtag_info, 1, &val);
+ retval = wait_for_pracc_rw(ejtag_info, &ejtag_ctrl);
+ if (retval != ERROR_OK)
+ return retval;
+
/* Send the load end address */
val = addr + (count - 1) * 4;
+ mips_ejtag_set_instr(ejtag_info, EJTAG_INST_FASTDATA);
mips_ejtag_fastdata_scan(ejtag_info, 1, &val);
for (i = 0; i < count; i++) {