jtag_tap_t *tap;
tap = etb->tap;
- if (tap==NULL)
+ if (tap == NULL)
return ERROR_FAIL;
if (buf_get_u32(tap->cur_instr, 0, tap->ir_length) != new_instr)
}
-static void etb_getbuf(uint8_t *in)
+static void etb_getbuf(jtag_callback_data_t arg)
{
- *((uint32_t *)in)=buf_get_u32(in, 0, 32);
+ uint8_t *in = (uint8_t *)arg;
+ *((uint32_t *)in) = buf_get_u32(in, 0, 32);
}
else
buf_set_u32(fields[1].out_value, 0, 7, 0);
- fields[0].in_value = (uint8_t *)(data+i);
+ fields[0].in_value = (uint8_t *)(data + i);
jtag_add_dr_scan(3, fields, jtag_get_end_state());
- jtag_add_callback(etb_getbuf, (uint8_t *)(data+i));
+ jtag_add_callback(etb_getbuf, (jtag_callback_data_t)(data + i));
}
jtag_execute_queue();
uint8_t reg_addr = etb_reg->addr & 0x7f;
scan_field_t fields[3];
- LOG_DEBUG("%i", etb_reg->addr);
+ LOG_DEBUG("%i", (int)(etb_reg->addr));
jtag_set_end_state(TAP_IDLE);
etb_scann(etb_reg->etb, 0x0);
uint8_t reg_addr = etb_reg->addr & 0x7f;
scan_field_t fields[3];
- LOG_DEBUG("%i: 0x%8.8x", etb_reg->addr, value);
+ LOG_DEBUG("%i: 0x%8.8" PRIx32 "", (int)(etb_reg->addr), value);
jtag_set_end_state(TAP_IDLE);
etb_scann(etb_reg->etb, 0x0);
return ERROR_FAIL;
}
- tap = jtag_tap_by_string( args[1] );
+ tap = jtag_tap_by_string(args[1]);
if (tap == NULL)
{
- command_print(cmd_ctx, "Tap: %s does not exist", args[1] );
+ command_print(cmd_ctx, "Tap: %s does not exist", args[1]);
return ERROR_FAIL;
}
if (etb_timeout == 0)
{
- LOG_ERROR("AcqComp set but DFEmpty won't go high, ETB status: 0x%x",
+ LOG_ERROR("AcqComp set but DFEmpty won't go high, ETB status: 0x%" PRIx32 "",
buf_get_u32(etb_status_reg->value, 0, etb_status_reg->size));
}
etm_ctx->trace_data[j].flags |= ETMV1_TRIGGER_CYCLE;
}
- /* trace word j+1 */
- etm_ctx->trace_data[j+1].pipestat = (trace_data[i] & 0x100) >> 8;
- etm_ctx->trace_data[j+1].packet = (trace_data[i] & 0x7800) >> 11;
- etm_ctx->trace_data[j+1].flags = 0;
+ /* trace word j + 1 */
+ etm_ctx->trace_data[j + 1].pipestat = (trace_data[i] & 0x100) >> 8;
+ etm_ctx->trace_data[j + 1].packet = (trace_data[i] & 0x7800) >> 11;
+ etm_ctx->trace_data[j + 1].flags = 0;
if ((trace_data[i] & 0x8000) >> 15)
{
- etm_ctx->trace_data[j+1].flags |= ETMV1_TRACESYNC_CYCLE;
+ etm_ctx->trace_data[j + 1].flags |= ETMV1_TRACESYNC_CYCLE;
}
- if (etm_ctx->trace_data[j+1].pipestat == STAT_TR)
+ if (etm_ctx->trace_data[j + 1].pipestat == STAT_TR)
{
- etm_ctx->trace_data[j+1].pipestat = etm_ctx->trace_data[j+1].packet & 0x7;
- etm_ctx->trace_data[j+1].flags |= ETMV1_TRIGGER_CYCLE;
+ etm_ctx->trace_data[j + 1].pipestat = etm_ctx->trace_data[j + 1].packet & 0x7;
+ etm_ctx->trace_data[j + 1].flags |= ETMV1_TRIGGER_CYCLE;
}
- /* trace word j+2 */
- etm_ctx->trace_data[j+2].pipestat = (trace_data[i] & 0x10000) >> 16;
- etm_ctx->trace_data[j+2].packet = (trace_data[i] & 0x780000) >> 19;
- etm_ctx->trace_data[j+2].flags = 0;
+ /* trace word j + 2 */
+ etm_ctx->trace_data[j + 2].pipestat = (trace_data[i] & 0x10000) >> 16;
+ etm_ctx->trace_data[j + 2].packet = (trace_data[i] & 0x780000) >> 19;
+ etm_ctx->trace_data[j + 2].flags = 0;
if ((trace_data[i] & 0x800000) >> 23)
{
- etm_ctx->trace_data[j+2].flags |= ETMV1_TRACESYNC_CYCLE;
+ etm_ctx->trace_data[j + 2].flags |= ETMV1_TRACESYNC_CYCLE;
}
- if (etm_ctx->trace_data[j+2].pipestat == STAT_TR)
+ if (etm_ctx->trace_data[j + 2].pipestat == STAT_TR)
{
- etm_ctx->trace_data[j+2].pipestat = etm_ctx->trace_data[j+2].packet & 0x7;
- etm_ctx->trace_data[j+2].flags |= ETMV1_TRIGGER_CYCLE;
+ etm_ctx->trace_data[j + 2].pipestat = etm_ctx->trace_data[j + 2].packet & 0x7;
+ etm_ctx->trace_data[j + 2].flags |= ETMV1_TRIGGER_CYCLE;
}
j += 3;
etm_ctx->trace_data[j].flags |= ETMV1_TRIGGER_CYCLE;
}
- /* trace word j+1 */
- etm_ctx->trace_data[j+1].pipestat = (trace_data[i] & 0x7000) >> 12;
- etm_ctx->trace_data[j+1].packet = (trace_data[i] & 0x7f8000) >> 15;
- etm_ctx->trace_data[j+1].flags = 0;
+ /* trace word j + 1 */
+ etm_ctx->trace_data[j + 1].pipestat = (trace_data[i] & 0x7000) >> 12;
+ etm_ctx->trace_data[j + 1].packet = (trace_data[i] & 0x7f8000) >> 15;
+ etm_ctx->trace_data[j + 1].flags = 0;
if ((trace_data[i] & 0x800000) >> 23)
{
- etm_ctx->trace_data[j+1].flags |= ETMV1_TRACESYNC_CYCLE;
+ etm_ctx->trace_data[j + 1].flags |= ETMV1_TRACESYNC_CYCLE;
}
- if (etm_ctx->trace_data[j+1].pipestat == STAT_TR)
+ if (etm_ctx->trace_data[j + 1].pipestat == STAT_TR)
{
- etm_ctx->trace_data[j+1].pipestat = etm_ctx->trace_data[j+1].packet & 0x7;
- etm_ctx->trace_data[j+1].flags |= ETMV1_TRIGGER_CYCLE;
+ etm_ctx->trace_data[j + 1].pipestat = etm_ctx->trace_data[j + 1].packet & 0x7;
+ etm_ctx->trace_data[j + 1].flags |= ETMV1_TRIGGER_CYCLE;
}
j += 2;