armv7m_trace: get rid of the old tpiu code
Remove all the old tpiu code and replace it with a wrapper that uses the new commands, prints-out the new commands and informs about the deprecation. All the code that handles the deprecated tpiu commands is enclosed between the comments /* START_DEPRECATED_TPIU */ and /* END_DEPRECATED_TPIU */ so will be easy to remove it in the future. Change-Id: I70b0486770128203b923346382d9a90b8ec08439 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6030 Tested-by: jenkins Reviewed-by: Adrian M Negreanu <adrian.negreanu@nxp.com>
This commit is contained in:
@@ -18,33 +18,14 @@
|
||||
#ifndef OPENOCD_TARGET_ARMV7M_TRACE_H
|
||||
#define OPENOCD_TARGET_ARMV7M_TRACE_H
|
||||
|
||||
#include <server/server.h>
|
||||
#include <target/target.h>
|
||||
#include <command.h>
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Holds the interface to TPIU, ITM and DWT configuration functions.
|
||||
* Holds the interface to ITM and DWT configuration functions.
|
||||
*/
|
||||
|
||||
enum trace_config_type {
|
||||
TRACE_CONFIG_TYPE_DISABLED, /**< tracing is disabled */
|
||||
TRACE_CONFIG_TYPE_EXTERNAL, /**< trace output is captured externally */
|
||||
TRACE_CONFIG_TYPE_INTERNAL /**< trace output is handled by OpenOCD adapter driver */
|
||||
};
|
||||
|
||||
enum trace_internal_channel {
|
||||
TRACE_INTERNAL_CHANNEL_TCL_ONLY, /** trace data is sent only to 'tcl_trace' */
|
||||
TRACE_INTERNAL_CHANNEL_FILE, /** trace data is appended to a file */
|
||||
TRACE_INTERNAL_CHANNEL_TCP /** trace data is appended to a TCP/IP port*/
|
||||
};
|
||||
|
||||
enum tpiu_pin_protocol {
|
||||
TPIU_PIN_PROTOCOL_SYNC, /**< synchronous trace output */
|
||||
TPIU_PIN_PROTOCOL_ASYNC_MANCHESTER, /**< asynchronous output with Manchester coding */
|
||||
TPIU_PIN_PROTOCOL_ASYNC_UART /**< asynchronous output with NRZ coding */
|
||||
};
|
||||
|
||||
enum itm_ts_prescaler {
|
||||
ITM_TS_PRESCALE1, /**< no prescaling for the timestamp counter */
|
||||
ITM_TS_PRESCALE4, /**< refclock divided by 4 for the timestamp counter */
|
||||
@@ -53,19 +34,6 @@ enum itm_ts_prescaler {
|
||||
};
|
||||
|
||||
struct armv7m_trace_config {
|
||||
/** Currently active trace capture mode */
|
||||
enum trace_config_type config_type;
|
||||
|
||||
/** The used channel when internal mode is selected */
|
||||
enum trace_internal_channel internal_channel;
|
||||
|
||||
/** Currently active trace output mode */
|
||||
enum tpiu_pin_protocol pin_protocol;
|
||||
/** TPIU formatter enable/disable (in async mode) */
|
||||
bool formatter;
|
||||
/** Synchronous output port width */
|
||||
uint32_t port_size;
|
||||
|
||||
/** Bitmask of currently enabled ITM stimuli */
|
||||
uint32_t itm_ter[8];
|
||||
/** Identifier for multi-source trace stream formatting */
|
||||
@@ -80,27 +48,10 @@ struct armv7m_trace_config {
|
||||
bool itm_synchro_packets;
|
||||
/** Config ITM after target examine */
|
||||
bool itm_deferred_config;
|
||||
|
||||
/** Current frequency of TRACECLKIN (usually matches HCLK) */
|
||||
unsigned int traceclkin_freq;
|
||||
/** Current frequency of trace port */
|
||||
unsigned int trace_freq;
|
||||
/** Handle to output trace data in INTERNAL capture mode via file */
|
||||
FILE *trace_file;
|
||||
/** Handle to output trace data in INTERNAL capture mode via tcp */
|
||||
struct service *trace_service;
|
||||
};
|
||||
|
||||
extern const struct command_registration armv7m_trace_command_handlers[];
|
||||
|
||||
/**
|
||||
* Configure hardware accordingly to the current TPIU target settings
|
||||
*/
|
||||
int armv7m_trace_tpiu_config(struct target *target);
|
||||
/**
|
||||
* Disable TPIU data gathering at exit
|
||||
*/
|
||||
int armv7m_trace_tpiu_exit(struct target *target);
|
||||
/**
|
||||
* Configure hardware accordingly to the current ITM target settings
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user