summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShashank Mittal <mittals@codeaurora.org>2015-12-23 10:03:20 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:10:52 -0700
commit898728e145447bda0ad995342b72002dca70a0bf (patch)
tree9a7ad39d4ddc04d81393a59cfb0445e235f299e9
parentf3ee02be6e5b6d6d987311ff56fb2b4cb8f8d70c (diff)
coresight: add support to read AUTHSTATUS
The status of the CoreSight fuses can be derived from the AUTHSTATUS register. This patch add support to read AUTHSTATUS, which could be used by Coresight device drivers to determine if that component is functional in hardware. Change-Id: I6b7ac2a3558c238ac5fca452ddfb6c88eef14b8b Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
-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);