aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorN S <nlshipp@yahoo.com>2022-12-23 16:59:18 -0800
committerAntonio Borneo <borneo.antonio@gmail.com>2023-01-28 15:52:54 +0000
commit20285b91008106c9fa966cea3269c6f6a81e539a (patch)
tree67da3b82c3879804303e19e35ced47e37edc0c3f
parentd032e7ec8c2978feda5df2ca7c4ddbcaec2fcbf5 (diff)
downloadriscv-openocd-20285b91008106c9fa966cea3269c6f6a81e539a.zip
riscv-openocd-20285b91008106c9fa966cea3269c6f6a81e539a.tar.gz
riscv-openocd-20285b91008106c9fa966cea3269c6f6a81e539a.tar.bz2
jtag/drivers/openjtag: fix annoying num_cycles > 16 warning
The OpenJTAG driver logs "num_cycles > 16 on run test" warning whenever the JTAG_RUNTEST operation cycle count is larger than 16. Instead of logging the warning and only running the first 16 TCLK cycles, remove the warning and queue up multiple operations of up to 16 cycles each. Signed-off-by: N S <nlshipp@yahoo.com> Change-Id: Id405fa802ff1cf3db7a21e76bd6df0c2d3a0fe61 Reviewed-on: https://review.openocd.org/c/openocd/+/7420 Tested-by: jenkins Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
-rw-r--r--src/jtag/drivers/openjtag.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/jtag/drivers/openjtag.c b/src/jtag/drivers/openjtag.c
index 6be9507..12ea463 100644
--- a/src/jtag/drivers/openjtag.c
+++ b/src/jtag/drivers/openjtag.c
@@ -742,16 +742,18 @@ static void openjtag_execute_runtest(struct jtag_command *cmd)
tap_set_state(TAP_IDLE);
}
- if (cmd->cmd.runtest->num_cycles > 16)
- LOG_WARNING("num_cycles > 16 on run test");
-
if (openjtag_variant != OPENJTAG_VARIANT_CY7C65215 ||
cmd->cmd.runtest->num_cycles) {
uint8_t command;
- command = 7;
- command |= ((cmd->cmd.runtest->num_cycles - 1) & 0x0F) << 4;
+ int cycles = cmd->cmd.runtest->num_cycles;
- openjtag_add_byte(command);
+ do {
+ command = 7;
+ command |= (((cycles > 16 ? 16 : cycles) - 1) & 0x0F) << 4;
+
+ openjtag_add_byte(command);
+ cycles -= 16;
+ } while (cycles > 0);
}
tap_set_end_state(end_state);