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>
This commit is contained in:
N S 2022-12-23 16:59:18 -08:00 committed by Antonio Borneo
parent d032e7ec8c
commit 20285b9100
1 changed files with 8 additions and 6 deletions

View File

@ -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);