void jtag_add_ir_scan(int in_num_fields, scan_field_t *in_fields, tap_state_t state)
{
- if (jtag_verify&&jtag_verify_capture_ir)
+ if (jtag_verify && jtag_verify_capture_ir)
{
/* 8 x 32 bit id's is enough for all invocations */
/* if we are to run a verification of the ir scan, we need to get the input back.
* We may have to allocate space if the caller didn't ask for the input back.
*/
- in_fields[j].check_value=in_fields[j].tap->expected;
- in_fields[j].check_mask=in_fields[j].tap->expected_mask;
+ in_fields[j].check_value = in_fields[j].tap->expected;
+ in_fields[j].check_mask = in_fields[j].tap->expected_mask;
}
jtag_add_scan_check(jtag_add_ir_scan_noverify, in_num_fields, in_fields, state);
} else
return;
}
- if ( tap_state_transition(cur_state, true) != path[i]
+ if (tap_state_transition(cur_state, true) != path[i]
&& tap_state_transition(cur_state, false) != path[i])
{
LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition",
{
tap_state_t cur_state = cmd_queue_cur_state;
- LOG_DEBUG( "cur_state=%s goal_state=%s",
+ LOG_DEBUG("cur_state=%s goal_state=%s",
tap_state_name(cur_state),
tap_state_name(goal_state) );
- if (goal_state==cur_state )
+ if (goal_state == cur_state )
; /* nothing to do */
- else if ( goal_state==TAP_RESET )
+ else if (goal_state == TAP_RESET )
{
jtag_add_tlr();
}
- else if ( tap_is_state_stable(cur_state) && tap_is_state_stable(goal_state) )
+ else if (tap_is_state_stable(cur_state) && tap_is_state_stable(goal_state) )
{
unsigned tms_bits = tap_get_tms_path(cur_state, goal_state);
unsigned tms_count = tap_get_tms_path_len(cur_state, goal_state);
jtag_add_pathmove(tms_count, moves);
}
- else if ( tap_state_transition(cur_state, true) == goal_state
+ else if (tap_state_transition(cur_state, true) == goal_state
|| tap_state_transition(cur_state, false) == goal_state )
{
jtag_add_pathmove(1, &goal_state);
*/
if ((jtag_reset_config & RESET_HAS_SRST)&&
(jtag_reset_config & RESET_HAS_TRST)&&
- ((jtag_reset_config & RESET_SRST_PULLS_TRST)==0))
+ ((jtag_reset_config & RESET_SRST_PULLS_TRST) == 0))
{
if (((req_tlr_or_trst&&!jtag_trst)||
- (!req_tlr_or_trst&&jtag_trst))&&
+ (!req_tlr_or_trst && jtag_trst))&&
((req_srst&&!jtag_srst)||
- (!req_srst&&jtag_srst)))
+ (!req_srst && jtag_srst)))
{
/* FIX!!! srst_pulls_trst allows 1,1 => 0,0 transition.... */
//LOG_ERROR("BUG: transition of req_tlr_or_trst and req_srst in the same jtag_add_reset() call is undefined");
{
assert(field->in_value != NULL);
- if (value==NULL)
+ if (value == NULL)
{
/* no checking to do */
return;
jtag_execute_queue_noclear();
- int retval=jtag_check_value_inner(field->in_value, value, mask, field->num_bits);
+ int retval = jtag_check_value_inner(field->in_value, value, mask, field->num_bits);
jtag_set_error(retval);
}
static void jtag_examine_chain_end(uint8_t *idcodes, unsigned count, unsigned max)
{
bool triggered = false;
- for ( ; count < max - 31; count += 32)
+ for (; count < max - 31; count += 32)
{
uint32_t idcode = buf_get_u32(idcodes, count, 32);
// do not trigger the warning if the data looks good
total_ir_length = 0;
for (;;){
tap = jtag_tap_next_enabled(tap);
- if ( tap == NULL ){
+ if (tap == NULL ){
break;
}
total_ir_length += tap->ir_length;
int val;
for (;;){
tap = jtag_tap_next_enabled(tap);
- if ( tap == NULL ){
+ if (tap == NULL ){
break;
}
LOG_DEBUG("Init JTAG chain");
tap = jtag_tap_next_enabled(NULL);
- if ( tap == NULL ){
+ if (tap == NULL ){
LOG_ERROR("There are no enabled taps?");
return ERROR_JTAG_INIT_FAILED;
}
jtag_add_tlr();
- if ((retval=jtag_execute_queue()) != ERROR_OK)
+ if ((retval = jtag_execute_queue()) != ERROR_OK)
return retval;
/* examine chain first, as this could discover the real chain layout */
{
int retval;
- if ((retval=jtag_interface_init(cmd_ctx)) != ERROR_OK)
+ if ((retval = jtag_interface_init(cmd_ctx)) != ERROR_OK)
return retval;
LOG_DEBUG("Trying to bring the JTAG controller to life by asserting TRST / RESET");
if (jtag_reset_config & RESET_HAS_SRST)
{
jtag_add_reset(1, 1);
- if ((jtag_reset_config & RESET_SRST_PULLS_TRST)==0)
+ if ((jtag_reset_config & RESET_SRST_PULLS_TRST) == 0)
jtag_add_reset(0, 1);
}
jtag_add_reset(0, 0);
int jtag_init(struct command_context_s *cmd_ctx)
{
int retval;
- if ((retval=jtag_interface_init(cmd_ctx)) != ERROR_OK)
+ if ((retval = jtag_interface_init(cmd_ctx)) != ERROR_OK)
return retval;
- if (jtag_init_inner(cmd_ctx)==ERROR_OK)
+ if (jtag_init_inner(cmd_ctx) == ERROR_OK)
{
return ERROR_OK;
}