#include "command.h"
+
#if 0
#define _DEBUG_JTAG_IO_
#endif
/* 16 Tap States, from page 21 of ASSET InterTech, Inc.'s svf.pdf
*/
-enum tap_state
+typedef enum tap_state
{
TAP_RESET = 0x0, TAP_IDLE = 0x8,
TAP_DRSELECT = 0x1, TAP_DRCAPTURE = 0x2, TAP_DRSHIFT = 0x3, TAP_DREXIT1 = 0x4,
TAP_DRPAUSE = 0x5, TAP_DREXIT2 = 0x6, TAP_DRUPDATE = 0x7,
TAP_IRSELECT = 0x9, TAP_IRCAPTURE = 0xa, TAP_IRSHIFT = 0xb, TAP_IREXIT1 = 0xc,
TAP_IRPAUSE = 0xd, TAP_IREXIT2 = 0xe, TAP_IRUPDATE = 0xf
-};
+} tap_state_t;
typedef struct tap_transition_s
{
enum tap_state low;
} tap_transition_t;
-extern char* tap_state_strings[16];
extern int tap_move_map[16]; /* map 16 TAP states to 6 stable states */
extern u8 tap_move[6][6]; /* value scanned to TMS to move from one of six stable states to another */
extern tap_transition_t tap_transitions[16]; /* describe the TAP state diagram */
enum tap_state end_state; /* TAP state in which JTAG commands should finish */
} runtest_command_t;
+
+typedef struct stableclocks_command_s
+{
+ int num_cycles; /* number of clock cycles that should be sent */
+} stableclocks_command_t;
+
+
typedef struct reset_command_s
{
int trst; /* trst/srst 0: deassert, 1: assert, -1: don't change */
statemove_command_t *statemove;
pathmove_command_t *pathmove;
runtest_command_t *runtest;
+ stableclocks_command_t *stableclocks;
reset_command_t *reset;
end_state_command_t *end_state;
sleep_command_t *sleep;
JTAG_SCAN = 1,
JTAG_STATEMOVE = 2, JTAG_RUNTEST = 3,
JTAG_RESET = 4, JTAG_END_STATE = 5,
- JTAG_PATHMOVE = 6, JTAG_SLEEP = 7
+ JTAG_PATHMOVE = 6, JTAG_SLEEP = 7,
+ JTAG_STABLECLOCKS = 8
};
typedef struct jtag_command_s
extern void jtag_add_sleep(u32 us);
extern int interface_jtag_add_sleep(u32 us);
+
+/**
+ * Function jtag_add_stable_clocks
+ * first checks that the state in which the clocks are to be issued is
+ * stable, then queues up clock_count clocks for transmission.
+ */
+void jtag_add_clocks( int num_cycles );
+int interface_jtag_add_clocks( int num_cycles );
+
+
/*
* For software FIFO implementations, the queued commands can be executed
* during this call or earlier. A sw queue might decide to push out
interface_jtag_add_dr_out(tap, num_fields, num_bits, value, cmd_queue_end_state);
}
+/**
+ * Function jtag_state_name
+ * Returns a string suitable for display representing the JTAG tap_state
+ */
+const char* jtag_state_name(enum tap_state state);
+
+
#endif /* JTAG_H */