This is an automated email from Gerrit.

"N S <nlsh...@yahoo.com>" just uploaded a new patch set to Gerrit, which you 
can find at https://review.openocd.org/c/openocd/+/7420

-- gerrit

commit 273633c0566a6769f860cefd1fc388c40e280365
Author: N S <nlsh...@yahoo.com>
Date:   Fri Dec 23 16:59:18 2022 -0800

    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 <nlsh...@yahoo.com>
    Change-Id: Id405fa802ff1cf3db7a21e76bd6df0c2d3a0fe61

diff --git a/src/jtag/drivers/openjtag.c b/src/jtag/drivers/openjtag.c
index 6be9507183..12ea463302 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);

-- 

Reply via email to