2019-04-12 10:28:55

by Leo Yan

[permalink] [raw]
Subject: [PATCH v5 0/4] CoreSight: Support static funnel with DT binding consolidation

Since before there have no platforms use static funnel in mainline
kernel (though maybe some in-house SoC has used it but didn't upstream
for mainline kernel yet so we don't be aware for it), when enable
CoreSight DT binding for hikey960, we found the SoC uses the static
funnel in the link path and but it's not supported in CoreSight funnel
driver.

When support static funnel it's found the DT binding compatible string
doesn't follow the same fashion between replicator and funnel; so the
first two patches are firstly to refine the replicator DT binding and
correspondingly, change the replicator driver to support new DT binding
compatible.

Patch 0003 is to update DT documentation to support static funnel (we
call it as non-configurable funnel in documentation) and unify the
compatible string with the same fashion for replicator and funnel.

Patch 0004 is to support the static funnel in the CoreSight funnel
driver.

The consolidated DT binding compatible strings are as below:

Dynamic replicator:
"arm,coresight-dynamic-replicator", "arm,primecell";

Static replicator:
"arm,coresight-static-replicator";
"arm,coresight-replicator"; (obsolete)

Static funnel:
"arm,coresight-static-funnel";

Dynamic funnel:
"arm,coresight-dynamic-funnel", "arm,primecell";
"arm,coresight-funnel", "arm,primecell"; (obsolete)

This patch set has been rebased on CoreSight next branch [1] with
latest commit d5d246a56af0 ("coresight: Merge the static and dynamic
replicator drivers") and tested on Hikey960/Hikey with perf commands:

Hikey960:

# perf record -e cs_etm/@ec033000.etr/ --per-thread ./main
# perf report --tui

Hikey:

# perf record -e cs_etm/@f6404000.etr/ --per-thread uname
# perf report --tui

[1] https://git.linaro.org/kernel/coresight.git/log/?h=next

== Changes for v5 ==
* Marked the the obsolete compatible strings to be more abvious
(Suzuki).
* Used pr_warn_once() to print out warning if DT binding uses
the obsolete compatible string (Suzuki).

== Changes for v4 ==
* Consolidate the DT binding compatible strings for replicator and
funnel (Mathieu).
* Changed replicator driver to support new compatible string.


Leo Yan (4):
dt-bindings: arm: coresight: Add new compatible for static replicator
coresight: replicator: Add new device id for static replicator
dt-bindings: arm: coresight: Unify funnel DT binding
coresight: funnel: Support static funnel

.../devicetree/bindings/arm/coresight.txt | 60 +++++++--
.../hwtracing/coresight/coresight-funnel.c | 116 ++++++++++++++----
.../coresight/coresight-replicator.c | 6 +-
3 files changed, 147 insertions(+), 35 deletions(-)

--
2.17.1


2019-04-12 10:29:03

by Leo Yan

[permalink] [raw]
Subject: [PATCH v5 1/4] dt-bindings: arm: coresight: Add new compatible for static replicator

CoreSight uses below bindings for replicator:

Dynamic replicator, aka. configurable replicator:
"arm,coresight-dynamic-replicator", "arm,primecell";

Static replicator, aka. non-configurable replicator:
"arm,coresight-replicator";

The compatible string "arm,coresight-replicator" is not an explicit
naming to express the replicator is 'static'. To unify the naming
convention, this patch introduces a new compatible string
"arm,coresight-static-replicator" for the static replicator; the
compatible string "arm,coresight-replicator" is kept for backward
compatibility, but tag it as obsolete and suggest to use the new
compatible string.

As result CoreSight replicator have below bindings:

Dynamic replicator:
"arm,coresight-dynamic-replicator", "arm,primecell";

Static replicator:
"arm,coresight-static-replicator";
"arm,coresight-replicator"; (obsolete)

Signed-off-by: Leo Yan <[email protected]>
---
Documentation/devicetree/bindings/arm/coresight.txt | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt
index f8aff65ab921..d02d160fa8ac 100644
--- a/Documentation/devicetree/bindings/arm/coresight.txt
+++ b/Documentation/devicetree/bindings/arm/coresight.txt
@@ -69,7 +69,10 @@ its hardware characteristcs.

* compatible: Currently supported value is (note the absence of the
AMBA markee):
- - "arm,coresight-replicator"
+ - Coresight Non-configurable Replicator:
+ "arm,coresight-static-replicator";
+ "arm,coresight-replicator"; (OBSOLETE. For backward
+ compatibility and will be removed)

* port or ports: see "Graph bindings for Coresight" below.

@@ -169,7 +172,7 @@ Example:
/* non-configurable replicators don't show up on the
* AMBA bus. As such no need to add "arm,primecell".
*/
- compatible = "arm,coresight-replicator";
+ compatible = "arm,coresight-static-replicator";

out-ports {
#address-cells = <1>;
--
2.17.1

2019-04-12 10:29:10

by Leo Yan

[permalink] [raw]
Subject: [PATCH v5 2/4] coresight: replicator: Add new device id for static replicator

This patch adds a device id for the new static replicator compatible
string; it changes the driver name from "coresight-replicator" to
"coresight-static-replicator" as well.

This patch also gives warning when use the replicator obsolete DT
binding.

Signed-off-by: Leo Yan <[email protected]>
---
drivers/hwtracing/coresight/coresight-replicator.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c
index 4e0da85efd2d..8c9ce74498e1 100644
--- a/drivers/hwtracing/coresight/coresight-replicator.c
+++ b/drivers/hwtracing/coresight/coresight-replicator.c
@@ -189,6 +189,9 @@ static int replicator_probe(struct device *dev, struct resource *res)
dev->platform_data = pdata;
}

+ if (of_device_is_compatible(np, "arm,coresight-replicator"))
+ pr_warn_once("Uses OBSOLETE CoreSight replicator binding\n");
+
drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
if (!drvdata)
return -ENOMEM;
@@ -285,13 +288,14 @@ static const struct dev_pm_ops replicator_dev_pm_ops = {

static const struct of_device_id static_replicator_match[] = {
{.compatible = "arm,coresight-replicator"},
+ {.compatible = "arm,coresight-static-replicator"},
{}
};

static struct platform_driver static_replicator_driver = {
.probe = static_replicator_probe,
.driver = {
- .name = "coresight-replicator",
+ .name = "coresight-static-replicator",
.of_match_table = static_replicator_match,
.pm = &replicator_dev_pm_ops,
.suppress_bind_attrs = true,
--
2.17.1

2019-04-12 10:29:29

by Leo Yan

[permalink] [raw]
Subject: [PATCH v5 3/4] dt-bindings: arm: coresight: Unify funnel DT binding

Following the same fashion with replicator DT binding, this patch is to
unify the DT binding for funnel to support static and dynamic modes;
finally we get the funnel DT binding as below:

Before patch:

Static funnel, aka. non-configurable funnel:
Not supported;

Dynamic funnel, aka. configurable funnel:
"arm,coresight-funnel", "arm,primecell";

After patch:

Static funnel:
"arm,coresight-static-funnel";

Dynamic funnel:
"arm,coresight-dynamic-funnel", "arm,primecell";
"arm,coresight-funnel", "arm,primecell"; (obsolete)

At the end of this patch, it gives an example for static funnel DT
binding, and updates the dynamic funnel example.

Cc: Mathieu Poirier <[email protected]>
Cc: Suzuki K Poulose <[email protected]>
Cc: Wanglai Shi <[email protected]>
Signed-off-by: Leo Yan <[email protected]>
---
.../devicetree/bindings/arm/coresight.txt | 53 +++++++++++++++++--
1 file changed, 48 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt
index d02d160fa8ac..8a88ddebc1a2 100644
--- a/Documentation/devicetree/bindings/arm/coresight.txt
+++ b/Documentation/devicetree/bindings/arm/coresight.txt
@@ -8,7 +8,8 @@ through the intermediate links connecting the source to the currently selected
sink. Each CoreSight component device should use these properties to describe
its hardware characteristcs.

-* Required properties for all components *except* non-configurable replicators:
+* Required properties for all components *except* non-configurable replicators
+ and non-configurable funnels:

* compatible: These have to be supplemented with "arm,primecell" as
drivers are using the AMBA bus interface. Possible values include:
@@ -24,8 +25,10 @@ its hardware characteristcs.
discovered at boot time when the device is probed.
"arm,coresight-tmc", "arm,primecell";

- - Trace Funnel:
- "arm,coresight-funnel", "arm,primecell";
+ - Trace Programmable Funnel:
+ "arm,coresight-dynamic-funnel", "arm,primecell";
+ "arm,coresight-funnel", "arm,primecell"; (OBSOLETE. For
+ backward compatibility and will be removed)

- Embedded Trace Macrocell (version 3.x) and
Program Flow Trace Macrocell:
@@ -65,7 +68,7 @@ its hardware characteristcs.
"stm-stimulus-base", each corresponding to the areas defined in "reg".

* Required properties for devices that don't show up on the AMBA bus, such as
- non-configurable replicators:
+ non-configurable replicators and non-configurable funnels:

* compatible: Currently supported value is (note the absence of the
AMBA markee):
@@ -74,6 +77,9 @@ its hardware characteristcs.
"arm,coresight-replicator"; (OBSOLETE. For backward
compatibility and will be removed)

+ - Coresight Non-configurable Funnel:
+ "arm,coresight-static-funnel";
+
* port or ports: see "Graph bindings for Coresight" below.

* Optional properties for ETM/PTMs:
@@ -203,8 +209,45 @@ Example:
};
};

+ funnel {
+ /*
+ * non-configurable funnel don't show up on the AMBA
+ * bus. As such no need to add "arm,primecell".
+ */
+ compatible = "arm,coresight-static-funnel";
+ clocks = <&crg_ctrl HI3660_PCLK>;
+ clock-names = "apb_pclk";
+
+ out-ports {
+ port {
+ combo_funnel_out: endpoint {
+ remote-endpoint = <&top_funnel_in>;
+ };
+ };
+ };
+
+ in-ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ combo_funnel_in0: endpoint {
+ remote-endpoint = <&cluster0_etf_out>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ combo_funnel_in1: endpoint {
+ remote-endpoint = <&cluster1_etf_out>;
+ };
+ };
+ };
+ };
+
funnel@20040000 {
- compatible = "arm,coresight-funnel", "arm,primecell";
+ compatible = "arm,coresight-dynamic-funnel", "arm,primecell";
reg = <0 0x20040000 0 0x1000>;

clocks = <&oscclk6a>;
--
2.17.1

2019-04-12 10:29:55

by Leo Yan

[permalink] [raw]
Subject: [PATCH v5 4/4] coresight: funnel: Support static funnel

Since CoreSight hardware topology can use a 'hidden' funnel in the
trace data path, this kind funnel doesn't have register for accessing
and is used by default from hardware design perspective. Below is an
example for related hardware topology:

+------+ +------+
| cpu0 |->| ETM |-\
+------+ +------+ \-> +--------+ +-----+
...... | Funnel |->| ETF |-\ Hidden funnel
+------+ +------+ /-> +--------+ +-----+ \ |
| cpu3 |->| ETM |-/ \ V
+------+ +------+ \-> +--------+
| Funnel |-> ...
+------+ +------+ /-> +--------+
| cpu4 |->| ETM |-\ /
+------+ +------+ \-> +--------+ +-----+ /
...... | Funnel |->| ETF |-/
+------+ +------+ /-> +--------+ +-----+
| cpu7 |->| ETM |-/
+------+ +------+

The CoreSight funnel driver only supports dynamic funnel with
registration register resource, thus it cannot support for the static
funnel case and it's impossible to create trace data path for this case.

This patch is to extend CoreSight funnel driver to support both for
static funnel and dynamic funnel. For the dynamic funnel it reuses the
code existed in the driver, for static funnel the driver will support
device probe if without providing register resource and the driver skips
registers accessing when detect the register base is NULL.

Cc: Mathieu Poirier <[email protected]>
Cc: Suzuki K Poulose <[email protected]>
Cc: Wanglai Shi <[email protected]>
Suggested-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Leo Yan <[email protected]>
Reviewed-by: Suzuki K Poulose <[email protected]>
---
.../hwtracing/coresight/coresight-funnel.c | 116 ++++++++++++++----
1 file changed, 89 insertions(+), 27 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c
index 927925151509..16b0c0e1e43a 100644
--- a/drivers/hwtracing/coresight/coresight-funnel.c
+++ b/drivers/hwtracing/coresight/coresight-funnel.c
@@ -12,6 +12,8 @@
#include <linux/err.h>
#include <linux/fs.h>
#include <linux/slab.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/coresight.h>
#include <linux/amba/bus.h>
@@ -43,7 +45,7 @@ struct funnel_drvdata {
unsigned long priority;
};

-static int funnel_enable_hw(struct funnel_drvdata *drvdata, int port)
+static int dynamic_funnel_enable_hw(struct funnel_drvdata *drvdata, int port)
{
u32 functl;
int rc = 0;
@@ -71,17 +73,19 @@ static int funnel_enable_hw(struct funnel_drvdata *drvdata, int port)
static int funnel_enable(struct coresight_device *csdev, int inport,
int outport)
{
- int rc;
+ int rc = 0;
struct funnel_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);

- rc = funnel_enable_hw(drvdata, inport);
+ if (drvdata->base)
+ rc = dynamic_funnel_enable_hw(drvdata, inport);

if (!rc)
dev_dbg(drvdata->dev, "FUNNEL inport %d enabled\n", inport);
return rc;
}

-static void funnel_disable_hw(struct funnel_drvdata *drvdata, int inport)
+static void dynamic_funnel_disable_hw(struct funnel_drvdata *drvdata,
+ int inport)
{
u32 functl;

@@ -103,7 +107,8 @@ static void funnel_disable(struct coresight_device *csdev, int inport,
{
struct funnel_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);

- funnel_disable_hw(drvdata, inport);
+ if (drvdata->base)
+ dynamic_funnel_disable_hw(drvdata, inport);

dev_dbg(drvdata->dev, "FUNNEL inport %d disabled\n", inport);
}
@@ -177,54 +182,70 @@ static struct attribute *coresight_funnel_attrs[] = {
};
ATTRIBUTE_GROUPS(coresight_funnel);

-static int funnel_probe(struct amba_device *adev, const struct amba_id *id)
+static int funnel_probe(struct device *dev, struct resource *res)
{
int ret;
void __iomem *base;
- struct device *dev = &adev->dev;
struct coresight_platform_data *pdata = NULL;
struct funnel_drvdata *drvdata;
- struct resource *res = &adev->res;
struct coresight_desc desc = { 0 };
- struct device_node *np = adev->dev.of_node;
+ struct device_node *np = dev->of_node;

if (np) {
pdata = of_get_coresight_platform_data(dev, np);
if (IS_ERR(pdata))
return PTR_ERR(pdata);
- adev->dev.platform_data = pdata;
+ dev->platform_data = pdata;
}

+ if (of_device_is_compatible(np, "arm,coresight-funnel"))
+ pr_warn_once("Uses OBSOLETE CoreSight funnel binding\n");
+
drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
if (!drvdata)
return -ENOMEM;

- drvdata->dev = &adev->dev;
- drvdata->atclk = devm_clk_get(&adev->dev, "atclk"); /* optional */
+ drvdata->dev = dev;
+ drvdata->atclk = devm_clk_get(dev, "atclk"); /* optional */
if (!IS_ERR(drvdata->atclk)) {
ret = clk_prepare_enable(drvdata->atclk);
if (ret)
return ret;
}
- dev_set_drvdata(dev, drvdata);

- /* Validity for the resource is already checked by the AMBA core */
- base = devm_ioremap_resource(dev, res);
- if (IS_ERR(base))
- return PTR_ERR(base);
+ /*
+ * Map the device base for dynamic-funnel, which has been
+ * validated by AMBA core.
+ */
+ if (res) {
+ base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(base)) {
+ ret = PTR_ERR(base);
+ goto out_disable_clk;
+ }
+ drvdata->base = base;
+ desc.groups = coresight_funnel_groups;
+ }

- drvdata->base = base;
- pm_runtime_put(&adev->dev);
+ dev_set_drvdata(dev, drvdata);

desc.type = CORESIGHT_DEV_TYPE_LINK;
desc.subtype.link_subtype = CORESIGHT_DEV_SUBTYPE_LINK_MERG;
desc.ops = &funnel_cs_ops;
desc.pdata = pdata;
desc.dev = dev;
- desc.groups = coresight_funnel_groups;
drvdata->csdev = coresight_register(&desc);
+ if (IS_ERR(drvdata->csdev)) {
+ ret = PTR_ERR(drvdata->csdev);
+ goto out_disable_clk;
+ }
+
+ pm_runtime_put(dev);

- return PTR_ERR_OR_ZERO(drvdata->csdev);
+out_disable_clk:
+ if (ret && !IS_ERR_OR_NULL(drvdata->atclk))
+ clk_disable_unprepare(drvdata->atclk);
+ return ret;
}

#ifdef CONFIG_PM
@@ -253,7 +274,48 @@ static const struct dev_pm_ops funnel_dev_pm_ops = {
SET_RUNTIME_PM_OPS(funnel_runtime_suspend, funnel_runtime_resume, NULL)
};

-static const struct amba_id funnel_ids[] = {
+static int static_funnel_probe(struct platform_device *pdev)
+{
+ int ret;
+
+ pm_runtime_get_noresume(&pdev->dev);
+ pm_runtime_set_active(&pdev->dev);
+ pm_runtime_enable(&pdev->dev);
+
+ /* Static funnel do not have programming base */
+ ret = funnel_probe(&pdev->dev, NULL);
+
+ if (ret) {
+ pm_runtime_put_noidle(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
+ }
+
+ return ret;
+}
+
+static const struct of_device_id static_funnel_match[] = {
+ {.compatible = "arm,coresight-static-funnel"},
+ {}
+};
+
+static struct platform_driver static_funnel_driver = {
+ .probe = static_funnel_probe,
+ .driver = {
+ .name = "coresight-static-funnel",
+ .of_match_table = static_funnel_match,
+ .pm = &funnel_dev_pm_ops,
+ .suppress_bind_attrs = true,
+ },
+};
+builtin_platform_driver(static_funnel_driver);
+
+static int dynamic_funnel_probe(struct amba_device *adev,
+ const struct amba_id *id)
+{
+ return funnel_probe(&adev->dev, &adev->res);
+}
+
+static const struct amba_id dynamic_funnel_ids[] = {
{
.id = 0x000bb908,
.mask = 0x000fffff,
@@ -266,14 +328,14 @@ static const struct amba_id funnel_ids[] = {
{ 0, 0},
};

-static struct amba_driver funnel_driver = {
+static struct amba_driver dynamic_funnel_driver = {
.drv = {
- .name = "coresight-funnel",
+ .name = "coresight-dynamic-funnel",
.owner = THIS_MODULE,
.pm = &funnel_dev_pm_ops,
.suppress_bind_attrs = true,
},
- .probe = funnel_probe,
- .id_table = funnel_ids,
+ .probe = dynamic_funnel_probe,
+ .id_table = dynamic_funnel_ids,
};
-builtin_amba_driver(funnel_driver);
+builtin_amba_driver(dynamic_funnel_driver);
--
2.17.1

2019-04-12 10:38:49

by Suzuki K Poulose

[permalink] [raw]
Subject: Re: [PATCH v5 1/4] dt-bindings: arm: coresight: Add new compatible for static replicator

On 04/12/2019 11:27 AM, Leo Yan wrote:
> CoreSight uses below bindings for replicator:
>
> Dynamic replicator, aka. configurable replicator:
> "arm,coresight-dynamic-replicator", "arm,primecell";
>
> Static replicator, aka. non-configurable replicator:
> "arm,coresight-replicator";
>
> The compatible string "arm,coresight-replicator" is not an explicit
> naming to express the replicator is 'static'. To unify the naming
> convention, this patch introduces a new compatible string
> "arm,coresight-static-replicator" for the static replicator; the
> compatible string "arm,coresight-replicator" is kept for backward
> compatibility, but tag it as obsolete and suggest to use the new
> compatible string.
>
> As result CoreSight replicator have below bindings:
>
> Dynamic replicator:
> "arm,coresight-dynamic-replicator", "arm,primecell";
>
> Static replicator:
> "arm,coresight-static-replicator";
> "arm,coresight-replicator"; (obsolete)
>
> Signed-off-by: Leo Yan <[email protected]>
> ---
> Documentation/devicetree/bindings/arm/coresight.txt | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt
> index f8aff65ab921..d02d160fa8ac 100644
> --- a/Documentation/devicetree/bindings/arm/coresight.txt
> +++ b/Documentation/devicetree/bindings/arm/coresight.txt
> @@ -69,7 +69,10 @@ its hardware characteristcs.
>
> * compatible: Currently supported value is (note the absence of the
> AMBA markee):
> - - "arm,coresight-replicator"
> + - Coresight Non-configurable Replicator:
> + "arm,coresight-static-replicator";
> + "arm,coresight-replicator"; (OBSOLETE. For backward
> + compatibility and will be removed)
>
> * port or ports: see "Graph bindings for Coresight" below.
>
> @@ -169,7 +172,7 @@ Example:
> /* non-configurable replicators don't show up on the
> * AMBA bus. As such no need to add "arm,primecell".
> */
> - compatible = "arm,coresight-replicator";
> + compatible = "arm,coresight-static-replicator";

Reviewed-by: Suzuki K Poulose <[email protected]>

2019-04-12 10:41:04

by Suzuki K Poulose

[permalink] [raw]
Subject: Re: [PATCH v5 2/4] coresight: replicator: Add new device id for static replicator

On 04/12/2019 11:27 AM, Leo Yan wrote:
> This patch adds a device id for the new static replicator compatible
> string; it changes the driver name from "coresight-replicator" to
> "coresight-static-replicator" as well.
>
> This patch also gives warning when use the replicator obsolete DT
> binding.
>
> Signed-off-by: Leo Yan <[email protected]>
> ---
> drivers/hwtracing/coresight/coresight-replicator.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c
> index 4e0da85efd2d..8c9ce74498e1 100644
> --- a/drivers/hwtracing/coresight/coresight-replicator.c
> +++ b/drivers/hwtracing/coresight/coresight-replicator.c
> @@ -189,6 +189,9 @@ static int replicator_probe(struct device *dev, struct resource *res)
> dev->platform_data = pdata;
> }
>
> + if (of_device_is_compatible(np, "arm,coresight-replicator"))
> + pr_warn_once("Uses OBSOLETE CoreSight replicator binding\n");
> +
> drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
> if (!drvdata)
> return -ENOMEM;
> @@ -285,13 +288,14 @@ static const struct dev_pm_ops replicator_dev_pm_ops = {
>
> static const struct of_device_id static_replicator_match[] = {
> {.compatible = "arm,coresight-replicator"},
> + {.compatible = "arm,coresight-static-replicator"},
> {}
> };
>
> static struct platform_driver static_replicator_driver = {
> .probe = static_replicator_probe,
> .driver = {
> - .name = "coresight-replicator",
> + .name = "coresight-static-replicator",
> .of_match_table = static_replicator_match,
> .pm = &replicator_dev_pm_ops,
> .suppress_bind_attrs = true,
>

Reviewed-by: Suzuki K Poulose <[email protected]>

2019-04-12 10:42:24

by Suzuki K Poulose

[permalink] [raw]
Subject: Re: [PATCH v5 3/4] dt-bindings: arm: coresight: Unify funnel DT binding

On 04/12/2019 11:27 AM, Leo Yan wrote:
> Following the same fashion with replicator DT binding, this patch is to
> unify the DT binding for funnel to support static and dynamic modes;
> finally we get the funnel DT binding as below:
>
> Before patch:
>
> Static funnel, aka. non-configurable funnel:
> Not supported;
>
> Dynamic funnel, aka. configurable funnel:
> "arm,coresight-funnel", "arm,primecell";
>
> After patch:
>
> Static funnel:
> "arm,coresight-static-funnel";
>
> Dynamic funnel:
> "arm,coresight-dynamic-funnel", "arm,primecell";
> "arm,coresight-funnel", "arm,primecell"; (obsolete)
>
> At the end of this patch, it gives an example for static funnel DT
> binding, and updates the dynamic funnel example.
>
> Cc: Mathieu Poirier <[email protected]>
> Cc: Suzuki K Poulose <[email protected]>
> Cc: Wanglai Shi <[email protected]>
> Signed-off-by: Leo Yan <[email protected]>
> ---
> .../devicetree/bindings/arm/coresight.txt | 53 +++++++++++++++++--
> 1 file changed, 48 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt
> index d02d160fa8ac..8a88ddebc1a2 100644
> --- a/Documentation/devicetree/bindings/arm/coresight.txt
> +++ b/Documentation/devicetree/bindings/arm/coresight.txt
> @@ -8,7 +8,8 @@ through the intermediate links connecting the source to the currently selected
> sink. Each CoreSight component device should use these properties to describe
> its hardware characteristcs.
>
> -* Required properties for all components *except* non-configurable replicators:
> +* Required properties for all components *except* non-configurable replicators
> + and non-configurable funnels:
>
> * compatible: These have to be supplemented with "arm,primecell" as
> drivers are using the AMBA bus interface. Possible values include:
> @@ -24,8 +25,10 @@ its hardware characteristcs.
> discovered at boot time when the device is probed.
> "arm,coresight-tmc", "arm,primecell";
>
> - - Trace Funnel:
> - "arm,coresight-funnel", "arm,primecell";
> + - Trace Programmable Funnel:
> + "arm,coresight-dynamic-funnel", "arm,primecell";
> + "arm,coresight-funnel", "arm,primecell"; (OBSOLETE. For
> + backward compatibility and will be removed)
>
> - Embedded Trace Macrocell (version 3.x) and
> Program Flow Trace Macrocell:
> @@ -65,7 +68,7 @@ its hardware characteristcs.
> "stm-stimulus-base", each corresponding to the areas defined in "reg".
>
> * Required properties for devices that don't show up on the AMBA bus, such as
> - non-configurable replicators:
> + non-configurable replicators and non-configurable funnels:
>
> * compatible: Currently supported value is (note the absence of the
> AMBA markee):
> @@ -74,6 +77,9 @@ its hardware characteristcs.
> "arm,coresight-replicator"; (OBSOLETE. For backward
> compatibility and will be removed)
>
> + - Coresight Non-configurable Funnel:
> + "arm,coresight-static-funnel";
> +
> * port or ports: see "Graph bindings for Coresight" below.
>
> * Optional properties for ETM/PTMs:
> @@ -203,8 +209,45 @@ Example:
> };
> };
>
> + funnel {
> + /*
> + * non-configurable funnel don't show up on the AMBA
> + * bus. As such no need to add "arm,primecell".
> + */
> + compatible = "arm,coresight-static-funnel";
> + clocks = <&crg_ctrl HI3660_PCLK>;
> + clock-names = "apb_pclk";
> +
> + out-ports {
> + port {
> + combo_funnel_out: endpoint {
> + remote-endpoint = <&top_funnel_in>;
> + };
> + };
> + };
> +
> + in-ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@0 {
> + reg = <0>;
> + combo_funnel_in0: endpoint {
> + remote-endpoint = <&cluster0_etf_out>;
> + };
> + };
> +
> + port@1 {
> + reg = <1>;
> + combo_funnel_in1: endpoint {
> + remote-endpoint = <&cluster1_etf_out>;
> + };
> + };
> + };
> + };
> +
> funnel@20040000 {
> - compatible = "arm,coresight-funnel", "arm,primecell";
> + compatible = "arm,coresight-dynamic-funnel", "arm,primecell";
> reg = <0 0x20040000 0 0x1000>;
>
> clocks = <&oscclk6a>;
>


Reviewed-by: Suzuki K Poulose <[email protected]>


2019-04-12 10:56:12

by Leo Yan

[permalink] [raw]
Subject: Re: [PATCH v5 1/4] dt-bindings: arm: coresight: Add new compatible for static replicator

On Fri, Apr 12, 2019 at 11:40:13AM +0100, Suzuki K Poulose wrote:
> On 04/12/2019 11:27 AM, Leo Yan wrote:
> > CoreSight uses below bindings for replicator:
> >
> > Dynamic replicator, aka. configurable replicator:
> > "arm,coresight-dynamic-replicator", "arm,primecell";
> >
> > Static replicator, aka. non-configurable replicator:
> > "arm,coresight-replicator";
> >
> > The compatible string "arm,coresight-replicator" is not an explicit
> > naming to express the replicator is 'static'. To unify the naming
> > convention, this patch introduces a new compatible string
> > "arm,coresight-static-replicator" for the static replicator; the
> > compatible string "arm,coresight-replicator" is kept for backward
> > compatibility, but tag it as obsolete and suggest to use the new
> > compatible string.
> >
> > As result CoreSight replicator have below bindings:
> >
> > Dynamic replicator:
> > "arm,coresight-dynamic-replicator", "arm,primecell";
> >
> > Static replicator:
> > "arm,coresight-static-replicator";
> > "arm,coresight-replicator"; (obsolete)
> >
> > Signed-off-by: Leo Yan <[email protected]>
> > ---
> > Documentation/devicetree/bindings/arm/coresight.txt | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt
> > index f8aff65ab921..d02d160fa8ac 100644
> > --- a/Documentation/devicetree/bindings/arm/coresight.txt
> > +++ b/Documentation/devicetree/bindings/arm/coresight.txt
> > @@ -69,7 +69,10 @@ its hardware characteristcs.
> > * compatible: Currently supported value is (note the absence of the
> > AMBA markee):
> > - - "arm,coresight-replicator"
> > + - Coresight Non-configurable Replicator:
> > + "arm,coresight-static-replicator";
> > + "arm,coresight-replicator"; (OBSOLETE. For backward
> > + compatibility and will be removed)
> > * port or ports: see "Graph bindings for Coresight" below.
> > @@ -169,7 +172,7 @@ Example:
> > /* non-configurable replicators don't show up on the
> > * AMBA bus. As such no need to add "arm,primecell".
> > */
> > - compatible = "arm,coresight-replicator";
> > + compatible = "arm,coresight-static-replicator";
>
> Reviewed-by: Suzuki K Poulose <[email protected]>

Thanks a lot for quick reviewing, Suzuki.

2019-04-16 20:19:42

by Mathieu Poirier

[permalink] [raw]
Subject: Re: [PATCH v5 1/4] dt-bindings: arm: coresight: Add new compatible for static replicator

Hi Leo,

On Fri, 12 Apr 2019 at 04:28, Leo Yan <[email protected]> wrote:
>
> CoreSight uses below bindings for replicator:
>
> Dynamic replicator, aka. configurable replicator:
> "arm,coresight-dynamic-replicator", "arm,primecell";
>
> Static replicator, aka. non-configurable replicator:
> "arm,coresight-replicator";
>
> The compatible string "arm,coresight-replicator" is not an explicit
> naming to express the replicator is 'static'. To unify the naming
> convention, this patch introduces a new compatible string
> "arm,coresight-static-replicator" for the static replicator; the
> compatible string "arm,coresight-replicator" is kept for backward
> compatibility, but tag it as obsolete and suggest to use the new
> compatible string.
>
> As result CoreSight replicator have below bindings:
>
> Dynamic replicator:
> "arm,coresight-dynamic-replicator", "arm,primecell";
>
> Static replicator:
> "arm,coresight-static-replicator";
> "arm,coresight-replicator"; (obsolete)
>
> Signed-off-by: Leo Yan <[email protected]>
> ---
> Documentation/devicetree/bindings/arm/coresight.txt | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt
> index f8aff65ab921..d02d160fa8ac 100644
> --- a/Documentation/devicetree/bindings/arm/coresight.txt
> +++ b/Documentation/devicetree/bindings/arm/coresight.txt
> @@ -69,7 +69,10 @@ its hardware characteristcs.
>
> * compatible: Currently supported value is (note the absence of the
> AMBA markee):
> - - "arm,coresight-replicator"
> + - Coresight Non-configurable Replicator:
> + "arm,coresight-static-replicator";
> + "arm,coresight-replicator"; (OBSOLETE. For backward
> + compatibility and will be removed)
>
> * port or ports: see "Graph bindings for Coresight" below.
>
> @@ -169,7 +172,7 @@ Example:
> /* non-configurable replicators don't show up on the
> * AMBA bus. As such no need to add "arm,primecell".
> */
> - compatible = "arm,coresight-replicator";
> + compatible = "arm,coresight-static-replicator";
>
> out-ports {
> #address-cells = <1>;
> --
> 2.17.1

Since this is a binding patch it needs to be sent on its own.

>

2019-04-16 20:21:24

by Mathieu Poirier

[permalink] [raw]
Subject: Re: [PATCH v5 3/4] dt-bindings: arm: coresight: Unify funnel DT binding

On Fri, 12 Apr 2019 at 04:28, Leo Yan <[email protected]> wrote:
>
> Following the same fashion with replicator DT binding, this patch is to
> unify the DT binding for funnel to support static and dynamic modes;
> finally we get the funnel DT binding as below:
>
> Before patch:
>
> Static funnel, aka. non-configurable funnel:
> Not supported;
>
> Dynamic funnel, aka. configurable funnel:
> "arm,coresight-funnel", "arm,primecell";
>
> After patch:
>
> Static funnel:
> "arm,coresight-static-funnel";
>
> Dynamic funnel:
> "arm,coresight-dynamic-funnel", "arm,primecell";
> "arm,coresight-funnel", "arm,primecell"; (obsolete)
>
> At the end of this patch, it gives an example for static funnel DT
> binding, and updates the dynamic funnel example.
>
> Cc: Mathieu Poirier <[email protected]>
> Cc: Suzuki K Poulose <[email protected]>
> Cc: Wanglai Shi <[email protected]>
> Signed-off-by: Leo Yan <[email protected]>
> ---
> .../devicetree/bindings/arm/coresight.txt | 53 +++++++++++++++++--
> 1 file changed, 48 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt
> index d02d160fa8ac..8a88ddebc1a2 100644
> --- a/Documentation/devicetree/bindings/arm/coresight.txt
> +++ b/Documentation/devicetree/bindings/arm/coresight.txt
> @@ -8,7 +8,8 @@ through the intermediate links connecting the source to the currently selected
> sink. Each CoreSight component device should use these properties to describe
> its hardware characteristcs.
>
> -* Required properties for all components *except* non-configurable replicators:
> +* Required properties for all components *except* non-configurable replicators
> + and non-configurable funnels:
>
> * compatible: These have to be supplemented with "arm,primecell" as
> drivers are using the AMBA bus interface. Possible values include:
> @@ -24,8 +25,10 @@ its hardware characteristcs.
> discovered at boot time when the device is probed.
> "arm,coresight-tmc", "arm,primecell";
>
> - - Trace Funnel:
> - "arm,coresight-funnel", "arm,primecell";
> + - Trace Programmable Funnel:
> + "arm,coresight-dynamic-funnel", "arm,primecell";
> + "arm,coresight-funnel", "arm,primecell"; (OBSOLETE. For
> + backward compatibility and will be removed)
>
> - Embedded Trace Macrocell (version 3.x) and
> Program Flow Trace Macrocell:
> @@ -65,7 +68,7 @@ its hardware characteristcs.
> "stm-stimulus-base", each corresponding to the areas defined in "reg".
>
> * Required properties for devices that don't show up on the AMBA bus, such as
> - non-configurable replicators:
> + non-configurable replicators and non-configurable funnels:
>
> * compatible: Currently supported value is (note the absence of the
> AMBA markee):
> @@ -74,6 +77,9 @@ its hardware characteristcs.
> "arm,coresight-replicator"; (OBSOLETE. For backward
> compatibility and will be removed)
>
> + - Coresight Non-configurable Funnel:
> + "arm,coresight-static-funnel";
> +
> * port or ports: see "Graph bindings for Coresight" below.
>
> * Optional properties for ETM/PTMs:
> @@ -203,8 +209,45 @@ Example:
> };
> };
>
> + funnel {
> + /*
> + * non-configurable funnel don't show up on the AMBA
> + * bus. As such no need to add "arm,primecell".
> + */
> + compatible = "arm,coresight-static-funnel";
> + clocks = <&crg_ctrl HI3660_PCLK>;
> + clock-names = "apb_pclk";
> +
> + out-ports {
> + port {
> + combo_funnel_out: endpoint {
> + remote-endpoint = <&top_funnel_in>;
> + };
> + };
> + };
> +
> + in-ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@0 {
> + reg = <0>;
> + combo_funnel_in0: endpoint {
> + remote-endpoint = <&cluster0_etf_out>;
> + };
> + };
> +
> + port@1 {
> + reg = <1>;
> + combo_funnel_in1: endpoint {
> + remote-endpoint = <&cluster1_etf_out>;
> + };
> + };
> + };
> + };
> +
> funnel@20040000 {
> - compatible = "arm,coresight-funnel", "arm,primecell";
> + compatible = "arm,coresight-dynamic-funnel", "arm,primecell";
> reg = <0 0x20040000 0 0x1000>;
>
> clocks = <&oscclk6a>;
> --
> 2.17.1

Same thing for this one.

>

2019-04-17 00:11:34

by Leo Yan

[permalink] [raw]
Subject: Re: [PATCH v5 1/4] dt-bindings: arm: coresight: Add new compatible for static replicator

On Tue, Apr 16, 2019 at 02:18:40PM -0600, Mathieu Poirier wrote:
> Hi Leo,
>
> On Fri, 12 Apr 2019 at 04:28, Leo Yan <[email protected]> wrote:
> >
> > CoreSight uses below bindings for replicator:
> >
> > Dynamic replicator, aka. configurable replicator:
> > "arm,coresight-dynamic-replicator", "arm,primecell";
> >
> > Static replicator, aka. non-configurable replicator:
> > "arm,coresight-replicator";
> >
> > The compatible string "arm,coresight-replicator" is not an explicit
> > naming to express the replicator is 'static'. To unify the naming
> > convention, this patch introduces a new compatible string
> > "arm,coresight-static-replicator" for the static replicator; the
> > compatible string "arm,coresight-replicator" is kept for backward
> > compatibility, but tag it as obsolete and suggest to use the new
> > compatible string.
> >
> > As result CoreSight replicator have below bindings:
> >
> > Dynamic replicator:
> > "arm,coresight-dynamic-replicator", "arm,primecell";
> >
> > Static replicator:
> > "arm,coresight-static-replicator";
> > "arm,coresight-replicator"; (obsolete)
> >
> > Signed-off-by: Leo Yan <[email protected]>
> > ---
> > Documentation/devicetree/bindings/arm/coresight.txt | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt
> > index f8aff65ab921..d02d160fa8ac 100644
> > --- a/Documentation/devicetree/bindings/arm/coresight.txt
> > +++ b/Documentation/devicetree/bindings/arm/coresight.txt
> > @@ -69,7 +69,10 @@ its hardware characteristcs.
> >
> > * compatible: Currently supported value is (note the absence of the
> > AMBA markee):
> > - - "arm,coresight-replicator"
> > + - Coresight Non-configurable Replicator:
> > + "arm,coresight-static-replicator";
> > + "arm,coresight-replicator"; (OBSOLETE. For backward
> > + compatibility and will be removed)
> >
> > * port or ports: see "Graph bindings for Coresight" below.
> >
> > @@ -169,7 +172,7 @@ Example:
> > /* non-configurable replicators don't show up on the
> > * AMBA bus. As such no need to add "arm,primecell".
> > */
> > - compatible = "arm,coresight-replicator";
> > + compatible = "arm,coresight-static-replicator";
> >
> > out-ports {
> > #address-cells = <1>;
> > --
> > 2.17.1
>
> Since this is a binding patch it needs to be sent on its own.

Thanks for reminding, Mathieu.

Since this is the second time you remind me to send DT binding related
patches separately, so I may misunderstand your meaning and want to get
clarification to avoid making the same mistake for many times.

Before I remembered in one patch set we need to organise patches with
sending document patch (or document changing patch) ahead and then
followed by the corresponding code change patch. So this can give the
reviewers more clear context; and this also can present the merging
dependency between document change patches and the code change patches.

This is the rule I followed in this patch set and I sent to CoreSight
and DT maintainers (and mailing lists) together.

Please let me know what you think about this? And also welcome
Rob/Mark's suggestions.

Thanks,
Leo Yan

2019-04-17 13:59:37

by Mathieu Poirier

[permalink] [raw]
Subject: Re: [PATCH v5 1/4] dt-bindings: arm: coresight: Add new compatible for static replicator

On Tue, 16 Apr 2019 at 18:10, Leo Yan <[email protected]> wrote:
>
> On Tue, Apr 16, 2019 at 02:18:40PM -0600, Mathieu Poirier wrote:
> > Hi Leo,
> >
> > On Fri, 12 Apr 2019 at 04:28, Leo Yan <[email protected]> wrote:
> > >
> > > CoreSight uses below bindings for replicator:
> > >
> > > Dynamic replicator, aka. configurable replicator:
> > > "arm,coresight-dynamic-replicator", "arm,primecell";
> > >
> > > Static replicator, aka. non-configurable replicator:
> > > "arm,coresight-replicator";
> > >
> > > The compatible string "arm,coresight-replicator" is not an explicit
> > > naming to express the replicator is 'static'. To unify the naming
> > > convention, this patch introduces a new compatible string
> > > "arm,coresight-static-replicator" for the static replicator; the
> > > compatible string "arm,coresight-replicator" is kept for backward
> > > compatibility, but tag it as obsolete and suggest to use the new
> > > compatible string.
> > >
> > > As result CoreSight replicator have below bindings:
> > >
> > > Dynamic replicator:
> > > "arm,coresight-dynamic-replicator", "arm,primecell";
> > >
> > > Static replicator:
> > > "arm,coresight-static-replicator";
> > > "arm,coresight-replicator"; (obsolete)
> > >
> > > Signed-off-by: Leo Yan <[email protected]>
> > > ---
> > > Documentation/devicetree/bindings/arm/coresight.txt | 7 +++++--
> > > 1 file changed, 5 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt
> > > index f8aff65ab921..d02d160fa8ac 100644
> > > --- a/Documentation/devicetree/bindings/arm/coresight.txt
> > > +++ b/Documentation/devicetree/bindings/arm/coresight.txt
> > > @@ -69,7 +69,10 @@ its hardware characteristcs.
> > >
> > > * compatible: Currently supported value is (note the absence of the
> > > AMBA markee):
> > > - - "arm,coresight-replicator"
> > > + - Coresight Non-configurable Replicator:
> > > + "arm,coresight-static-replicator";
> > > + "arm,coresight-replicator"; (OBSOLETE. For backward
> > > + compatibility and will be removed)
> > >
> > > * port or ports: see "Graph bindings for Coresight" below.
> > >
> > > @@ -169,7 +172,7 @@ Example:
> > > /* non-configurable replicators don't show up on the
> > > * AMBA bus. As such no need to add "arm,primecell".
> > > */
> > > - compatible = "arm,coresight-replicator";
> > > + compatible = "arm,coresight-static-replicator";
> > >
> > > out-ports {
> > > #address-cells = <1>;
> > > --
> > > 2.17.1
> >
> > Since this is a binding patch it needs to be sent on its own.
>
> Thanks for reminding, Mathieu.
>
> Since this is the second time you remind me to send DT binding related
> patches separately, so I may misunderstand your meaning and want to get
> clarification to avoid making the same mistake for many times.
>
> Before I remembered in one patch set we need to organise patches with
> sending document patch (or document changing patch) ahead and then
> followed by the corresponding code change patch. So this can give the
> reviewers more clear context; and this also can present the merging
> dependency between document change patches and the code change patches.
>
> This is the rule I followed in this patch set and I sent to CoreSight
> and DT maintainers (and mailing lists) together.
>
> Please let me know what you think about this? And also welcome
> Rob/Mark's suggestions.

https://www.kernel.org/doc/Documentation/devicetree/bindings/submitting-patches.txt

>
> Thanks,
> Leo Yan

2019-04-26 14:26:33

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v5 1/4] dt-bindings: arm: coresight: Add new compatible for static replicator

On Wed, Apr 17, 2019 at 07:57:50AM -0600, Mathieu Poirier wrote:
> On Tue, 16 Apr 2019 at 18:10, Leo Yan <[email protected]> wrote:
> >
> > On Tue, Apr 16, 2019 at 02:18:40PM -0600, Mathieu Poirier wrote:
> > > Hi Leo,
> > >
> > > On Fri, 12 Apr 2019 at 04:28, Leo Yan <[email protected]> wrote:
> > > >
> > > > CoreSight uses below bindings for replicator:
> > > >
> > > > Dynamic replicator, aka. configurable replicator:
> > > > "arm,coresight-dynamic-replicator", "arm,primecell";
> > > >
> > > > Static replicator, aka. non-configurable replicator:
> > > > "arm,coresight-replicator";
> > > >
> > > > The compatible string "arm,coresight-replicator" is not an explicit
> > > > naming to express the replicator is 'static'. To unify the naming
> > > > convention, this patch introduces a new compatible string
> > > > "arm,coresight-static-replicator" for the static replicator; the
> > > > compatible string "arm,coresight-replicator" is kept for backward
> > > > compatibility, but tag it as obsolete and suggest to use the new
> > > > compatible string.
> > > >
> > > > As result CoreSight replicator have below bindings:
> > > >
> > > > Dynamic replicator:
> > > > "arm,coresight-dynamic-replicator", "arm,primecell";
> > > >
> > > > Static replicator:
> > > > "arm,coresight-static-replicator";
> > > > "arm,coresight-replicator"; (obsolete)
> > > >
> > > > Signed-off-by: Leo Yan <[email protected]>
> > > > ---
> > > > Documentation/devicetree/bindings/arm/coresight.txt | 7 +++++--
> > > > 1 file changed, 5 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt
> > > > index f8aff65ab921..d02d160fa8ac 100644
> > > > --- a/Documentation/devicetree/bindings/arm/coresight.txt
> > > > +++ b/Documentation/devicetree/bindings/arm/coresight.txt
> > > > @@ -69,7 +69,10 @@ its hardware characteristcs.
> > > >
> > > > * compatible: Currently supported value is (note the absence of the
> > > > AMBA markee):
> > > > - - "arm,coresight-replicator"
> > > > + - Coresight Non-configurable Replicator:
> > > > + "arm,coresight-static-replicator";
> > > > + "arm,coresight-replicator"; (OBSOLETE. For backward
> > > > + compatibility and will be removed)
> > > >
> > > > * port or ports: see "Graph bindings for Coresight" below.
> > > >
> > > > @@ -169,7 +172,7 @@ Example:
> > > > /* non-configurable replicators don't show up on the
> > > > * AMBA bus. As such no need to add "arm,primecell".
> > > > */
> > > > - compatible = "arm,coresight-replicator";
> > > > + compatible = "arm,coresight-static-replicator";
> > > >
> > > > out-ports {
> > > > #address-cells = <1>;
> > > > --
> > > > 2.17.1
> > >
> > > Since this is a binding patch it needs to be sent on its own.
> >
> > Thanks for reminding, Mathieu.
> >
> > Since this is the second time you remind me to send DT binding related
> > patches separately, so I may misunderstand your meaning and want to get
> > clarification to avoid making the same mistake for many times.
> >
> > Before I remembered in one patch set we need to organise patches with
> > sending document patch (or document changing patch) ahead and then
> > followed by the corresponding code change patch. So this can give the
> > reviewers more clear context; and this also can present the merging
> > dependency between document change patches and the code change patches.
> >
> > This is the rule I followed in this patch set and I sent to CoreSight
> > and DT maintainers (and mailing lists) together.
> >
> > Please let me know what you think about this? And also welcome
> > Rob/Mark's suggestions.
>
> https://www.kernel.org/doc/Documentation/devicetree/bindings/submitting-patches.txt

I'm not clear on what you are asking for. Binding patches should be
separate patch, but can and should still be in a series if there's
relevant code changes.

Rob

2019-04-26 14:27:04

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v5 1/4] dt-bindings: arm: coresight: Add new compatible for static replicator

On Fri, 12 Apr 2019 18:27:35 +0800, Leo Yan wrote:
> CoreSight uses below bindings for replicator:
>
> Dynamic replicator, aka. configurable replicator:
> "arm,coresight-dynamic-replicator", "arm,primecell";
>
> Static replicator, aka. non-configurable replicator:
> "arm,coresight-replicator";
>
> The compatible string "arm,coresight-replicator" is not an explicit
> naming to express the replicator is 'static'. To unify the naming
> convention, this patch introduces a new compatible string
> "arm,coresight-static-replicator" for the static replicator; the
> compatible string "arm,coresight-replicator" is kept for backward
> compatibility, but tag it as obsolete and suggest to use the new
> compatible string.
>
> As result CoreSight replicator have below bindings:
>
> Dynamic replicator:
> "arm,coresight-dynamic-replicator", "arm,primecell";
>
> Static replicator:
> "arm,coresight-static-replicator";
> "arm,coresight-replicator"; (obsolete)
>
> Signed-off-by: Leo Yan <[email protected]>
> ---
> Documentation/devicetree/bindings/arm/coresight.txt | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>

Reviewed-by: Rob Herring <[email protected]>

2019-04-26 14:28:57

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v5 3/4] dt-bindings: arm: coresight: Unify funnel DT binding

On Fri, 12 Apr 2019 18:27:37 +0800, Leo Yan wrote:
> Following the same fashion with replicator DT binding, this patch is to
> unify the DT binding for funnel to support static and dynamic modes;
> finally we get the funnel DT binding as below:
>
> Before patch:
>
> Static funnel, aka. non-configurable funnel:
> Not supported;
>
> Dynamic funnel, aka. configurable funnel:
> "arm,coresight-funnel", "arm,primecell";
>
> After patch:
>
> Static funnel:
> "arm,coresight-static-funnel";
>
> Dynamic funnel:
> "arm,coresight-dynamic-funnel", "arm,primecell";
> "arm,coresight-funnel", "arm,primecell"; (obsolete)
>
> At the end of this patch, it gives an example for static funnel DT
> binding, and updates the dynamic funnel example.
>
> Cc: Mathieu Poirier <[email protected]>
> Cc: Suzuki K Poulose <[email protected]>
> Cc: Wanglai Shi <[email protected]>
> Signed-off-by: Leo Yan <[email protected]>
> ---
> .../devicetree/bindings/arm/coresight.txt | 53 +++++++++++++++++--
> 1 file changed, 48 insertions(+), 5 deletions(-)
>

Reviewed-by: Rob Herring <[email protected]>

2019-04-26 15:07:14

by Mathieu Poirier

[permalink] [raw]
Subject: Re: [PATCH v5 1/4] dt-bindings: arm: coresight: Add new compatible for static replicator

On Fri, Apr 26, 2019 at 09:25:07AM -0500, Rob Herring wrote:
> On Wed, Apr 17, 2019 at 07:57:50AM -0600, Mathieu Poirier wrote:
> > On Tue, 16 Apr 2019 at 18:10, Leo Yan <[email protected]> wrote:
> > >
> > > On Tue, Apr 16, 2019 at 02:18:40PM -0600, Mathieu Poirier wrote:
> > > > Hi Leo,
> > > >
> > > > On Fri, 12 Apr 2019 at 04:28, Leo Yan <[email protected]> wrote:
> > > > >
> > > > > CoreSight uses below bindings for replicator:
> > > > >
> > > > > Dynamic replicator, aka. configurable replicator:
> > > > > "arm,coresight-dynamic-replicator", "arm,primecell";
> > > > >
> > > > > Static replicator, aka. non-configurable replicator:
> > > > > "arm,coresight-replicator";
> > > > >
> > > > > The compatible string "arm,coresight-replicator" is not an explicit
> > > > > naming to express the replicator is 'static'. To unify the naming
> > > > > convention, this patch introduces a new compatible string
> > > > > "arm,coresight-static-replicator" for the static replicator; the
> > > > > compatible string "arm,coresight-replicator" is kept for backward
> > > > > compatibility, but tag it as obsolete and suggest to use the new
> > > > > compatible string.
> > > > >
> > > > > As result CoreSight replicator have below bindings:
> > > > >
> > > > > Dynamic replicator:
> > > > > "arm,coresight-dynamic-replicator", "arm,primecell";
> > > > >
> > > > > Static replicator:
> > > > > "arm,coresight-static-replicator";
> > > > > "arm,coresight-replicator"; (obsolete)
> > > > >
> > > > > Signed-off-by: Leo Yan <[email protected]>
> > > > > ---
> > > > > Documentation/devicetree/bindings/arm/coresight.txt | 7 +++++--
> > > > > 1 file changed, 5 insertions(+), 2 deletions(-)
> > > > >
> > > > > diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt
> > > > > index f8aff65ab921..d02d160fa8ac 100644
> > > > > --- a/Documentation/devicetree/bindings/arm/coresight.txt
> > > > > +++ b/Documentation/devicetree/bindings/arm/coresight.txt
> > > > > @@ -69,7 +69,10 @@ its hardware characteristcs.
> > > > >
> > > > > * compatible: Currently supported value is (note the absence of the
> > > > > AMBA markee):
> > > > > - - "arm,coresight-replicator"
> > > > > + - Coresight Non-configurable Replicator:
> > > > > + "arm,coresight-static-replicator";
> > > > > + "arm,coresight-replicator"; (OBSOLETE. For backward
> > > > > + compatibility and will be removed)
> > > > >
> > > > > * port or ports: see "Graph bindings for Coresight" below.
> > > > >
> > > > > @@ -169,7 +172,7 @@ Example:
> > > > > /* non-configurable replicators don't show up on the
> > > > > * AMBA bus. As such no need to add "arm,primecell".
> > > > > */
> > > > > - compatible = "arm,coresight-replicator";
> > > > > + compatible = "arm,coresight-static-replicator";
> > > > >
> > > > > out-ports {
> > > > > #address-cells = <1>;
> > > > > --
> > > > > 2.17.1
> > > >
> > > > Since this is a binding patch it needs to be sent on its own.
> > >
> > > Thanks for reminding, Mathieu.
> > >
> > > Since this is the second time you remind me to send DT binding related
> > > patches separately, so I may misunderstand your meaning and want to get
> > > clarification to avoid making the same mistake for many times.
> > >
> > > Before I remembered in one patch set we need to organise patches with
> > > sending document patch (or document changing patch) ahead and then
> > > followed by the corresponding code change patch. So this can give the
> > > reviewers more clear context; and this also can present the merging
> > > dependency between document change patches and the code change patches.
> > >
> > > This is the rule I followed in this patch set and I sent to CoreSight
> > > and DT maintainers (and mailing lists) together.
> > >
> > > Please let me know what you think about this? And also welcome
> > > Rob/Mark's suggestions.
> >
> > https://www.kernel.org/doc/Documentation/devicetree/bindings/submitting-patches.txt
>
> I'm not clear on what you are asking for. Binding patches should be
> separate patch, but can and should still be in a series if there's
> relevant code changes.

The fault is mine - I reviewed Leo's patchset while seriously jet lagged and
sent him in the weeds. Apologies for the confusion.

Mathieu

>
> Rob

2019-04-26 16:27:50

by Mathieu Poirier

[permalink] [raw]
Subject: Re: [PATCH v5 0/4] CoreSight: Support static funnel with DT binding consolidation

On Fri, 12 Apr 2019 at 04:27, Leo Yan <[email protected]> wrote:
>
> Since before there have no platforms use static funnel in mainline
> kernel (though maybe some in-house SoC has used it but didn't upstream
> for mainline kernel yet so we don't be aware for it), when enable
> CoreSight DT binding for hikey960, we found the SoC uses the static
> funnel in the link path and but it's not supported in CoreSight funnel
> driver.
>
> When support static funnel it's found the DT binding compatible string
> doesn't follow the same fashion between replicator and funnel; so the
> first two patches are firstly to refine the replicator DT binding and
> correspondingly, change the replicator driver to support new DT binding
> compatible.
>
> Patch 0003 is to update DT documentation to support static funnel (we
> call it as non-configurable funnel in documentation) and unify the
> compatible string with the same fashion for replicator and funnel.
>
> Patch 0004 is to support the static funnel in the CoreSight funnel
> driver.
>
> The consolidated DT binding compatible strings are as below:
>
> Dynamic replicator:
> "arm,coresight-dynamic-replicator", "arm,primecell";
>
> Static replicator:
> "arm,coresight-static-replicator";
> "arm,coresight-replicator"; (obsolete)
>
> Static funnel:
> "arm,coresight-static-funnel";
>
> Dynamic funnel:
> "arm,coresight-dynamic-funnel", "arm,primecell";
> "arm,coresight-funnel", "arm,primecell"; (obsolete)
>
> This patch set has been rebased on CoreSight next branch [1] with
> latest commit d5d246a56af0 ("coresight: Merge the static and dynamic
> replicator drivers") and tested on Hikey960/Hikey with perf commands:
>
> Hikey960:
>
> # perf record -e cs_etm/@ec033000.etr/ --per-thread ./main
> # perf report --tui
>
> Hikey:
>
> # perf record -e cs_etm/@f6404000.etr/ --per-thread uname
> # perf report --tui
>
> [1] https://git.linaro.org/kernel/coresight.git/log/?h=next
>
> == Changes for v5 ==
> * Marked the the obsolete compatible strings to be more abvious
> (Suzuki).
> * Used pr_warn_once() to print out warning if DT binding uses
> the obsolete compatible string (Suzuki).
>
> == Changes for v4 ==
> * Consolidate the DT binding compatible strings for replicator and
> funnel (Mathieu).
> * Changed replicator driver to support new compatible string.
>
>
> Leo Yan (4):
> dt-bindings: arm: coresight: Add new compatible for static replicator
> coresight: replicator: Add new device id for static replicator
> dt-bindings: arm: coresight: Unify funnel DT binding
> coresight: funnel: Support static funnel
>
> .../devicetree/bindings/arm/coresight.txt | 60 +++++++--
> .../hwtracing/coresight/coresight-funnel.c | 116 ++++++++++++++----
> .../coresight/coresight-replicator.c | 6 +-
> 3 files changed, 147 insertions(+), 35 deletions(-)

I have applied this set.

Thanks,
Mathieu

>
> --
> 2.17.1
>

2019-04-27 00:21:54

by Leo Yan

[permalink] [raw]
Subject: Re: [PATCH v5 0/4] CoreSight: Support static funnel with DT binding consolidation

On Fri, Apr 26, 2019 at 10:26:24AM -0600, Mathieu Poirier wrote:

[...]

> > Leo Yan (4):
> > dt-bindings: arm: coresight: Add new compatible for static replicator
> > coresight: replicator: Add new device id for static replicator
> > dt-bindings: arm: coresight: Unify funnel DT binding
> > coresight: funnel: Support static funnel
> >
> > .../devicetree/bindings/arm/coresight.txt | 60 +++++++--
> > .../hwtracing/coresight/coresight-funnel.c | 116 ++++++++++++++----
> > .../coresight/coresight-replicator.c | 6 +-
> > 3 files changed, 147 insertions(+), 35 deletions(-)
>
> I have applied this set.

Thanks, Mathieu. Also thanks Rob and you for clarification DT binding.

2019-05-03 15:13:42

by Suzuki K Poulose

[permalink] [raw]
Subject: Re: [PATCH v5 4/4] coresight: funnel: Support static funnel

Leo,


On 12/04/2019 11:27, Leo Yan wrote:
> Since CoreSight hardware topology can use a 'hidden' funnel in the
> trace data path, this kind funnel doesn't have register for accessing
> and is used by default from hardware design perspective. Below is an
> example for related hardware topology:
>
> +------+ +------+
> | cpu0 |->| ETM |-\
> +------+ +------+ \-> +--------+ +-----+
> ...... | Funnel |->| ETF |-\ Hidden funnel
> +------+ +------+ /-> +--------+ +-----+ \ |
> | cpu3 |->| ETM |-/ \ V
> +------+ +------+ \-> +--------+
> | Funnel |-> ...
> +------+ +------+ /-> +--------+
> | cpu4 |->| ETM |-\ /
> +------+ +------+ \-> +--------+ +-----+ /
> ...... | Funnel |->| ETF |-/
> +------+ +------+ /-> +--------+ +-----+
> | cpu7 |->| ETM |-/
> +------+ +------+
>
> The CoreSight funnel driver only supports dynamic funnel with
> registration register resource, thus it cannot support for the static
> funnel case and it's impossible to create trace data path for this case.
>
> This patch is to extend CoreSight funnel driver to support both for
> static funnel and dynamic funnel. For the dynamic funnel it reuses the
> code existed in the driver, for static funnel the driver will support
> device probe if without providing register resource and the driver skips
> registers accessing when detect the register base is NULL.
>
> Cc: Mathieu Poirier <[email protected]>
> Cc: Suzuki K Poulose <[email protected]>
> Cc: Wanglai Shi <[email protected]>
> Suggested-by: Suzuki K Poulose <[email protected]>
> Signed-off-by: Leo Yan <[email protected]>
> Reviewed-by: Suzuki K Poulose <[email protected]>

>
> + if (of_device_is_compatible(np, "arm,coresight-funnel"))
> + pr_warn_once("Uses OBSOLETE CoreSight funnel binding\n");
> +

Given that we now warn about OBSOLETE bindings, please could you fix
the existing DTS in the kernel source tree to use the new binding ?
Similarly for the replicator.

Suzuki

2019-05-05 01:30:07

by Leo Yan

[permalink] [raw]
Subject: Re: [PATCH v5 4/4] coresight: funnel: Support static funnel

Hi Suzuki,

On Fri, May 03, 2019 at 04:11:50PM +0100, Suzuki K Poulose wrote:

[...]

> Given that we now warn about OBSOLETE bindings, please could you fix
> the existing DTS in the kernel source tree to use the new binding ?
> Similarly for the replicator.

Yeah, will do. Thanks for reminding.

Thanks,
Leo Yan