armv7m: add generic trace support (TPIU, ITM, etc.)

This provides support for various trace-related subsystems in a
generic and expandable way.

Change-Id: I3a27fa7b8cfb111753088bb8c3d760dd12d1395f
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2538
Tested-by: jenkins
This commit is contained in:
Paul Fertser
2015-02-09 17:04:52 +03:00
committed by Spencer Oliver
parent 3e1dfdcb85
commit a09a75653d
17 changed files with 584 additions and 12 deletions
+13
View File
@@ -1932,6 +1932,16 @@ int cortex_m_examine(struct target *target)
armv7m->dap.tar_autoincr_block = (1 << 12);
}
/* Configure trace modules */
retval = target_write_u32(target, DCB_DEMCR, TRCENA | armv7m->demcr);
if (retval != ERROR_OK)
return retval;
if (armv7m->trace_config.config_type != DISABLED) {
armv7m_trace_tpiu_config(target);
armv7m_trace_itm_config(target);
}
/* NOTE: FPB and DWT are both optional. */
/* Setup FPB */
@@ -2324,6 +2334,9 @@ static const struct command_registration cortex_m_command_handlers[] = {
{
.chain = armv7m_command_handlers,
},
{
.chain = armv7m_trace_command_handlers,
},
{
.name = "cortex_m",
.mode = COMMAND_EXEC,