/* TMC ETR Capability bit definitions */ #define TMC_ETR_SG (0x1U << 0) /* ETR has separate read/write cache encodings */ #define TMC_ETR_AXI_ARCACHE (0x1U << 1) /* * TMC_ETR_SAVE_RESTORE - Values of RRP/RWP/STS.Full are * retained when TMC leaves Disabled state, allowing us to continue * the tracing from a point where we stopped. This also implies that * the RRP/RWP/STS.Full should always be programmed to the correct * value. Unfortunately this is not advertised by the hardware, * so we have to rely on PID of the IP to detect the functionality.
*/ #define TMC_ETR_SAVE_RESTORE (0x1U << 2)
/* TMC metadata region for ETR and ETF configurations */ struct tmc_crash_metadata {
uint32_t crc32_mdata; /* crc of metadata */
uint32_t crc32_tdata; /* crc of tracedata */
uint32_t version; /* 31:16 Major version, 15:0 Minor version */
uint32_t valid; /* Indicate if this ETF/ETR was enabled */
uint32_t tmc_ram_size; /* Ram Size register */
uint32_t tmc_sts; /* Status register */
uint32_t tmc_mode; /* Mode register */
uint32_t tmc_ffcr; /* Formatter and flush control register */
uint32_t tmc_ffsr; /* Formatter and flush status register */
uint32_t reserved32;
uint64_t tmc_rrp; /* Ram Read pointer register */
uint64_t tmc_rwp; /* Ram Write pointer register */
uint64_t tmc_dba; /* Data buffer address register */
uint64_t trace_paddr; /* Phys address of trace buffer */
uint64_t reserved64[3];
};
enum etr_mode {
ETR_MODE_FLAT, /* Uses contiguous flat buffer */
ETR_MODE_ETR_SG, /* Uses in-built TMC ETR SG mechanism */
ETR_MODE_CATU, /* Use SG mechanism in CATU */
ETR_MODE_RESRV, /* Use reserved region contiguous buffer */
ETR_MODE_AUTO, /* Use the default mechanism */
};
struct etr_buf_operations;
/** * struct etr_buf - Details of the buffer used by ETR * refcount ; Number of sources currently using this etr_buf. * @mode : Mode of the ETR buffer, contiguous, Scatter Gather etc. * @full : Trace data overflow * @size : Size of the buffer. * @hwaddr : Address to be programmed in the TMC:DBA{LO,HI} * @offset : Offset of the trace data in the buffer for consumption. * @len : Available trace data @buf (may round up to the beginning). * @ops : ETR buffer operations for the mode. * @private : Backend specific information for the buf
*/ struct etr_buf {
refcount_t refcount; enum etr_mode mode; bool full;
ssize_t size;
dma_addr_t hwaddr; unsignedlong offset;
s64 len; conststruct etr_buf_operations *ops; void *private;
};
/** * @paddr : Start address of reserved memory region. * @vaddr : Corresponding CPU virtual address. * @size : Size of reserved memory region. * @offset : Offset of the trace data in the buffer for consumption. * @reading : Flag to indicate if reading is active * @len : Available trace data @buf (may round up to the beginning).
*/ struct tmc_resrv_buf {
phys_addr_t paddr; void *vaddr;
size_t size; unsignedlong offset; bool reading;
s64 len;
};
/** * struct tmc_drvdata - specifics associated to an TMC component * @atclk: optional clock for the core parts of the TMC. * @pclk: APB clock if present, otherwise NULL * @base: memory mapped base address for this component. * @csdev: component vitals needed by the framework. * @miscdev: specifics to handle "/dev/xyz.tmc" entry. * @crashdev: specifics to handle "/dev/crash_tmc_xyz" entry for reading * crash tracedata. * @spinlock: only one at a time pls. * @pid: Process ID of the process that owns the session that is using * this component. For example this would be the pid of the Perf * process. * @stop_on_flush: Stop on flush trigger user configuration. * @buf: Snapshot of the trace data for ETF/ETB. * @etr_buf: details of buffer used in TMC-ETR * @len: size of the available trace for ETF/ETB. * @size: trace buffer size for this TMC (common for all modes). * @max_burst_size: The maximum burst size that can be initiated by * TMC-ETR on AXI bus. * @config_type: TMC variant, must be of type @tmc_config_type. * @memwidth: width of the memory interface databus, in bytes. * @trigger_cntr: amount of words to store after a trigger. * @etr_caps: Bitmask of capabilities of the TMC ETR, inferred from the * device configuration register (DEVID) * @idr: Holds etr_bufs allocated for this ETR. * @idr_mutex: Access serialisation for idr. * @sysfs_buf: SYSFS buffer for ETR. * @perf_buf: PERF buffer for ETR. * @resrv_buf: Used by ETR as hardware trace buffer and for trace data * retention (after crash) only when ETR_MODE_RESRV buffer * mode is enabled. Used by ETF for trace data retention * (after crash) by default. * @crash_mdata: Reserved memory for storing tmc crash metadata. * Used by ETR/ETF.
*/ struct tmc_drvdata { struct clk *atclk; struct clk *pclk; void __iomem *base; struct coresight_device *csdev; struct miscdevice miscdev; struct miscdevice crashdev;
raw_spinlock_t spinlock;
pid_t pid; bool reading; bool stop_on_flush; union { char *buf; /* TMC ETB */ struct etr_buf *etr_buf; /* TMC ETR */
};
u32 len;
u32 size;
u32 max_burst_size; enum tmc_config_type config_type; enum tmc_mem_intf_width memwidth;
u32 trigger_cntr;
u32 etr_caps; enum etr_mode etr_mode; struct idr idr; struct mutex idr_mutex; struct etr_buf *sysfs_buf; struct etr_buf *perf_buf; struct tmc_resrv_buf resrv_buf; struct tmc_resrv_buf crash_mdata;
};
/** * struct tmc_pages - Collection of pages used for SG. * @nr_pages: Number of pages in the list. * @daddrs: Array of DMA'able page address. * @pages: Array pages for the buffer.
*/ struct tmc_pages { int nr_pages;
dma_addr_t *daddrs; struct page **pages;
};
/* * struct tmc_sg_table - Generic SG table for TMC * @dev: Device for DMA allocations * @table_vaddr: Contiguous Virtual address for PageTable * @data_vaddr: Contiguous Virtual address for Data Buffer * @table_daddr: DMA address of the PageTable base * @node: Node for Page allocations * @table_pages: List of pages & dma address for Table * @data_pages: List of pages & dma address for Data
*/ struct tmc_sg_table { struct device *dev; void *table_vaddr; void *data_vaddr;
dma_addr_t table_daddr; int node; struct tmc_pages table_pages; struct tmc_pages data_pages;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.