command_print(cmd_ctx, "ETM v%d.%d",
etm->bcd_vers >> 4, etm->bcd_vers & 0xf);
command_print(cmd_ctx, "pairs of address comparators: %i",
- (etm->config >> 0) & 0x0f);
+ (int) (etm->config >> 0) & 0x0f);
command_print(cmd_ctx, "data comparators: %i",
- (etm->config >> 4) & 0x0f);
+ (int) (etm->config >> 4) & 0x0f);
command_print(cmd_ctx, "memory map decoders: %i",
- (etm->config >> 8) & 0x1f);
+ (int) (etm->config >> 8) & 0x1f);
command_print(cmd_ctx, "number of counters: %i",
- (etm->config >> 13) & 0x07);
+ (int) (etm->config >> 13) & 0x07);
command_print(cmd_ctx, "sequencer %spresent",
- (etm->config & (1 << 16)) ? "" : "not ");
+ (int) (etm->config & (1 << 16)) ? "" : "not ");
command_print(cmd_ctx, "number of ext. inputs: %i",
- (etm->config >> 17) & 0x07);
+ (int) (etm->config >> 17) & 0x07);
command_print(cmd_ctx, "number of ext. outputs: %i",
- (etm->config >> 20) & 0x07);
+ (int) (etm->config >> 20) & 0x07);
command_print(cmd_ctx, "FIFO full %spresent",
- (etm->config & (1 << 23)) ? "" : "not ");
+ (int) (etm->config & (1 << 23)) ? "" : "not ");
if (etm->bcd_vers < 0x20)
command_print(cmd_ctx, "protocol version: %i",
- (etm->config >> 28) & 0x07);
+ (int) (etm->config >> 28) & 0x07);
else {
command_print(cmd_ctx, "trace start/stop %spresent",
(etm->config & (1 << 26)) ? "" : "not ");
command_print(cmd_ctx, "number of context comparators: %i",
- (etm->config >> 24) & 0x03);
+ (int) (etm->config >> 24) & 0x03);
}
/* SYS_CONFIG isn't present before ETMv1.2 */
target_t *target;
armv4_5_common_t *armv4_5;
arm7_9_common_t *arm7_9;
+ etm_context_t *etm;
trace_status_t trace_status;
target = get_current_target(cmd_ctx);
command_print(cmd_ctx, "current target doesn't have an ETM configured");
return ERROR_OK;
}
+ etm = arm7_9->etm_ctx;
- trace_status = arm7_9->etm_ctx->capture_driver->status(arm7_9->etm_ctx);
+ /* ETM status */
+ if (etm->bcd_vers >= 0x11) {
+ reg_t *reg;
+ reg = etm_reg_lookup(etm, ETM_STATUS);
+ if (!reg)
+ return ERROR_OK;
+ if (etm_get_reg(reg) == ERROR_OK) {
+ unsigned s = buf_get_u32(reg->value, 0, reg->size);
+
+ command_print(cmd_ctx, "etm: %s%s%s%s",
+ /* bit(1) == progbit */
+ (etm->bcd_vers >= 0x12)
+ ? ((s & (1 << 1))
+ ? "disabled" : "enabled")
+ : "?",
+ ((s & (1 << 3)) && etm->bcd_vers >= 0x31)
+ ? " triggered" : "",
+ ((s & (1 << 2)) && etm->bcd_vers >= 0x12)
+ ? " start/stop" : "",
+ ((s & (1 << 0)) && etm->bcd_vers >= 0x11)
+ ? " untraced-overflow" : "");
+ } /* else ignore and try showing trace port status */
+ }
+
+ /* Trace Port Driver status */
+ trace_status = etm->capture_driver->status(etm);
if (trace_status == TRACE_IDLE)
{
- command_print(cmd_ctx, "tracing is idle");
+ command_print(cmd_ctx, "%s: idle", etm->capture_driver->name);
}
else
{
static char *completed = " completed";
static char *running = " is running";
- static char *overflowed = ", trace overflowed";
- static char *triggered = ", trace triggered";
+ static char *overflowed = ", overflowed";
+ static char *triggered = ", triggered";
- command_print(cmd_ctx, "trace collection%s%s%s",
+ command_print(cmd_ctx, "%s: trace collection%s%s%s",
+ etm->capture_driver->name,
(trace_status & TRACE_RUNNING) ? running : completed,
(trace_status & TRACE_OVERFLOWED) ? overflowed : "",
(trace_status & TRACE_TRIGGERED) ? triggered : "");
- if (arm7_9->etm_ctx->trace_depth > 0)
+ if (etm->trace_depth > 0)
{
- command_print(cmd_ctx, "%i frames of trace data read", (int)(arm7_9->etm_ctx->trace_depth));
+ command_print(cmd_ctx, "%i frames of trace data read",
+ (int)(etm->trace_depth));
}
}