Handle unavailability when deasserting reset
This commit is contained in:
parent
84ed43ec3a
commit
55ae2534b3
|
@ -2979,7 +2979,9 @@ static int deassert_reset(struct target *target)
|
||||||
|
|
||||||
info->dmi_busy_delay = orig_dmi_busy_delay;
|
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->state = TARGET_HALTED;
|
||||||
target->debug_reason = DBG_REASON_DBGRQ;
|
target->debug_reason = DBG_REASON_DBGRQ;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -129,9 +129,11 @@ proc ocd_process_reset_inner { MODE } {
|
||||||
} else {
|
} else {
|
||||||
$t invoke-event examine-end
|
$t invoke-event examine-end
|
||||||
}
|
}
|
||||||
if { [$t curstate] == "unavailable" } {
|
}
|
||||||
continue
|
|
||||||
}
|
# no need to wait for a target that is unavailable anyway
|
||||||
|
if { [$t curstate] == "unavailable" } {
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
# Wait up to 1 second for target to halt. Why 1sec? Cause
|
# Wait up to 1 second for target to halt. Why 1sec? Cause
|
||||||
|
@ -149,7 +151,7 @@ proc ocd_process_reset_inner { MODE } {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if { $s != "halted" } {
|
if { $s != "halted" } {
|
||||||
return -code error [format "TARGET: %s - Not halted - Maybe unavailable %s" $t $s]
|
return -code error [format "TARGET: %s - Not halted (%s)" $t $s]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue