This is an automated email from Gerrit.

Anonymous Coward ([email protected]) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/5335

-- gerrit

commit 9ea8782e6845744088426b38823612b336aed03b
Author: Alexandru Gagniuc <[email protected]>
Date:   Sun Oct 27 12:02:51 2019 -0500

    jtag: Add support for JTAG_PINS command
    
    Implement support for creating a JTAG_PINS command, and passing it
    down to the adapter driver.
    
    Change-Id: I0572505d6ae97b5cd7f267e69489eb54eb53ed4e
    Signed-off-by: Alexandru Gagniuc <[email protected]>

diff --git a/src/jtag/core.c b/src/jtag/core.c
index 144cf94..a7ea234 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -548,6 +548,11 @@ void jtag_add_pathmove(int num_states, const tap_state_t 
*path)
        cmd_queue_cur_state = path[num_states - 1];
 }
 
+void jtag_add_pins_cmd(uint8_t values, uint8_t mask)
+{
+       interface_add_pins_cmd(values, mask);
+}
+
 int jtag_add_statemove(tap_state_t goal_state)
 {
        tap_state_t cur_state = cmd_queue_cur_state;
diff --git a/src/jtag/drivers/driver.c b/src/jtag/drivers/driver.c
index 4923f96..1e2d115 100644
--- a/src/jtag/drivers/driver.c
+++ b/src/jtag/drivers/driver.c
@@ -274,6 +274,27 @@ int interface_jtag_add_pathmove(int num_states, const 
tap_state_t *path)
        return ERROR_OK;
 }
 
+int interface_add_pins_cmd(uint8_t values, uint8_t mask)
+{
+       struct jtag_command *cmd;
+
+       cmd = cmd_queue_alloc(sizeof(struct jtag_command));
+       if (cmd == NULL)
+               return ERROR_FAIL;
+
+       cmd->type = JTAG_PINS;
+       cmd->cmd.pins = cmd_queue_alloc(sizeof(*cmd->cmd.pins));
+       if (!cmd->cmd.pins)
+               return ERROR_FAIL;
+
+       cmd->cmd.pins->pin_state = values;
+       cmd->cmd.pins->pin_mask = mask;
+
+       jtag_queue_command(cmd);
+
+       return ERROR_OK;
+}
+
 int interface_jtag_add_runtest(int num_cycles, tap_state_t state)
 {
        /* allocate memory for a new list member */
diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h
index c93243c..0ab24b8 100644
--- a/src/jtag/jtag.h
+++ b/src/jtag/jtag.h
@@ -527,6 +527,8 @@ void jtag_add_sleep(uint32_t us);
 
 int jtag_add_tms_seq(unsigned nbits, const uint8_t *seq, enum tap_state t);
 
+void jtag_add_pins_cmd(uint8_t values, uint8_t mask);
+
 /**
  * Function jtag_add_clocks
  * first checks that the state in which the clocks are to be issued is
diff --git a/src/jtag/minidriver.h b/src/jtag/minidriver.h
index 688c396..a51c11c 100644
--- a/src/jtag/minidriver.h
+++ b/src/jtag/minidriver.h
@@ -68,6 +68,8 @@ int interface_jtag_add_runtest(int num_cycles, tap_state_t 
endstate);
 int interface_add_tms_seq(unsigned num_bits,
                const uint8_t *bits, enum tap_state state);
 
+int interface_add_pins_cmd(uint8_t values, uint8_t mask);
+
 /**
  * This drives the actual srst and trst pins. srst will always be 0
  * if jtag_reset_config & RESET_SRST_PULLS_TRST != 0 and ditto for

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to