summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/hwtracing/coresight/coresight-priv.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h
index 62fcd98cc7cf..5fd9900e2c0b 100644
--- a/drivers/hwtracing/coresight/coresight-priv.h
+++ b/drivers/hwtracing/coresight/coresight-priv.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2012, 2016 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -52,6 +52,27 @@ static inline void CS_UNLOCK(void __iomem *addr)
} while (0);
}
+static inline bool coresight_authstatus_enabled(void __iomem *addr)
+{
+ int ret;
+ unsigned auth_val;
+
+ if (!addr)
+ return false;
+
+ auth_val = readl_relaxed(addr + CORESIGHT_AUTHSTATUS);
+
+ if ((0x2 == BMVAL(auth_val, 0, 1)) ||
+ (0x2 == BMVAL(auth_val, 2, 3)) ||
+ (0x2 == BMVAL(auth_val, 4, 5)) ||
+ (0x2 == BMVAL(auth_val, 6, 7)))
+ ret = false;
+ else
+ ret = true;
+
+ return ret;
+}
+
#ifdef CONFIG_CORESIGHT_SOURCE_ETM3X
extern int etm_readl_cp14(u32 off, unsigned int *val);
extern int etm_writel_cp14(u32 off, u32 val);