OSDN Git Service

coresight: Add generic TMC sg table framework
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Wed, 11 Jul 2018 19:40:20 +0000 (13:40 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Jul 2018 11:52:57 +0000 (13:52 +0200)
commit99443ea19e8bb0fee5fb6f4ed9cec11fd825061f
treebeb9ead4e8b9606f6397577ae2dff8400179b877
parented2cfb2b3cd8f32419c0abea6cd4648ff99fca86
coresight: Add generic TMC sg table framework

This patch introduces a generic sg table data structure and
associated operations. An SG table can be used to map a set
of Data pages where the trace data could be stored by the TMC
ETR. The information about the data pages could be stored in
different formats, depending on the type of the underlying
SG mechanism (e.g, TMC ETR SG vs Coresight CATU). The generic
structure provides book keeping of the pages used for the data
as well as the table contents. The table should be filled by
the user of the infrastructure.

A table can be created by specifying the number of data pages
as well as the number of table pages required to hold the
pointers, where the latter could be different for different
types of tables. The pages are mapped in the appropriate dma
data direction mode (i.e, DMA_TO_DEVICE for table pages
and DMA_FROM_DEVICE for data pages).  The framework can optionally
accept a set of allocated data pages (e.g, perf ring buffer) and
map them accordingly. The table and data pages are vmap'ed to allow
easier access by the drivers. The framework also provides helpers to
sync the data written to the pages with appropriate directions.

This will be later used by the TMC ETR SG unit and CATU.

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight-tmc-etr.c
drivers/hwtracing/coresight/coresight-tmc.h