The following patches was applied:
- openocd-flash-static-keyword-v3.patch - openocd-lpc2000-fix-erase-obo.patch - openocd-jlink-fix-sign-ptr-warn.patch - openocd-wextra-etm.patch - openocd-wextra-jtag.patch - openocd-add-new-tap-symbols-v6.patch Many thanks to Zach Welch <zw(at)superlucidity.net> git-svn-id: svn://svn.berlios.de/openocd/trunk@1462 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
@@ -346,7 +346,7 @@ int amt_jtagaccel_execute_queue(void)
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
LOG_DEBUG("end_state: %i", cmd->cmd.end_state->end_state);
|
||||
#endif
|
||||
if (cmd->cmd.end_state->end_state != -1)
|
||||
if (cmd->cmd.end_state->end_state != TAP_INVALID)
|
||||
amt_jtagaccel_end_state(cmd->cmd.end_state->end_state);
|
||||
break;
|
||||
case JTAG_RESET:
|
||||
@@ -363,7 +363,7 @@ int amt_jtagaccel_execute_queue(void)
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
LOG_DEBUG("runtest %i cycles, end in %i", cmd->cmd.runtest->num_cycles, cmd->cmd.runtest->end_state);
|
||||
#endif
|
||||
if (cmd->cmd.runtest->end_state != -1)
|
||||
if (cmd->cmd.runtest->end_state != TAP_INVALID)
|
||||
amt_jtagaccel_end_state(cmd->cmd.runtest->end_state);
|
||||
amt_jtagaccel_runtest(cmd->cmd.runtest->num_cycles);
|
||||
break;
|
||||
@@ -371,7 +371,7 @@ int amt_jtagaccel_execute_queue(void)
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
LOG_DEBUG("statemove end in %i", cmd->cmd.statemove->end_state);
|
||||
#endif
|
||||
if (cmd->cmd.statemove->end_state != -1)
|
||||
if (cmd->cmd.statemove->end_state != TAP_INVALID)
|
||||
amt_jtagaccel_end_state(cmd->cmd.statemove->end_state);
|
||||
amt_jtagaccel_state_move();
|
||||
break;
|
||||
@@ -379,7 +379,7 @@ int amt_jtagaccel_execute_queue(void)
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
LOG_DEBUG("scan end in %i", cmd->cmd.scan->end_state);
|
||||
#endif
|
||||
if (cmd->cmd.scan->end_state != -1)
|
||||
if (cmd->cmd.scan->end_state != TAP_INVALID)
|
||||
amt_jtagaccel_end_state(cmd->cmd.scan->end_state);
|
||||
scan_size = jtag_build_buffer(cmd->cmd.scan, &buffer);
|
||||
type = jtag_scan_type(cmd->cmd.scan);
|
||||
|
||||
@@ -156,7 +156,7 @@ int armjtagew_execute_queue(void)
|
||||
case JTAG_END_STATE:
|
||||
DEBUG_JTAG_IO("end_state: %i", cmd->cmd.end_state->end_state);
|
||||
|
||||
if (cmd->cmd.end_state->end_state != -1)
|
||||
if (cmd->cmd.end_state->end_state != TAP_INVALID)
|
||||
{
|
||||
armjtagew_end_state(cmd->cmd.end_state->end_state);
|
||||
}
|
||||
@@ -166,7 +166,7 @@ int armjtagew_execute_queue(void)
|
||||
DEBUG_JTAG_IO( "runtest %i cycles, end in %i", cmd->cmd.runtest->num_cycles, \
|
||||
cmd->cmd.runtest->end_state);
|
||||
|
||||
if (cmd->cmd.runtest->end_state != -1)
|
||||
if (cmd->cmd.runtest->end_state != TAP_INVALID)
|
||||
{
|
||||
armjtagew_end_state(cmd->cmd.runtest->end_state);
|
||||
}
|
||||
@@ -176,7 +176,7 @@ int armjtagew_execute_queue(void)
|
||||
case JTAG_STATEMOVE:
|
||||
DEBUG_JTAG_IO("statemove end in %i", cmd->cmd.statemove->end_state);
|
||||
|
||||
if (cmd->cmd.statemove->end_state != -1)
|
||||
if (cmd->cmd.statemove->end_state != TAP_INVALID)
|
||||
{
|
||||
armjtagew_end_state(cmd->cmd.statemove->end_state);
|
||||
}
|
||||
@@ -194,7 +194,7 @@ int armjtagew_execute_queue(void)
|
||||
case JTAG_SCAN:
|
||||
DEBUG_JTAG_IO("scan end in %i", cmd->cmd.scan->end_state);
|
||||
|
||||
if (cmd->cmd.scan->end_state != -1)
|
||||
if (cmd->cmd.scan->end_state != TAP_INVALID)
|
||||
{
|
||||
armjtagew_end_state(cmd->cmd.scan->end_state);
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ int bitbang_execute_queue(void)
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
LOG_DEBUG("end_state: %s", tap_state_name(cmd->cmd.end_state->end_state) );
|
||||
#endif
|
||||
if (cmd->cmd.end_state->end_state != -1)
|
||||
if (cmd->cmd.end_state->end_state != TAP_INVALID)
|
||||
bitbang_end_state(cmd->cmd.end_state->end_state);
|
||||
break;
|
||||
case JTAG_RESET:
|
||||
@@ -295,7 +295,7 @@ int bitbang_execute_queue(void)
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
LOG_DEBUG("runtest %i cycles, end in %s", cmd->cmd.runtest->num_cycles, tap_state_name(cmd->cmd.runtest->end_state) );
|
||||
#endif
|
||||
if (cmd->cmd.runtest->end_state != -1)
|
||||
if (cmd->cmd.runtest->end_state != TAP_INVALID)
|
||||
bitbang_end_state(cmd->cmd.runtest->end_state);
|
||||
bitbang_runtest(cmd->cmd.runtest->num_cycles);
|
||||
break;
|
||||
@@ -311,7 +311,7 @@ int bitbang_execute_queue(void)
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
LOG_DEBUG("statemove end in %s", tap_state_name(cmd->cmd.statemove->end_state));
|
||||
#endif
|
||||
if (cmd->cmd.statemove->end_state != -1)
|
||||
if (cmd->cmd.statemove->end_state != TAP_INVALID)
|
||||
bitbang_end_state(cmd->cmd.statemove->end_state);
|
||||
bitbang_state_move();
|
||||
break;
|
||||
@@ -326,7 +326,7 @@ int bitbang_execute_queue(void)
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
LOG_DEBUG("%s scan end in %s", (cmd->cmd.scan->ir_scan) ? "IR" : "DR", tap_state_name(cmd->cmd.scan->end_state) );
|
||||
#endif
|
||||
if (cmd->cmd.scan->end_state != -1)
|
||||
if (cmd->cmd.scan->end_state != TAP_INVALID)
|
||||
bitbang_end_state(cmd->cmd.scan->end_state);
|
||||
scan_size = jtag_build_buffer(cmd->cmd.scan, &buffer);
|
||||
type = jtag_scan_type(cmd->cmd.scan);
|
||||
|
||||
@@ -153,7 +153,7 @@ void bitq_io(int tms, int tdi, int tdo_req)
|
||||
|
||||
void bitq_end_state(tap_state_t state)
|
||||
{
|
||||
if (state==-1)
|
||||
if (state==TAP_INVALID)
|
||||
return;
|
||||
|
||||
if (!tap_is_state_stable(state))
|
||||
|
||||
@@ -1308,7 +1308,7 @@ int ft2232_execute_queue()
|
||||
switch (cmd->type)
|
||||
{
|
||||
case JTAG_END_STATE:
|
||||
if (cmd->cmd.end_state->end_state != -1)
|
||||
if (cmd->cmd.end_state->end_state != TAP_INVALID)
|
||||
ft2232_end_state(cmd->cmd.end_state->end_state);
|
||||
break;
|
||||
|
||||
@@ -1341,9 +1341,9 @@ int ft2232_execute_queue()
|
||||
if (tap_get_state() != TAP_IDLE)
|
||||
predicted_size += 3;
|
||||
predicted_size += 3 * CEIL(cmd->cmd.runtest->num_cycles, 7);
|
||||
if ( (cmd->cmd.runtest->end_state != -1) && (cmd->cmd.runtest->end_state != TAP_IDLE) )
|
||||
if ( (cmd->cmd.runtest->end_state != TAP_INVALID) && (cmd->cmd.runtest->end_state != TAP_IDLE) )
|
||||
predicted_size += 3;
|
||||
if ( (cmd->cmd.runtest->end_state == -1) && (tap_get_end_state() != TAP_IDLE) )
|
||||
if ( (cmd->cmd.runtest->end_state == TAP_INVALID) && (tap_get_end_state() != TAP_IDLE) )
|
||||
predicted_size += 3;
|
||||
if (ft2232_buffer_size + predicted_size + 1 > FT2232_BUFFER_SIZE)
|
||||
{
|
||||
@@ -1379,7 +1379,7 @@ int ft2232_execute_queue()
|
||||
/* LOG_DEBUG("added TMS scan (no read)"); */
|
||||
}
|
||||
|
||||
if (cmd->cmd.runtest->end_state != -1)
|
||||
if (cmd->cmd.runtest->end_state != TAP_INVALID)
|
||||
ft2232_end_state(cmd->cmd.runtest->end_state);
|
||||
|
||||
if ( tap_get_state() != tap_get_end_state() )
|
||||
@@ -1409,7 +1409,7 @@ int ft2232_execute_queue()
|
||||
require_send = 0;
|
||||
first_unsent = cmd;
|
||||
}
|
||||
if (cmd->cmd.statemove->end_state != -1)
|
||||
if (cmd->cmd.statemove->end_state != TAP_INVALID)
|
||||
ft2232_end_state(cmd->cmd.statemove->end_state);
|
||||
|
||||
/* command "Clock Data to TMS/CS Pin (no Read)" */
|
||||
@@ -1458,7 +1458,7 @@ int ft2232_execute_queue()
|
||||
retval = ERROR_JTAG_QUEUE_FAILED;
|
||||
|
||||
/* current command */
|
||||
if (cmd->cmd.scan->end_state != -1)
|
||||
if (cmd->cmd.scan->end_state != TAP_INVALID)
|
||||
ft2232_end_state(cmd->cmd.scan->end_state);
|
||||
ft2232_large_scan(cmd->cmd.scan, type, buffer, scan_size);
|
||||
require_send = 0;
|
||||
@@ -1479,7 +1479,7 @@ int ft2232_execute_queue()
|
||||
}
|
||||
ft2232_expect_read += ft2232_predict_scan_in(scan_size, type);
|
||||
/* LOG_DEBUG("new read size: %i", ft2232_expect_read); */
|
||||
if (cmd->cmd.scan->end_state != -1)
|
||||
if (cmd->cmd.scan->end_state != TAP_INVALID)
|
||||
ft2232_end_state(cmd->cmd.scan->end_state);
|
||||
ft2232_add_scan(cmd->cmd.scan->ir_scan, type, buffer, scan_size);
|
||||
require_send = 1;
|
||||
|
||||
@@ -369,7 +369,7 @@ int gw16012_execute_queue(void)
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
LOG_DEBUG("end_state: %i", cmd->cmd.end_state->end_state);
|
||||
#endif
|
||||
if (cmd->cmd.end_state->end_state != -1)
|
||||
if (cmd->cmd.end_state->end_state != TAP_INVALID)
|
||||
gw16012_end_state(cmd->cmd.end_state->end_state);
|
||||
break;
|
||||
case JTAG_RESET:
|
||||
@@ -386,7 +386,7 @@ int gw16012_execute_queue(void)
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
LOG_DEBUG("runtest %i cycles, end in %i", cmd->cmd.runtest->num_cycles, cmd->cmd.runtest->end_state);
|
||||
#endif
|
||||
if (cmd->cmd.runtest->end_state != -1)
|
||||
if (cmd->cmd.runtest->end_state != TAP_INVALID)
|
||||
gw16012_end_state(cmd->cmd.runtest->end_state);
|
||||
gw16012_runtest(cmd->cmd.runtest->num_cycles);
|
||||
break;
|
||||
@@ -394,7 +394,7 @@ int gw16012_execute_queue(void)
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
LOG_DEBUG("statemove end in %i", cmd->cmd.statemove->end_state);
|
||||
#endif
|
||||
if (cmd->cmd.statemove->end_state != -1)
|
||||
if (cmd->cmd.statemove->end_state != TAP_INVALID)
|
||||
gw16012_end_state(cmd->cmd.statemove->end_state);
|
||||
gw16012_state_move();
|
||||
break;
|
||||
@@ -405,7 +405,7 @@ int gw16012_execute_queue(void)
|
||||
gw16012_path_move(cmd->cmd.pathmove);
|
||||
break;
|
||||
case JTAG_SCAN:
|
||||
if (cmd->cmd.scan->end_state != -1)
|
||||
if (cmd->cmd.scan->end_state != TAP_INVALID)
|
||||
gw16012_end_state(cmd->cmd.scan->end_state);
|
||||
scan_size = jtag_build_buffer(cmd->cmd.scan, &buffer);
|
||||
type = jtag_scan_type(cmd->cmd.scan);
|
||||
|
||||
@@ -154,7 +154,7 @@ int jlink_execute_queue(void)
|
||||
case JTAG_END_STATE:
|
||||
DEBUG_JTAG_IO("end_state: %i", cmd->cmd.end_state->end_state);
|
||||
|
||||
if (cmd->cmd.end_state->end_state != -1)
|
||||
if (cmd->cmd.end_state->end_state != TAP_INVALID)
|
||||
{
|
||||
jlink_end_state(cmd->cmd.end_state->end_state);
|
||||
}
|
||||
@@ -164,7 +164,7 @@ int jlink_execute_queue(void)
|
||||
DEBUG_JTAG_IO( "runtest %i cycles, end in %i", cmd->cmd.runtest->num_cycles, \
|
||||
cmd->cmd.runtest->end_state);
|
||||
|
||||
if (cmd->cmd.runtest->end_state != -1)
|
||||
if (cmd->cmd.runtest->end_state != TAP_INVALID)
|
||||
{
|
||||
jlink_end_state(cmd->cmd.runtest->end_state);
|
||||
}
|
||||
@@ -174,7 +174,7 @@ int jlink_execute_queue(void)
|
||||
case JTAG_STATEMOVE:
|
||||
DEBUG_JTAG_IO("statemove end in %i", cmd->cmd.statemove->end_state);
|
||||
|
||||
if (cmd->cmd.statemove->end_state != -1)
|
||||
if (cmd->cmd.statemove->end_state != TAP_INVALID)
|
||||
{
|
||||
jlink_end_state(cmd->cmd.statemove->end_state);
|
||||
}
|
||||
@@ -192,7 +192,7 @@ int jlink_execute_queue(void)
|
||||
case JTAG_SCAN:
|
||||
DEBUG_JTAG_IO("scan end in %i", cmd->cmd.scan->end_state);
|
||||
|
||||
if (cmd->cmd.scan->end_state != -1)
|
||||
if (cmd->cmd.scan->end_state != TAP_INVALID)
|
||||
{
|
||||
jlink_end_state(cmd->cmd.scan->end_state);
|
||||
}
|
||||
@@ -525,7 +525,7 @@ int jlink_get_version_info(void)
|
||||
if (result == len)
|
||||
{
|
||||
usb_in_buffer[result] = 0;
|
||||
LOG_INFO(usb_in_buffer);
|
||||
LOG_INFO((char *)usb_in_buffer);
|
||||
return ERROR_OK;
|
||||
}
|
||||
}
|
||||
@@ -858,8 +858,8 @@ int jlink_usb_write(jlink_jtag_t *jlink_jtag, int out_length)
|
||||
return -1;
|
||||
}
|
||||
|
||||
result = usb_bulk_write(jlink_jtag->usb_handle, JLINK_WRITE_ENDPOINT, \
|
||||
usb_out_buffer, out_length, JLINK_USB_TIMEOUT);
|
||||
result = usb_bulk_write(jlink_jtag->usb_handle, JLINK_WRITE_ENDPOINT,
|
||||
(char *)usb_out_buffer, out_length, JLINK_USB_TIMEOUT);
|
||||
|
||||
DEBUG_JTAG_IO("jlink_usb_write, out_length = %d, result = %d", out_length, result);
|
||||
|
||||
@@ -872,8 +872,8 @@ int jlink_usb_write(jlink_jtag_t *jlink_jtag, int out_length)
|
||||
/* Read data from USB into in_buffer. */
|
||||
int jlink_usb_read(jlink_jtag_t *jlink_jtag)
|
||||
{
|
||||
int result = usb_bulk_read(jlink_jtag->usb_handle, JLINK_READ_ENDPOINT, \
|
||||
usb_in_buffer, JLINK_IN_BUFFER_SIZE, JLINK_USB_TIMEOUT);
|
||||
int result = usb_bulk_read(jlink_jtag->usb_handle, JLINK_READ_ENDPOINT,
|
||||
(char *)usb_in_buffer, JLINK_IN_BUFFER_SIZE, JLINK_USB_TIMEOUT);
|
||||
|
||||
DEBUG_JTAG_IO("jlink_usb_read, result = %d", result);
|
||||
|
||||
@@ -886,8 +886,9 @@ int jlink_usb_read(jlink_jtag_t *jlink_jtag)
|
||||
/* Read the result from the previous EMU cmd into result_buffer. */
|
||||
int jlink_usb_read_emu_result(jlink_jtag_t *jlink_jtag)
|
||||
{
|
||||
int result = usb_bulk_read(jlink_jtag->usb_handle, JLINK_READ_ENDPOINT, \
|
||||
usb_emu_result_buffer, JLINK_EMU_RESULT_BUFFER_SIZE, JLINK_USB_TIMEOUT);
|
||||
int result = usb_bulk_read(jlink_jtag->usb_handle, JLINK_READ_ENDPOINT,
|
||||
(char *)usb_emu_result_buffer, JLINK_EMU_RESULT_BUFFER_SIZE,
|
||||
JLINK_USB_TIMEOUT);
|
||||
|
||||
DEBUG_JTAG_IO("jlink_usb_read_result, result = %d", result);
|
||||
|
||||
|
||||
@@ -510,7 +510,7 @@ static void jtag_prelude(tap_state_t state)
|
||||
{
|
||||
jtag_prelude1();
|
||||
|
||||
if (state != -1)
|
||||
if (state != TAP_INVALID)
|
||||
jtag_add_end_state(state);
|
||||
|
||||
cmd_queue_cur_state = cmd_queue_end_state;
|
||||
@@ -2717,7 +2717,7 @@ int handle_runtest_command(struct command_context_s *cmd_ctx, char *cmd, char **
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
jtag_add_runtest(strtol(args[0], NULL, 0), -1);
|
||||
jtag_add_runtest(strtol(args[0], NULL, 0), TAP_INVALID);
|
||||
jtag_execute_queue();
|
||||
|
||||
return ERROR_OK;
|
||||
@@ -2740,7 +2740,7 @@ int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **a
|
||||
/* "statename" */
|
||||
/* at the end of the arguments. */
|
||||
/* assume none. */
|
||||
endstate = -1;
|
||||
endstate = TAP_INVALID;
|
||||
if( argc >= 4 ){
|
||||
/* have at least one pair of numbers. */
|
||||
/* is last pair the magic text? */
|
||||
@@ -2748,13 +2748,13 @@ int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **a
|
||||
const char *cpA;
|
||||
const char *cpS;
|
||||
cpA = args[ argc-1 ];
|
||||
for( endstate = 0 ; endstate < 16 ; endstate++ ){
|
||||
for( endstate = 0 ; endstate < TAP_NUM_STATES ; endstate++ ){
|
||||
cpS = tap_state_name( endstate );
|
||||
if( 0 == strcmp( cpA, cpS ) ){
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( endstate >= 16 ){
|
||||
if( endstate >= TAP_NUM_STATES ){
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
} else {
|
||||
/* found - remove the last 2 args */
|
||||
@@ -2784,11 +2784,11 @@ int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **a
|
||||
fields[i].in_handler_priv = NULL;
|
||||
}
|
||||
|
||||
jtag_add_ir_scan(argc / 2, fields, -1);
|
||||
jtag_add_ir_scan(argc / 2, fields, TAP_INVALID);
|
||||
/* did we have an endstate? */
|
||||
if( endstate >= 0 ){
|
||||
if (endstate != TAP_INVALID)
|
||||
jtag_add_end_state(endstate);
|
||||
}
|
||||
|
||||
jtag_execute_queue();
|
||||
|
||||
for (i = 0; i < argc / 2; i++)
|
||||
@@ -2825,7 +2825,7 @@ int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args)
|
||||
}
|
||||
|
||||
/* assume no endstate */
|
||||
endstate = -1;
|
||||
endstate = TAP_INVALID;
|
||||
/* validate arguments as numbers */
|
||||
e = JIM_OK;
|
||||
for (i = 2; i < argc; i+=2)
|
||||
@@ -2901,11 +2901,11 @@ int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args)
|
||||
fields[field_count++].in_handler_priv = NULL;
|
||||
}
|
||||
|
||||
jtag_add_dr_scan(num_fields, fields, -1);
|
||||
jtag_add_dr_scan(num_fields, fields, TAP_INVALID);
|
||||
/* did we get an end state? */
|
||||
if( endstate >= 0 ){
|
||||
jtag_add_end_state( (tap_state_t)endstate );
|
||||
}
|
||||
if (endstate != TAP_INVALID)
|
||||
jtag_add_end_state(endstate);
|
||||
|
||||
retval = jtag_execute_queue();
|
||||
if (retval != ERROR_OK)
|
||||
{
|
||||
@@ -3089,7 +3089,7 @@ int tap_get_tms_path( tap_state_t from, tap_state_t to )
|
||||
*
|
||||
* DRSHIFT->DRSHIFT and IRSHIFT->IRSHIFT have to be caught in interface specific code
|
||||
*/
|
||||
const static u8 tms_seqs[6][6] =
|
||||
static const u8 tms_seqs[6][6] =
|
||||
{
|
||||
/* value clocked to TMS to move from one of six stable states to another */
|
||||
|
||||
@@ -3273,14 +3273,14 @@ int tap_state_by_name( const char *name )
|
||||
{
|
||||
int x;
|
||||
|
||||
for( x = 0 ; x < 16 ; x++ ){
|
||||
for( x = 0 ; x < TAP_NUM_STATES ; x++ ){
|
||||
/* be nice to the human */
|
||||
if( 0 == strcasecmp( name, tap_state_name(x) ) ){
|
||||
return x;
|
||||
}
|
||||
}
|
||||
/* not found */
|
||||
return -1;
|
||||
return TAP_INVALID;
|
||||
}
|
||||
|
||||
/*-----</Cable Helper API>--------------------------------------*/
|
||||
|
||||
@@ -46,7 +46,9 @@ enum tap_state {
|
||||
TAP_DRSELECT = 1, TAP_DRCAPTURE = 2, TAP_DRSHIFT = 3, TAP_DREXIT1 = 4,
|
||||
TAP_DRPAUSE = 5, TAP_DREXIT2 = 6, TAP_DRUPDATE = 7,
|
||||
TAP_IRSELECT = 9, TAP_IRCAPTURE = 10, TAP_IRSHIFT = 11, TAP_IREXIT1 = 12,
|
||||
TAP_IRPAUSE = 13, TAP_IREXIT2 = 14, TAP_IRUPDATE = 15
|
||||
TAP_IRPAUSE = 13, TAP_IREXIT2 = 14, TAP_IRUPDATE = 15,
|
||||
|
||||
TAP_NUM_STATES = 16, TAP_INVALID = -1,
|
||||
};
|
||||
|
||||
typedef enum tap_state tap_state_t;
|
||||
@@ -643,7 +645,7 @@ void jtag_tap_handle_event(jtag_tap_t* tap, enum jtag_tap_event e);
|
||||
|
||||
/* jtag_add_dr_out() is a faster version of jtag_add_dr_scan()
|
||||
*
|
||||
* Current or end_state can not be TAP_RESET. end_state can be -1
|
||||
* Current or end_state can not be TAP_RESET. end_state can be TAP_INVALID
|
||||
*
|
||||
* num_bits[i] is the number of bits to clock out from value[i] LSB first.
|
||||
*
|
||||
@@ -666,7 +668,7 @@ extern void interface_jtag_add_dr_out(jtag_tap_t* tap, int num_fields, const int
|
||||
static __inline__ void jtag_add_dr_out(jtag_tap_t* tap, int num_fields, const int* num_bits, const u32* value,
|
||||
tap_state_t end_state)
|
||||
{
|
||||
if (end_state != -1)
|
||||
if (end_state != TAP_INVALID)
|
||||
cmd_queue_end_state = end_state;
|
||||
cmd_queue_cur_state = cmd_queue_end_state;
|
||||
interface_jtag_add_dr_out(tap, num_fields, num_bits, value, cmd_queue_end_state);
|
||||
|
||||
@@ -142,7 +142,7 @@ int usbprog_execute_queue(void)
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
LOG_DEBUG("end_state: %i", cmd->cmd.end_state->end_state);
|
||||
#endif
|
||||
if (cmd->cmd.end_state->end_state != -1)
|
||||
if (cmd->cmd.end_state->end_state != TAP_INVALID)
|
||||
usbprog_end_state(cmd->cmd.end_state->end_state);
|
||||
break;
|
||||
case JTAG_RESET:
|
||||
@@ -159,7 +159,7 @@ int usbprog_execute_queue(void)
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
LOG_DEBUG("runtest %i cycles, end in %i", cmd->cmd.runtest->num_cycles, cmd->cmd.runtest->end_state);
|
||||
#endif
|
||||
if (cmd->cmd.runtest->end_state != -1)
|
||||
if (cmd->cmd.runtest->end_state != TAP_INVALID)
|
||||
usbprog_end_state(cmd->cmd.runtest->end_state);
|
||||
usbprog_runtest(cmd->cmd.runtest->num_cycles);
|
||||
break;
|
||||
@@ -167,7 +167,7 @@ int usbprog_execute_queue(void)
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
LOG_DEBUG("statemove end in %i", cmd->cmd.statemove->end_state);
|
||||
#endif
|
||||
if (cmd->cmd.statemove->end_state != -1)
|
||||
if (cmd->cmd.statemove->end_state != TAP_INVALID)
|
||||
usbprog_end_state(cmd->cmd.statemove->end_state);
|
||||
usbprog_state_move();
|
||||
break;
|
||||
@@ -182,7 +182,7 @@ int usbprog_execute_queue(void)
|
||||
#ifdef _DEBUG_JTAG_IO_
|
||||
LOG_DEBUG("scan end in %i", cmd->cmd.scan->end_state);
|
||||
#endif
|
||||
if (cmd->cmd.scan->end_state != -1)
|
||||
if (cmd->cmd.scan->end_state != TAP_INVALID)
|
||||
usbprog_end_state(cmd->cmd.scan->end_state);
|
||||
scan_size = jtag_build_buffer(cmd->cmd.scan, &buffer);
|
||||
type = jtag_scan_type(cmd->cmd.scan);
|
||||
|
||||
@@ -269,7 +269,7 @@ int vsllink_execute_queue(void)
|
||||
case JTAG_END_STATE:
|
||||
DEBUG_JTAG_IO("end_state: %s", tap_state_name(cmd->cmd.end_state->end_state));
|
||||
|
||||
if (cmd->cmd.end_state->end_state != -1)
|
||||
if (cmd->cmd.end_state->end_state != TAP_INVALID)
|
||||
{
|
||||
vsllink_end_state(cmd->cmd.end_state->end_state);
|
||||
}
|
||||
@@ -279,7 +279,7 @@ int vsllink_execute_queue(void)
|
||||
DEBUG_JTAG_IO( "runtest %i cycles, end in %s", cmd->cmd.runtest->num_cycles, \
|
||||
tap_state_name(cmd->cmd.runtest->end_state));
|
||||
|
||||
if (cmd->cmd.runtest->end_state != -1)
|
||||
if (cmd->cmd.runtest->end_state != TAP_INVALID)
|
||||
{
|
||||
vsllink_end_state(cmd->cmd.runtest->end_state);
|
||||
}
|
||||
@@ -289,7 +289,7 @@ int vsllink_execute_queue(void)
|
||||
case JTAG_STATEMOVE:
|
||||
DEBUG_JTAG_IO("statemove end in %s", tap_state_name(cmd->cmd.statemove->end_state));
|
||||
|
||||
if (cmd->cmd.statemove->end_state != -1)
|
||||
if (cmd->cmd.statemove->end_state != TAP_INVALID)
|
||||
{
|
||||
vsllink_end_state(cmd->cmd.statemove->end_state);
|
||||
}
|
||||
@@ -305,7 +305,7 @@ int vsllink_execute_queue(void)
|
||||
break;
|
||||
|
||||
case JTAG_SCAN:
|
||||
if (cmd->cmd.scan->end_state != -1)
|
||||
if (cmd->cmd.scan->end_state != TAP_INVALID)
|
||||
{
|
||||
vsllink_end_state(cmd->cmd.scan->end_state);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user