From: Trilok Soni <quic_tsoni@quicinc.com>
To: Mao Jinlong <quic_jinlmao@quicinc.com>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
"Mike Leach" <mike.leach@linaro.org>,
Leo Yan <leo.yan@linaro.org>, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: <coresight@lists.linaro.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>,
<devicetree@vger.kernel.org>,
Tingwei Zhang <quic_tingweiz@quicinc.com>,
Yuanfang Zhang <quic_yuanfang@quicinc.com>,
Tao Zhang <quic_taozha@quicinc.com>,
Hao Zhang <quic_hazha@quicinc.com>
Subject: Re: [PATCH v1 1/3] Coresight: Add driver to support for CSR
Date: Tue, 30 May 2023 12:21:05 -0700 [thread overview]
Message-ID: <b51c8f75-97f8-604d-cf1a-770cca4078aa@quicinc.com> (raw)
In-Reply-To: <20230526153508.6208-2-quic_jinlmao@quicinc.com>
On 5/26/2023 8:35 AM, Mao Jinlong wrote:
> This driver provides support for CoreSight Slave Register block
> that hosts miscellaneous configuration registers. Those
> configuration registers can be used to control, various coresight
> configurations.
>
> Signed-off-by: Hao Zhang <quic_hazha@quicinc.com>
> Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
> ---
> drivers/hwtracing/coresight/Kconfig | 12 ++
> drivers/hwtracing/coresight/Makefile | 1 +
> drivers/hwtracing/coresight/coresight-csr.c | 142 ++++++++++++++++++++
> drivers/hwtracing/coresight/coresight-csr.h | 54 ++++++++
> 4 files changed, 209 insertions(+)
> create mode 100644 drivers/hwtracing/coresight/coresight-csr.c
> create mode 100644 drivers/hwtracing/coresight/coresight-csr.h
>
> diff --git a/drivers/hwtracing/coresight/Kconfig b/drivers/hwtracing/coresight/Kconfig
> index 2b5bbfffbc4f..e769ea3709d9 100644
> --- a/drivers/hwtracing/coresight/Kconfig
> +++ b/drivers/hwtracing/coresight/Kconfig
> @@ -236,4 +236,16 @@ config CORESIGHT_TPDA
>
> To compile this driver as a module, choose M here: the module will be
> called coresight-tpda.
> +
> +config CORESIGHT_CSR
> + tristate "CoreSight Slave Register driver"
> + help
> + This driver provides support for CoreSight Slave Register block
> + that hosts miscellaneous configuration registers.
> + Those configuration registers can be used to control, various
> + coresight configurations.
> +
> + To compile this driver as a module, choose M here: the module will be
> + called coresight-csr.
> +
> endif
> diff --git a/drivers/hwtracing/coresight/Makefile b/drivers/hwtracing/coresight/Makefile
> index 33bcc3f7b8ae..956c642d05f6 100644
> --- a/drivers/hwtracing/coresight/Makefile
> +++ b/drivers/hwtracing/coresight/Makefile
> @@ -30,3 +30,4 @@ obj-$(CONFIG_CORESIGHT_TPDA) += coresight-tpda.o
> coresight-cti-y := coresight-cti-core.o coresight-cti-platform.o \
> coresight-cti-sysfs.o
> obj-$(CONFIG_ULTRASOC_SMB) += ultrasoc-smb.o
> +obj-$(CONFIG_CORESIGHT_CSR) += coresight-csr.o
> diff --git a/drivers/hwtracing/coresight/coresight-csr.c b/drivers/hwtracing/coresight/coresight-csr.c
> new file mode 100644
> index 000000000000..a1403e8531ee
> --- /dev/null
> +++ b/drivers/hwtracing/coresight/coresight-csr.c
> @@ -0,0 +1,142 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
> + */
> +
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/device.h>
> +#include <linux/platform_device.h>
> +#include <linux/io.h>
> +#include <linux/err.h>
> +#include <linux/slab.h>
> +
> +#include "coresight-priv.h"
> +#include "coresight-csr.h"
> +
> +DEFINE_CORESIGHT_DEVLIST(csr_devs, "csr");
> +
> +static LIST_HEAD(csr_list);
> +
> +/*
> + * Get the CSR by name.
> + */
> +struct coresight_csr *coresight_csr_get(const char *name)
> +{
> + struct coresight_csr *csr;
> +
> + list_for_each_entry(csr, &csr_list, link) {
> + if (!strcmp(csr->name, name))
> + return csr;
> + }
> + return ERR_PTR(-EINVAL);
> +}
> +EXPORT_SYMBOL(coresight_csr_get);
EXPORT_SYMBOL_GPL everywhere in this driver please.
> +
> +/*
> + * Get the device node's name from device tree.
> + */
> +int of_get_coresight_csr_name(struct device_node *node, const char **csr_name)
> +{
> + struct device_node *csr_node;
> +
> + csr_node = of_parse_phandle(node, "coresight-csr", 0);
> + if (!csr_node)
> + return -EINVAL;
> +
> + *csr_name = csr_node->full_name;
> + of_node_put(csr_node);
> + return 0;
> +}
> +EXPORT_SYMBOL(of_get_coresight_csr_name);
---Trilok Soni
next prev parent reply other threads:[~2023-05-30 19:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 15:35 [PATCH v1 0/3] Add support for a streaming interface for TMC ETR Mao Jinlong
2023-05-26 15:35 ` [PATCH v1 1/3] Coresight: Add driver to support for CSR Mao Jinlong
2023-05-30 19:21 ` Trilok Soni [this message]
2023-05-26 15:35 ` [PATCH v1 2/3] coresight-tmc: byte-cntr: Add support for streaming interface for ETR Mao Jinlong
2023-05-27 7:03 ` kernel test robot
2023-05-27 16:43 ` kernel test robot
2023-05-31 7:52 ` Mike Leach
2023-05-26 15:35 ` [PATCH v1 3/3] dt-bindings: arm: Adds CoreSight CSR hardware definitions Mao Jinlong
2023-05-30 15:38 ` Krzysztof Kozlowski
2023-05-30 15:11 ` [PATCH v1 0/3] Add support for a streaming interface for TMC ETR Mike Leach
2023-07-05 8:39 ` Jinlong Mao
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=b51c8f75-97f8-604d-cf1a-770cca4078aa@quicinc.com \
--to=quic_tsoni@quicinc.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=coresight@lists.linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.leach@linaro.org \
--cc=quic_hazha@quicinc.com \
--cc=quic_jinlmao@quicinc.com \
--cc=quic_taozha@quicinc.com \
--cc=quic_tingweiz@quicinc.com \
--cc=quic_yuanfang@quicinc.com \
--cc=robh+dt@kernel.org \
--cc=suzuki.poulose@arm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).