• Suzuki K Poulose's avatar
    coresight: tmc-etr: Add transparent buffer management · 75f4e361
    Suzuki K Poulose authored
    The TMC-ETR can use the target trace buffer in two different modes.
    Normal physically contiguous mode and a discontiguous list pages in
    Scatter-Gather mode. Also we have dedicated Coresight component, CATU
    (Coresight Address Translation Unit) to provide improved scatter-gather
    mode in Coresight SoC-600. This complicates the management of the
    buffer used for trace, depending on the mode in which ETR is configured.
    
    So, this patch adds a transparent layer for managing the ETR buffer
    which abstracts the basic operations on the buffer (alloc, free,
    sync and retrieve the data) and uses the mode specific helpers to
    do the actual operation. This also allows the ETR driver to choose
    the best mode for a given use case and adds the flexibility to
    fallback to a different mode, without duplicating the code.
    
    The patch also adds the "normal" flat memory mode and switches
    the sysfs driver to use the new layer.
    
    Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
    Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    75f4e361
coresight-tmc.h 8.83 KB