aboutsummaryrefslogtreecommitdiff
path: root/drivers/hwtracing/coresight/coresight-etm4x.c
diff options
context:
space:
mode:
authorGravatar Mathieu Poirier <mathieu.poirier@linaro.org> 2015-05-13 10:34:20 -0600
committerGravatar Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2015-05-24 11:11:21 -0700
commita467dae11d57c60dabf9f85d7691e6ce097fc424 (patch)
treeb9f00ada69fcfaf8cea0489d42c2d6fd8e37a1e7 /drivers/hwtracing/coresight/coresight-etm4x.c
parentcoresight-etm4x: Controls pertaining to the VM ID functions (diff)
downloadlinux-a467dae11d57c60dabf9f85d7691e6ce097fc424.tar.gz
linux-a467dae11d57c60dabf9f85d7691e6ce097fc424.tar.bz2
linux-a467dae11d57c60dabf9f85d7691e6ce097fc424.zip
coresight-etm4x: Read only access to the main management registers
Having access to the ETMv4 management registers is very useful as they give meaningful information on how the IP block has been configured at synthesis time. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing/coresight/coresight-etm4x.c')
-rw-r--r--drivers/hwtracing/coresight/coresight-etm4x.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
index 02ee6fc97ddf..0568e4413411 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x.c
@@ -2200,7 +2200,58 @@ static struct attribute *coresight_etmv4_attrs[] = {
&dev_attr_cpu.attr,
NULL,
};
-ATTRIBUTE_GROUPS(coresight_etmv4);
+
+#define coresight_simple_func(name, offset) \
+static ssize_t name##_show(struct device *_dev, \
+ struct device_attribute *attr, char *buf) \
+{ \
+ struct etmv4_drvdata *drvdata = dev_get_drvdata(_dev->parent); \
+ return scnprintf(buf, PAGE_SIZE, "0x%x\n", \
+ readl_relaxed(drvdata->base + offset)); \
+} \
+DEVICE_ATTR_RO(name)
+
+coresight_simple_func(trcoslsr, TRCOSLSR);
+coresight_simple_func(trcpdcr, TRCPDCR);
+coresight_simple_func(trcpdsr, TRCPDSR);
+coresight_simple_func(trclsr, TRCLSR);
+coresight_simple_func(trcauthstatus, TRCAUTHSTATUS);
+coresight_simple_func(trcdevid, TRCDEVID);
+coresight_simple_func(trcdevtype, TRCDEVTYPE);
+coresight_simple_func(trcpidr0, TRCPIDR0);
+coresight_simple_func(trcpidr1, TRCPIDR1);
+coresight_simple_func(trcpidr2, TRCPIDR2);
+coresight_simple_func(trcpidr3, TRCPIDR3);
+
+static struct attribute *coresight_etmv4_mgmt_attrs[] = {
+ &dev_attr_trcoslsr.attr,
+ &dev_attr_trcpdcr.attr,
+ &dev_attr_trcpdsr.attr,
+ &dev_attr_trclsr.attr,
+ &dev_attr_trcauthstatus.attr,
+ &dev_attr_trcdevid.attr,
+ &dev_attr_trcdevtype.attr,
+ &dev_attr_trcpidr0.attr,
+ &dev_attr_trcpidr1.attr,
+ &dev_attr_trcpidr2.attr,
+ &dev_attr_trcpidr3.attr,
+ NULL,
+};
+
+static const struct attribute_group coresight_etmv4_group = {
+ .attrs = coresight_etmv4_attrs,
+};
+
+static const struct attribute_group coresight_etmv4_mgmt_group = {
+ .attrs = coresight_etmv4_mgmt_attrs,
+ .name = "mgmt",
+};
+
+static const struct attribute_group *coresight_etmv4_groups[] = {
+ &coresight_etmv4_group,
+ &coresight_etmv4_mgmt_group,
+ NULL,
+};
static void etm4_init_arch_data(void *info)
{