public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: jon-hunter@ti•com (Jon Hunter)
To: linux-arm-kernel@lists•infradead.org
Subject: [RFC 4/8] coresight: add CoreSight ETB driver
Date: Thu, 20 Dec 2012 11:49:03 -0600	[thread overview]
Message-ID: <50D34F8F.5050304@ti.com> (raw)
In-Reply-To: <1355858365-11849-5-git-send-email-pratikp@codeaurora.org>


On 12/18/2012 01:19 PM, pratikp at codeaurora.org wrote:
> From: Pratik Patel <pratikp@codeaurora•org>
> 
> This driver manages CoreSight ETB (Embedded Trace Buffer) which
> acts as a circular buffer sink collecting generated trace data.
> 
> Signed-off-by: Pratik Patel <pratikp@codeaurora•org>
> ---
>  drivers/coresight/Makefile        |    2 +-
>  drivers/coresight/coresight-etb.c |  467 +++++++++++++++++++++++++++++++++++++
>  2 files changed, 468 insertions(+), 1 deletions(-)

[snip]

> +static int __devinit etb_probe(struct platform_device *pdev)
> +{
> +	int ret;
> +	struct device *dev = &pdev->dev;
> +	struct coresight_platform_data *pdata;
> +	struct etb_drvdata *drvdata;
> +	struct resource *res;
> +	struct coresight_desc *desc;
> +
> +	if (pdev->dev.of_node) {
> +		pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node);
> +		if (IS_ERR(pdata))
> +			return PTR_ERR(pdata);
> +		pdev->dev.platform_data = pdata;
> +	}
> +
> +	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
> +	if (!drvdata)
> +		return -ENOMEM;
> +	drvdata->dev = &pdev->dev;
> +	platform_set_drvdata(pdev, drvdata);
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (!res)
> +		return -ENODEV;
> +
> +	drvdata->base = devm_ioremap(dev, res->start, resource_size(res));
> +	if (!drvdata->base)
> +		return -ENOMEM;
> +
> +	spin_lock_init(&drvdata->spinlock);
> +
> +	drvdata->clk = devm_clk_get(dev, "core_clk");
> +	if (IS_ERR(drvdata->clk))
> +		return PTR_ERR(drvdata->clk);
> +
> +	ret = clk_set_rate(drvdata->clk, CORESIGHT_CLK_RATE_TRACE);
> +	if (ret)
> +		return ret;
> +
> +	drvdata->buf = devm_kzalloc(dev, ETB_SIZE_WORDS * BYTES_PER_WORD,
> +				    GFP_KERNEL);
> +	if (!drvdata->buf)
> +		return -ENOMEM;
> +
> +	desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);
> +	if (!desc)
> +		return -ENOMEM;
> +	desc->type = CORESIGHT_DEV_TYPE_SINK;
> +	desc->subtype.sink_subtype = CORESIGHT_DEV_SUBTYPE_SINK_BUFFER;

Can a source be directly connected to a sink or do you need to have a
link in between?

The reason, I ask is because on some Cortex-A8 devices we have ETM
directly connected to ETB and there is no link per-se to configure.

Cheers
Jon

  reply	other threads:[~2012-12-20 17:49 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18 19:19 CoreSight framework and drivers pratikp at codeaurora.org
2012-12-18 19:19 ` [RFC 1/8] coresight: add CoreSight core layer framework pratikp at codeaurora.org
2012-12-18 19:19 ` [RFC 2/8] coresight: add CoreSight TMC driver pratikp at codeaurora.org
2013-02-21 14:20   ` Robert MARKLUND
2012-12-18 19:19 ` [RFC 3/8] coresight: add CoreSight TPIU driver pratikp at codeaurora.org
2012-12-18 19:19 ` [RFC 4/8] coresight: add CoreSight ETB driver pratikp at codeaurora.org
2012-12-20 17:49   ` Jon Hunter [this message]
2012-12-20 19:54     ` Pratik Patel
2012-12-18 19:19 ` [RFC 5/8] coresight: add CoreSight Funnel driver pratikp at codeaurora.org
2012-12-18 19:19 ` [RFC 6/8] coresight: add CoreSight Replicator driver pratikp at codeaurora.org
2012-12-18 19:19 ` [RFC 7/8] coresight: add CoreSight STM driver pratikp at codeaurora.org
2012-12-18 19:19 ` [RFC 8/8] coresight: add CoreSight ETM driver pratikp at codeaurora.org
2012-12-19 11:23 ` CoreSight framework and drivers Will Deacon
2012-12-19 17:03   ` Jon Hunter
2012-12-19 21:24     ` Pratik Patel
2012-12-20 17:46       ` Jon Hunter
2012-12-20 19:51         ` Pratik Patel
2012-12-20 20:16           ` Jean Pihet
2012-12-21 22:12             ` Pratik Patel
2012-12-20 22:54           ` Jon Hunter
2012-12-20 23:40             ` Russell King - ARM Linux
2012-12-21 22:17               ` Pratik Patel
2012-12-21 22:18             ` Pratik Patel
2012-12-23 11:32               ` Will Deacon
2013-01-03 18:06                 ` Pratik Patel
2013-01-07 11:58                   ` Will Deacon
2013-01-16  0:14                     ` Pratik Patel
2013-01-17 10:55                       ` Will Deacon
2013-01-02 20:00               ` Jon Hunter
2013-01-03 19:32                 ` Pratik Patel
2012-12-19 21:06   ` Pratik Patel
2013-02-21 14:32 ` Robert MARKLUND

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50D34F8F.5050304@ti.com \
    --to=jon-hunter@ti$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox