#include <stdlib.h>
-#define ZYLIN_VERSION "1.48"
+#define ZYLIN_VERSION "1.50"
#define ZYLIN_DATE __DATE__
#define ZYLIN_TIME __TIME__
-#define ZYLIN_OPENOCD "$Revision: 1241 $"
+#define ZYLIN_OPENOCD "$Revision$"
#define ZYLIN_OPENOCD_VERSION "Zylin JTAG ZY1000 " ZYLIN_VERSION " " ZYLIN_DATE " " ZYLIN_TIME
const char *zylin_config_dir="/config/settings";
return ERROR_OK;
}
-static bool readPowerDropout()
+static bool readPowerDropout(void)
{
cyg_uint32 state;
// sample and clear power dropout
}
-static bool readSRST()
+static bool readSRST(void)
{
cyg_uint32 state;
// sample and clear SRST sensing
return -1;
}
-extern bool readSRST();
+extern bool readSRST(void);
void zy1000_reset(int trst, int srst)
{
static int
zylinjtag_Jim_Command_powerstatus(Jim_Interp *interp,
- int argc,
+ int argc,
Jim_Obj * const *argv)
{
if (argc != 1)
int zy1000_init(void)
{
- LOG_ERROR("%s\n", ZYLIN_OPENOCD_VERSION);
+ LOG_USER("%s", ZYLIN_OPENOCD_VERSION);
ZY1000_POKE(ZY1000_JTAG_BASE+0x10, 0x30); // Turn on LED1 & LED2
-static cyg_uint32 getShiftValue()
+static cyg_uint32 getShiftValue(void)
{
cyg_uint32 value;
waitIdle();
return value;
}
#if 0
-static cyg_uint32 getShiftValueFlip()
+static cyg_uint32 getShiftValueFlip(void)
{
cyg_uint32 value;
waitIdle();
#endif
#if 0
-static void shiftValueInnerFlip(const enum tap_state state, const enum tap_state endState, int repeat, cyg_uint32 value)
+static void shiftValueInnerFlip(const tap_state_t state, const tap_state_t endState, int repeat, cyg_uint32 value)
{
- VERBOSE(LOG_INFO("shiftValueInner %s %s %d %08x (flipped)", jtag_state_name(state), jtag_state_name(endState), repeat, value));
+ VERBOSE(LOG_INFO("shiftValueInner %s %s %d %08x (flipped)", tap_state_name(state), tap_state_name(endState), repeat, value));
cyg_uint32 a,b;
a=state;
b=endState;
extern int jtag_check_value(u8 *captured, void *priv);
-static void gotoEndState()
+static void gotoEndState(void)
{
setCurrentState(cmd_queue_end_state);
}
-static __inline void scanFields(int num_fields, scan_field_t *fields, enum tap_state shiftState, int pause)
+static __inline void scanFields(int num_fields, scan_field_t *fields, tap_state_t shiftState, int pause)
{
int i;
int j;
j=0;
while (j<num_bits)
{
- enum tap_state pause_state;
+ tap_state_t pause_state;
int l;
k=num_bits-j;
pause_state=(shiftState==TAP_DRSHIFT)?TAP_DRSHIFT:TAP_IRSHIFT;
}
}
-int interface_jtag_add_end_state(enum tap_state state)
+int interface_jtag_add_end_state(tap_state_t state)
{
return ERROR_OK;
}
-int interface_jtag_add_ir_scan(int num_fields, scan_field_t *fields, enum tap_state state)
+int interface_jtag_add_ir_scan(int num_fields, scan_field_t *fields, tap_state_t state)
{
int j;
-int interface_jtag_add_plain_ir_scan(int num_fields, scan_field_t *fields, enum tap_state state)
+int interface_jtag_add_plain_ir_scan(int num_fields, scan_field_t *fields, tap_state_t state)
{
scanFields(num_fields, fields, TAP_IRSHIFT, 1);
gotoEndState();
/*extern jtag_command_t **jtag_get_last_command_p(void);*/
-int interface_jtag_add_dr_scan(int num_fields, scan_field_t *fields, enum tap_state state)
+int interface_jtag_add_dr_scan(int num_fields, scan_field_t *fields, tap_state_t state)
{
int j;
return ERROR_OK;
}
-int interface_jtag_add_plain_dr_scan(int num_fields, scan_field_t *fields, enum tap_state state)
+int interface_jtag_add_plain_dr_scan(int num_fields, scan_field_t *fields, tap_state_t state)
{
scanFields(num_fields, fields, TAP_DRSHIFT, 1);
gotoEndState();
return ERROR_OK;
}
-int interface_jtag_add_runtest(int num_cycles, enum tap_state state)
+static int zy1000_jtag_add_clocks(int num_cycles, tap_state_t state, tap_state_t clockstate)
{
/* num_cycles can be 0 */
- setCurrentState(TAP_IDLE);
+ setCurrentState(clockstate);
/* execute num_cycles, 32 at the time. */
int i;
{
num=num_cycles-i;
}
- shiftValueInner(TAP_IDLE, TAP_IDLE, num, 0);
+ shiftValueInner(clockstate, clockstate, num, 0);
}
#if !TEST_MANUAL()
/* finish in end_state */
setCurrentState(state);
#else
- enum tap_state t=TAP_IDLE;
+ tap_state_t t=TAP_IDLE;
/* test manual drive code on any target */
int tms;
- u8 tms_scan = TAP_MOVE(t, state);
+ u8 tms_scan = tap_get_tms_path(t, state);
for (i = 0; i < 7; i++)
{
return ERROR_OK;
}
+int interface_jtag_add_runtest(int num_cycles, tap_state_t state)
+{
+ return zy1000_jtag_add_clocks(num_cycles, state, TAP_IDLE);
+}
+
+int interface_jtag_add_clocks(int num_cycles)
+{
+ return zy1000_jtag_add_clocks(num_cycles, cmd_queue_cur_state, cmd_queue_end_state);
+}
+
int interface_jtag_add_sleep(u32 us)
{
jtag_sleep(us);
return ERROR_OK;
}
-int interface_jtag_add_pathmove(int num_states, enum tap_state *path)
+int interface_jtag_add_pathmove(int num_states, tap_state_t *path)
{
int state_count;
int tms = 0;
state_count = 0;
- enum tap_state cur_state=cmd_queue_cur_state;
+ tap_state_t cur_state=cmd_queue_cur_state;
while (num_states)
{
- if (tap_transitions[cur_state].low == path[state_count])
+ if (tap_state_transition(cur_state, false) == path[state_count])
{
tms = 0;
}
- else if (tap_transitions[cur_state].high == path[state_count])
+ else if (tap_state_transition(cur_state, true) == path[state_count])
{
tms = 1;
}
else
{
- LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition", jtag_state_name(cur_state), jtag_state_name(path[state_count]));
+ LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition", tap_state_name(cur_state), tap_state_name(path[state_count]));
exit(-1);
}
void embeddedice_write_dcc(jtag_tap_t *tap, int reg_addr, u8 *buffer, int little, int count)
{
// static int const reg_addr=0x5;
- enum tap_state end_state=cmd_queue_end_state;
+ tap_state_t end_state=cmd_queue_end_state;
if (jtag_NextEnabledTap(jtag_NextEnabledTap(NULL))==NULL)
{
/* better performance via code duplication */
free(name);
return result;
}
+
+