From: pratikp@codeaurora.org (Pratik Patel)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 4/8] coresight: add CoreSight ETB driver
Date: Thu, 20 Dec 2012 11:54:35 -0800 [thread overview]
Message-ID: <20121220195435.GB14877@pratikp-linux.qualcomm.com> (raw)
In-Reply-To: <50D34F8F.5050304@ti.com>
On Thu, Dec 20, 2012 at 11:49:03AM -0600, Jon Hunter wrote:
>
> 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.
>
Source can be directly connected to a sink. I believe the current
code should be able to take care of that but I haven't tried it
since we didn't have such a case.
--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
WARNING: multiple messages have this Message-ID (diff)
From: Pratik Patel <pratikp-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: Jon Hunter <jon-hunter-l0cyMroinI0@public.gmane.org>
Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
will.deacon-5wv7dgnIgG8@public.gmane.org,
magnus.p.persson-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org,
david.rusling-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
arve-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org,
dsaxena-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
d-deao-l0cyMroinI0@public.gmane.org,
christian.bejram-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [RFC 4/8] coresight: add CoreSight ETB driver
Date: Thu, 20 Dec 2012 11:54:35 -0800 [thread overview]
Message-ID: <20121220195435.GB14877@pratikp-linux.qualcomm.com> (raw)
In-Reply-To: <50D34F8F.5050304-l0cyMroinI0@public.gmane.org>
On Thu, Dec 20, 2012 at 11:49:03AM -0600, Jon Hunter wrote:
>
> On 12/18/2012 01:19 PM, pratikp-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org wrote:
> > From: Pratik Patel <pratikp-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.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-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.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.
>
Source can be directly connected to a sink. I believe the current
code should be able to take care of that but I haven't tried it
since we didn't have such a case.
--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
next prev parent reply other threads:[~2012-12-20 19:54 UTC|newest]
Thread overview: 69+ 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 ` pratikp
2012-12-18 19:19 ` [RFC 1/8] coresight: add CoreSight core layer framework pratikp at codeaurora.org
2012-12-18 19:19 ` pratikp-sgV2jX0FEOL9JmXXK+q4OQ
2012-12-18 19:19 ` [RFC 2/8] coresight: add CoreSight TMC driver pratikp at codeaurora.org
2012-12-18 19:19 ` pratikp-sgV2jX0FEOL9JmXXK+q4OQ
2013-02-21 14:20 ` Robert MARKLUND
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 ` pratikp-sgV2jX0FEOL9JmXXK+q4OQ
2012-12-18 19:19 ` [RFC 4/8] coresight: add CoreSight ETB driver pratikp at codeaurora.org
2012-12-18 19:19 ` pratikp-sgV2jX0FEOL9JmXXK+q4OQ
2012-12-20 17:49 ` Jon Hunter
2012-12-20 17:49 ` Jon Hunter
2012-12-20 19:54 ` Pratik Patel [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 ` pratikp-sgV2jX0FEOL9JmXXK+q4OQ
2012-12-18 19:19 ` [RFC 6/8] coresight: add CoreSight Replicator driver pratikp at codeaurora.org
2012-12-18 19:19 ` pratikp-sgV2jX0FEOL9JmXXK+q4OQ
2012-12-18 19:19 ` [RFC 7/8] coresight: add CoreSight STM driver pratikp at codeaurora.org
2012-12-18 19:19 ` pratikp-sgV2jX0FEOL9JmXXK+q4OQ
2012-12-18 19:19 ` [RFC 8/8] coresight: add CoreSight ETM driver pratikp at codeaurora.org
2012-12-18 19:19 ` pratikp-sgV2jX0FEOL9JmXXK+q4OQ
2012-12-19 11:23 ` CoreSight framework and drivers Will Deacon
2012-12-19 11:23 ` Will Deacon
2012-12-19 17:03 ` Jon Hunter
2012-12-19 17:03 ` Jon Hunter
2012-12-19 21:24 ` Pratik Patel
2012-12-19 21:24 ` Pratik Patel
2012-12-20 17:46 ` Jon Hunter
2012-12-20 17:46 ` Jon Hunter
2012-12-20 17:46 ` Jon Hunter
2012-12-20 19:51 ` Pratik Patel
2012-12-20 19:51 ` Pratik Patel
2012-12-20 20:16 ` Jean Pihet
2012-12-20 20:16 ` Jean Pihet
2012-12-21 22:12 ` Pratik Patel
2012-12-21 22:12 ` Pratik Patel
2012-12-20 22:54 ` Jon Hunter
2012-12-20 22:54 ` Jon Hunter
2012-12-20 22:54 ` Jon Hunter
2012-12-20 23:40 ` Russell King - ARM Linux
2012-12-20 23:40 ` Russell King - ARM Linux
2012-12-21 22:17 ` Pratik Patel
2012-12-21 22:17 ` Pratik Patel
2012-12-21 22:18 ` Pratik Patel
2012-12-21 22:18 ` Pratik Patel
[not found] ` <20121221221828.GA2658-9H3kiKr51/JHGpnEYu0o6d07Fnf2crXX0E9HWUfgJXw@public.gmane.org>
2012-12-23 11:32 ` Will Deacon
2012-12-23 11:32 ` Will Deacon
2012-12-23 11:32 ` Will Deacon
2013-01-03 18:06 ` Pratik Patel
2013-01-03 18:06 ` Pratik Patel
[not found] ` <20130103180643.GA30277-9H3kiKr51/JHGpnEYu0o6d07Fnf2crXX0E9HWUfgJXw@public.gmane.org>
2013-01-07 11:58 ` Will Deacon
2013-01-07 11:58 ` Will Deacon
2013-01-07 11:58 ` Will Deacon
2013-01-16 0:14 ` Pratik Patel
2013-01-16 0:14 ` Pratik Patel
2013-01-17 10:55 ` Will Deacon
2013-01-17 10:55 ` Will Deacon
2013-01-02 20:00 ` Jon Hunter
2013-01-02 20:00 ` Jon Hunter
2013-01-02 20:00 ` Jon Hunter
2013-01-03 19:32 ` Pratik Patel
2013-01-03 19:32 ` Pratik Patel
2012-12-19 21:06 ` Pratik Patel
2012-12-19 21:06 ` Pratik Patel
2013-02-21 14:32 ` Robert MARKLUND
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=20121220195435.GB14877@pratikp-linux.qualcomm.com \
--to=pratikp@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.