coresight tmc: Detect support for scatter gather
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Wed, 2 Aug 2017 16:22:12 +0000 (10:22 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 14:05:49 +0000 (16:05 +0200)
The SG unit in the TMC has been removed in Coresight SoC-600.
This is however advertised by DEVID:Bit 24 = 0b1. On the
previous generation, the bit is RES0, hence we can rely on the
DEVID to detect the support.

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@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.c
drivers/hwtracing/coresight/coresight-tmc.h

index 0c99ef7b9b2bc6a73b1149a11ead273487ee6043..bb409c485d05d277b9e3eb898ea99eeb29085be1 100644 (file)
@@ -306,6 +306,8 @@ static int tmc_etr_setup_caps(struct tmc_drvdata *drvdata,
        /* Set the unadvertised capabilities */
        tmc_etr_init_caps(drvdata, (u32)(unsigned long)dev_caps);
 
+       if (!(devid & TMC_DEVID_NOSCAT))
+               tmc_etr_set_cap(drvdata, TMC_ETR_SG);
        /*
         * ETR configuration uses a 40-bit AXI master in place of
         * the embedded SRAM of ETB/ETF.
index 13ab1008f1108266c3c09afb55f79a06b579501f..bb6a3e3314b8cc68e816584cf3c9da964fb8cca2 100644 (file)
@@ -69,6 +69,8 @@
 #define TMC_FFCR_STOP_ON_FLUSH BIT(12)
 
 
+#define TMC_DEVID_NOSCAT       BIT(24)
+
 enum tmc_config_type {
        TMC_CONFIG_TYPE_ETB,
        TMC_CONFIG_TYPE_ETR,
@@ -88,6 +90,9 @@ enum tmc_mem_intf_width {
        TMC_MEM_INTF_WIDTH_256BITS      = 8,
 };
 
+/* TMC ETR Capability bit definitions */
+#define TMC_ETR_SG                     (0x1U << 0)
+
 /**
  * struct tmc_drvdata - specifics associated to an TMC component
  * @base:      memory mapped base address for this component.