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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
40d8ebf071
commit
a467dae11d
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user