diff options
Diffstat (limited to 'src/target/riscv/riscv-013.c')
-rw-r--r-- | src/target/riscv/riscv-013.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 7a94bc7..44826ef 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -2979,7 +2979,9 @@ static int deassert_reset(struct target *target) info->dmi_busy_delay = orig_dmi_busy_delay; - if (target->reset_halt) { + if (get_field(dmstatus, DM_DMSTATUS_ALLUNAVAIL)) { + target->state = TARGET_UNAVAILABLE; + } else if (target->reset_halt) { target->state = TARGET_HALTED; target->debug_reason = DBG_REASON_DBGRQ; } else { |