]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/hwtracing/coresight/coresight-etm4x.c
coresight: etm4x: request to retain power to the trace unit when active
[mirror_ubuntu-zesty-kernel.git] / drivers / hwtracing / coresight / coresight-etm4x.c
index d8721fb8da9903d1b7a448f23782d89880e1ce3b..c8c7829f704661c18e16a3531add7474637cdc5d 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/uaccess.h>
 #include <linux/perf_event.h>
 #include <linux/pm_runtime.h>
-#include <linux/perf_event.h>
 #include <asm/sections.h>
 #include <asm/local.h>
 
@@ -165,6 +164,13 @@ static void etm4_enable_hw(void *info)
        writel_relaxed(config->vmid_mask0, drvdata->base + TRCVMIDCCTLR0);
        writel_relaxed(config->vmid_mask1, drvdata->base + TRCVMIDCCTLR1);
 
+       /*
+        * Request to keep the trace unit powered and also
+        * emulation of powerdown
+        */
+       writel_relaxed(readl_relaxed(drvdata->base + TRCPDCR) | TRCPDCR_PU,
+                      drvdata->base + TRCPDCR);
+
        /* Enable the trace unit */
        writel_relaxed(1, drvdata->base + TRCPRGCTLR);
 
@@ -295,6 +301,11 @@ static void etm4_disable_hw(void *info)
 
        CS_UNLOCK(drvdata->base);
 
+       /* power can be removed from the trace unit now */
+       control = readl_relaxed(drvdata->base + TRCPDCR);
+       control &= ~TRCPDCR_PU;
+       writel_relaxed(control, drvdata->base + TRCPDCR);
+
        control = readl_relaxed(drvdata->base + TRCPRGCTLR);
 
        /* EN, bit[0] Trace unit enable bit */