Merge remote-tracking branch 'origin/reset-unexpected-check' into riscv-compliance

riscv-compliance-dev
Megan Wachs 2018-05-16 22:29:45 -07:00
commit 9a5a5c2dc9
1 changed files with 0 additions and 8 deletions

View File

@ -1648,15 +1648,12 @@ static int deassert_reset(struct target *target)
char *operation; char *operation;
uint32_t expected_field; uint32_t expected_field;
uint32_t unexpected_field;
if (target->reset_halt) { if (target->reset_halt) {
operation = "halt"; operation = "halt";
expected_field = DMI_DMSTATUS_ALLHALTED; expected_field = DMI_DMSTATUS_ALLHALTED;
unexpected_field = DMI_DMSTATUS_ANYRUNNING;
} else { } else {
operation = "run"; operation = "run";
expected_field = DMI_DMSTATUS_ALLRUNNING; expected_field = DMI_DMSTATUS_ALLRUNNING;
unexpected_field = DMI_DMSTATUS_ANYHALTED;
} }
LOG_DEBUG("Waiting for hart %d to %s out of reset.", index, operation); LOG_DEBUG("Waiting for hart %d to %s out of reset.", index, operation);
while (1) { while (1) {
@ -1669,11 +1666,6 @@ static int deassert_reset(struct target *target)
index, riscv_reset_timeout_sec); index, riscv_reset_timeout_sec);
if (result != ERROR_OK) if (result != ERROR_OK)
return result; return result;
if (get_field(dmstatus, unexpected_field)) {
LOG_ERROR("Unexpected hart %d status during reset. dmstatus=0x%x",
index, dmstatus);
return ERROR_FAIL;
}
if (get_field(dmstatus, expected_field)) if (get_field(dmstatus, expected_field))
break; break;
if (time(NULL) - start > riscv_reset_timeout_sec) { if (time(NULL) - start > riscv_reset_timeout_sec) {