summaryrefslogtreecommitdiff
path: root/drivers/hwtracing/coresight/coresight-self-hosted-trace.h
diff options
context:
space:
mode:
authorSuzuki K Poulose <suzuki.poulose@arm.com>2021-09-14 13:26:32 +0300
committerMathieu Poirier <mathieu.poirier@linaro.org>2021-10-27 20:45:16 +0300
commit937d3f58cacf377cab7c32e475e1ffa91d611dce (patch)
tree9122fc9b2ca9fee22b8eb8291833ab5aefcf86a4 /drivers/hwtracing/coresight/coresight-self-hosted-trace.h
parent8c60acbcb982bfff14d1e85094474671c4f3d006 (diff)
downloadlinux-937d3f58cacf377cab7c32e475e1ffa91d611dce.tar.xz
coresight: etm4x: Save restore TRFCR_EL1
When the CPU enters a low power mode, the TRFCR_EL1 contents could be reset. Thus we need to save/restore the TRFCR_EL1 along with the ETM4x registers to allow the tracing. The TRFCR related helpers are in a new header file, as we need to use them for TRBE in the later patches. Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Mike Leach <mike.leach@linaro.org> Cc: Leo Yan <leo.yan@linaro.org> Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lore.kernel.org/r/20210914102641.1852544-2-suzuki.poulose@arm.com [Fixed cosmetic details] Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Diffstat (limited to 'drivers/hwtracing/coresight/coresight-self-hosted-trace.h')
-rw-r--r--drivers/hwtracing/coresight/coresight-self-hosted-trace.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/hwtracing/coresight/coresight-self-hosted-trace.h b/drivers/hwtracing/coresight/coresight-self-hosted-trace.h
new file mode 100644
index 000000000000..303d71911870
--- /dev/null
+++ b/drivers/hwtracing/coresight/coresight-self-hosted-trace.h
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Arm v8 Self-Hosted trace support.
+ *
+ * Copyright (C) 2021 ARM Ltd.
+ */
+
+#ifndef __CORESIGHT_SELF_HOSTED_TRACE_H
+#define __CORESIGHT_SELF_HOSTED_TRACE_H
+
+#include <asm/sysreg.h>
+
+static inline u64 read_trfcr(void)
+{
+ return read_sysreg_s(SYS_TRFCR_EL1);
+}
+
+static inline void write_trfcr(u64 val)
+{
+ write_sysreg_s(val, SYS_TRFCR_EL1);
+ isb();
+}
+
+#endif /* __CORESIGHT_SELF_HOSTED_TRACE_H */