DMI read before asserting ndmreset/haltreq.

In case the target needs a moment to recover from the tap/system reset
that might have been performed earlier.

Change-Id: Ifb899098b37d30ebd9024ebc309abbe53bedd906
Signed-off-by: Tim Newsome <tim@sifive.com>
This commit is contained in:
Tim Newsome 2023-09-22 09:46:00 -07:00
parent 67c2835997
commit b465ef9734
2 changed files with 8 additions and 0 deletions

View File

@ -197,6 +197,8 @@ static int ftdi_set_signal(const struct signal *s, char value)
bool data;
bool oe;
LOG_DEBUG_IO("set signal '%s' to '%c'", s->name, value);
if (s->data_mask == 0 && s->oe_mask == 0) {
LOG_ERROR("interface doesn't provide signal '%s'", s->name);
return ERROR_FAIL;

View File

@ -2814,6 +2814,12 @@ static int assert_reset(struct target *target)
select_dmi(target);
/* When we get here, OpenOCD might just have done some reset, which may
* have affected DMI or DM. Read a register just to make sure
* everything's in sync again. */
if (dm_read(target, NULL, DM_DMSTATUS) != ERROR_OK)
return ERROR_FAIL;
if (target_has_event_action(target, TARGET_EVENT_RESET_ASSERT)) {
/* Run the user-supplied script if there is one. */
target_handle_event(target, TARGET_EVENT_RESET_ASSERT);