aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDrasko DRASKOVIC <drasko.draskovic@gmail.com>2012-03-12 22:10:24 +0100
committerSpencer Oliver <spen@spen-soft.co.uk>2012-03-14 20:31:04 +0000
commit8e198e94712f8e677faffb8e0e3e9e590bae0161 (patch)
tree90ac04702cecd1981d9bea04d9ff2bb520f47c1c /src
parent35e7377160f75761ddab00c2a8e06d5cccf8f729 (diff)
downloadriscv-openocd-8e198e94712f8e677faffb8e0e3e9e590bae0161.zip
riscv-openocd-8e198e94712f8e677faffb8e0e3e9e590bae0161.tar.gz
riscv-openocd-8e198e94712f8e677faffb8e0e3e9e590bae0161.tar.bz2
mips: Forced to running state to enable (subsequent) target halt.
Change-Id: I9aff8fb3ac703b50194088dd4e68cec8f9bb2ada Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> Reviewed-on: http://openocd.zylin.com/513 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/target/mips_m4k.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c
index 623d55e..c64d5cf 100644
--- a/src/target/mips_m4k.c
+++ b/src/target/mips_m4k.c
@@ -143,6 +143,17 @@ static int mips_m4k_poll(struct target *target)
/* check for processor halted */
if (ejtag_ctrl & EJTAG_CTRL_BRKST) {
+ if (target->state == TARGET_UNKNOWN) {
+ LOG_DEBUG("EJTAG_CTRL_BRKST already set during server startup.");
+
+ /* OpenOCD was was probably started on the board with EJTAG_CTRL_BRKST already set
+ * (maybe put on by HALT-ing the board in the previous session).
+ *
+ * Force target to RUNNING state to enable debug entry for this session.
+ */
+ target->state = TARGET_RUNNING;
+ }
+
if ((target->state == TARGET_RUNNING) || (target->state == TARGET_RESET)) {
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_NORMALBOOT);