aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2016-08-25 17:19:08 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-31 07:05:43 -0400
commit46a3d5cdb029471247b7be050332df399eca3ee1 (patch)
tree1d3fca4cdd853df5fb5830c6735a10743f1ba9e9 /drivers/hwtracing
parent1d37ae50671435e842c58b1429dfb0a6d065c42a (diff)
coresight: etm4x: request to retain power to the trace unit when active
The Coresight ETMv4 architecture provides a way to request to keep the power to the trace unit. This might help to collect the traces without the need to disable the CPU power management(entering/exiting deeper idle states). Trace PowerDown Control Register provides powerup request bit which when set requests the system to retain power to the trace unit and emulate the powerdown request. Typically, a trace unit drives a signal to the power controller to request that the trace unit core power domain is powered up. However, if the trace unit and the CPU are in the same power domain then the implementation might combine the trace unit power up status with a signal from the CPU. This patch requests to retain power to the trace unit when active and to remove when inactive. Note this change will only request but the behaviour depends on the implementation. However, it matches the exact behaviour expected when the external debugger is connected with respect to CPU power states. Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing')
-rw-r--r--drivers/hwtracing/coresight/coresight-etm4x.c12
-rw-r--r--drivers/hwtracing/coresight/coresight-etm4x.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
index b3bde2aec2b9..c8c7829f7046 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x.c
@@ -164,6 +164,13 @@ static void etm4_enable_hw(void *info)
164 writel_relaxed(config->vmid_mask0, drvdata->base + TRCVMIDCCTLR0); 164 writel_relaxed(config->vmid_mask0, drvdata->base + TRCVMIDCCTLR0);
165 writel_relaxed(config->vmid_mask1, drvdata->base + TRCVMIDCCTLR1); 165 writel_relaxed(config->vmid_mask1, drvdata->base + TRCVMIDCCTLR1);
166 166
167 /*
168 * Request to keep the trace unit powered and also
169 * emulation of powerdown
170 */
171 writel_relaxed(readl_relaxed(drvdata->base + TRCPDCR) | TRCPDCR_PU,
172 drvdata->base + TRCPDCR);
173
167 /* Enable the trace unit */ 174 /* Enable the trace unit */
168 writel_relaxed(1, drvdata->base + TRCPRGCTLR); 175 writel_relaxed(1, drvdata->base + TRCPRGCTLR);
169 176
@@ -294,6 +301,11 @@ static void etm4_disable_hw(void *info)
294 301
295 CS_UNLOCK(drvdata->base); 302 CS_UNLOCK(drvdata->base);
296 303
304 /* power can be removed from the trace unit now */
305 control = readl_relaxed(drvdata->base + TRCPDCR);
306 control &= ~TRCPDCR_PU;
307 writel_relaxed(control, drvdata->base + TRCPDCR);
308
297 control = readl_relaxed(drvdata->base + TRCPRGCTLR); 309 control = readl_relaxed(drvdata->base + TRCPRGCTLR);
298 310
299 /* EN, bit[0] Trace unit enable bit */ 311 /* EN, bit[0] Trace unit enable bit */
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h
index 5359c5197c1d..2629954429a1 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x.h
+++ b/drivers/hwtracing/coresight/coresight-etm4x.h
@@ -183,6 +183,9 @@
183#define TRCSTATR_IDLE_BIT 0 183#define TRCSTATR_IDLE_BIT 0
184#define ETM_DEFAULT_ADDR_COMP 0 184#define ETM_DEFAULT_ADDR_COMP 0
185 185
186/* PowerDown Control Register bits */
187#define TRCPDCR_PU BIT(3)
188
186/* secure state access levels */ 189/* secure state access levels */
187#define ETM_EXLEVEL_S_APP BIT(8) 190#define ETM_EXLEVEL_S_APP BIT(8)
188#define ETM_EXLEVEL_S_OS BIT(9) 191#define ETM_EXLEVEL_S_OS BIT(9)