target/riscv: tcl/target: move the WA for GD32VF103 to Tcl
The GD32VF103 has a perculiar reset procedure that does not fully comply with the RISC-V Debug Specification. Move the workaroung to the `deassert-reset-post` handler. Change-Id: I153c866a5b7e2dff2552cc92772ce6ed77ad606b Signed-off-by: Evgeniy Naydanov <eugnay@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/9314 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
This commit is contained in:
committed by
Antonio Borneo
parent
2a0b9bbc28
commit
21e345a2f7
@@ -3001,15 +3001,7 @@ static int deassert_reset(struct target *target)
|
||||
get_field(dmstatus, DM_DMSTATUS_ALLHAVERESET) ? "true" : "false");
|
||||
return ERROR_TIMEOUT_REACHED;
|
||||
}
|
||||
/* Certain debug modules, like the one in GD32VF103
|
||||
* MCUs, violate the specification's requirement that
|
||||
* each hart is in "exactly one of four states" and,
|
||||
* during reset, report harts as both unavailable and
|
||||
* halted/running. To work around this, we check for
|
||||
* the absence of the unavailable state rather than
|
||||
* the presence of any other state. */
|
||||
} while (get_field(dmstatus, DM_DMSTATUS_ALLUNAVAIL) &&
|
||||
!get_field(dmstatus, DM_DMSTATUS_ALLHAVERESET));
|
||||
} while (!get_field(dmstatus, DM_DMSTATUS_ALLHAVERESET));
|
||||
|
||||
riscv_scan_set_delay(&info->learned_delays, RISCV_DELAY_BASE,
|
||||
orig_base_delay);
|
||||
|
||||
Reference in New Issue
Block a user