This series add support for coresight device name. In this way, nodes with specific names can be generated under sysfs, not just names with prefixes and index numbers. The coresight device can be quickly identified by the coresight names of sysfs nodes. This also allows using same names for CoreSight devices across different targets. This makes it easy to develop common scripts, which can be run across targets. Meanwhile, the script can use the same device name to control the same coresight device.
This series patches base on coresight-next repo http://git.linaro.org/kernel/coresight.git/log/?h=next
Tao Zhang (2): coresight: Add support for device names dt-bindings: arm: add property for coresight component name
Documentation/devicetree/bindings/arm/coresight.txt | 2 ++ drivers/hwtracing/coresight/coresight-core.c | 6 ++++++ 2 files changed, 8 insertions(+)
Add support to read device names from device tree entries. Before the previous process of allocating coresight device name, try to read the coresight device name from device tree entries. If it is read, the device name will be returned directly. If it is not read, the original allocation name process will be followed.
Signed-off-by: Tingwei Zhang tingwei@codeaurora.org Signed-off-by: Tao Zhang taozha@codeaurora.org --- drivers/hwtracing/coresight/coresight-core.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index 4ba801d..b79c726 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -1640,6 +1640,12 @@ char *coresight_alloc_device_name(struct coresight_dev_list *dict, int idx; char *name = NULL; struct fwnode_handle **list; + struct device_node *node = dev->of_node; + + if (!node) { + if (!of_property_read_string(node, "coresight-name", &name)) + return name; + }
mutex_lock(&coresight_mutex);
Add property "coresight-name" for coresight component name. This allows coresight driver to read device name from device entries.
Signed-off-by: Tao Zhang taozha@codeaurora.org --- Documentation/devicetree/bindings/arm/coresight.txt | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt index d711676..0e980ce 100644 --- a/Documentation/devicetree/bindings/arm/coresight.txt +++ b/Documentation/devicetree/bindings/arm/coresight.txt @@ -103,6 +103,8 @@ its hardware characteristcs. powers down the coresight component also powers down and loses its context. This property is currently only used for the ETM 4.x driver.
+ * coresight-name: the name of the coresight devices. + * Optional properties for ETM/PTMs:
* arm,cp14: must be present if the system accesses ETM/PTM management