target/riscv: Correctly set target->state in deassert_reset (#750)
* target/riscv: Correctly set target->state in deassert_reset This bug didn't lead to problems, but it would with some upcoming changes. Change-Id: I552acbae9977150c4c9e573f8852033bc80fcebb Signed-off-by: Tim Newsome <tim@sifive.com> * Keep debug_reason in sync with state Co-authored-by: Jan Matyas <50193733+JanMatCodasip@users.noreply.github.com> Signed-off-by: Tim Newsome <tim@sifive.com> Signed-off-by: Tim Newsome <tim@sifive.com> Co-authored-by: Jan Matyas <50193733+JanMatCodasip@users.noreply.github.com>
This commit is contained in:
parent
fe5c7d7a35
commit
9eb07f258e
|
@ -2452,8 +2452,13 @@ static int deassert_reset(struct target *target)
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
target->state = TARGET_HALTED;
|
if (target->reset_halt) {
|
||||||
target->debug_reason = DBG_REASON_DBGRQ;
|
target->state = TARGET_HALTED;
|
||||||
|
target->debug_reason = DBG_REASON_DBGRQ;
|
||||||
|
} else {
|
||||||
|
target->state = TARGET_RUNNING;
|
||||||
|
target->debug_reason = DBG_REASON_NOTHALTED;
|
||||||
|
}
|
||||||
|
|
||||||
if (get_field(dmstatus, DM_DMSTATUS_ALLHAVERESET)) {
|
if (get_field(dmstatus, DM_DMSTATUS_ALLHAVERESET)) {
|
||||||
/* Ack reset. */
|
/* Ack reset. */
|
||||||
|
|
Loading…
Reference in New Issue