This is an automated email from Gerrit. "Paul Robertson <ethelthef...@gmail.com>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7085
-- gerrit commit 1ba58a4d24e844adfcd5378bfa9f5a8b3cfd1024 Author: Ethelthefrog <ethelthef...@gmail.com> Date: Thu Jul 14 14:26:26 2022 +0100 target/riscv/riscv-013.c: dmi_scan() line 522. Making use of dtmcs_idle. RISC-V debug spec section 6.1.4 specifies the 'idle' field in the dtmcs register as a hint for avoid hitting 'busy' returns during DMI transactions. This patch uses this value (stored in info->dtmcs_idle) as a minimum value for idle_count. Signed-off-by: Ethelthefrog <ethelthef...@gmail.com> Change-Id: Ie7460cc6d5ce872d97e508c7de17a1666bc623c5 diff --git a/.gitignore b/.gitignore index f5aa68a405..c582504cd4 100644 --- a/.gitignore +++ b/.gitignore @@ -101,3 +101,12 @@ tags GPATH GRTAGS GTAGS + +# Qt Creator stuff +openocd.cflags +openocd.config +openocd.creator* +openocd.cxxflags +openocd.files +openocd.includes + diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 1b1450a7dc..ae37d3bfc2 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -519,6 +519,13 @@ static dmi_status_t dmi_scan(struct target *target, uint32_t *address_in, if (exec) idle_count += info->ac_busy_delay; + /* The target can request a minimum number of TCK cycles in RunTest/Idle + to enable clock-domain-crossing logic to get values from the JTAG + domain to the core clock domain and back again. */ + int min_idle_count = ((int)info->dtmcs_idle)-1; + if (idle_count < min_idle_count) + idle_count = min_idle_count; + if (idle_count) jtag_add_runtest(idle_count, TAP_IDLE); --