Skip to content

Commit 9675154

Browse files
committed
target/riscv: hard reset DTM if dmistat is busy
1 parent 6f84e90 commit 9675154

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/target/riscv/riscv-013.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,6 +2016,12 @@ static int examine(struct target *target)
20162016
return ERROR_FAIL;
20172017
}
20182018

2019+
if (get_field(dtmcontrol, DTM_DTMCS_DMISTAT) != DTM_DMI_OP_SUCCESS) {
2020+
if (dtmcs_scan(target->tap, DTM_DTMCS_DTMHARDRESET,
2021+
NULL /* discard result */) != ERROR_OK)
2022+
return ERROR_FAIL;
2023+
}
2024+
20192025
riscv013_info_t *info = get_info(target);
20202026

20212027
info->index = target->coreid;

0 commit comments

Comments
 (0)