diff options
author | N S <nlshipp@yahoo.com> | 2022-12-23 16:59:18 -0800 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2023-01-28 15:52:54 +0000 |
commit | 20285b91008106c9fa966cea3269c6f6a81e539a (patch) | |
tree | 67da3b82c3879804303e19e35ced47e37edc0c3f | |
parent | d032e7ec8c2978feda5df2ca7c4ddbcaec2fcbf5 (diff) | |
download | riscv-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.c | 14 |
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); |