From: Anshuman Khandual <anshuman.khandual@arm.com> To: linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Cc: Anshuman Khandual <anshuman.khandual@arm.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, Sudeep Holla <sudeep.holla@arm.com>, Mike Leach <mike.leach@linaro.org>, James Clark <james.clark@arm.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH V7 03/11] coresight: tmc: Extract device properties from AMBA pid based table lookup Date: Thu, 14 Mar 2024 11:28:35 +0530 [thread overview] Message-ID: <20240314055843.2625883-4-anshuman.khandual@arm.com> (raw) In-Reply-To: <20240314055843.2625883-1-anshuman.khandual@arm.com> This extracts device properties from AMBA pid based table lookup. But first this modifies tmc_etr_setup_caps() to accept csdev access. Cc: Suzuki K Poulose <suzuki.poulose@arm.com> Cc: Mike Leach <mike.leach@linaro.org> Cc: James Clark <james.clark@arm.com> Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> --- drivers/hwtracing/coresight/coresight-tmc-core.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c index 72005b0c633e..1a5ca65d8677 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-core.c +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c @@ -370,16 +370,23 @@ static inline bool tmc_etr_has_non_secure_access(struct tmc_drvdata *drvdata) return (auth & TMC_AUTH_NSID_MASK) == 0x3; } +static const struct amba_id tmc_ids[]; + /* Detect and initialise the capabilities of a TMC ETR */ -static int tmc_etr_setup_caps(struct device *parent, u32 devid, void *dev_caps) +static int tmc_etr_setup_caps(struct device *parent, u32 devid, + struct csdev_access *access) { int rc; - u32 dma_mask = 0; + u32 tmc_pid, dma_mask = 0; struct tmc_drvdata *drvdata = dev_get_drvdata(parent); + void *dev_caps; if (!tmc_etr_has_non_secure_access(drvdata)) return -EACCES; + tmc_pid = coresight_get_pid(access); + dev_caps = coresight_get_uci_data_from_amba(tmc_ids, tmc_pid); + /* Set the unadvertised capabilities */ tmc_etr_init_caps(drvdata, (u32)(unsigned long)dev_caps); @@ -497,8 +504,7 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) desc.type = CORESIGHT_DEV_TYPE_SINK; desc.subtype.sink_subtype = CORESIGHT_DEV_SUBTYPE_SINK_SYSMEM; desc.ops = &tmc_etr_cs_ops; - ret = tmc_etr_setup_caps(dev, devid, - coresight_get_uci_data(id)); + ret = tmc_etr_setup_caps(dev, devid, &desc.access); if (ret) goto out; idr_init(&drvdata->idr); -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: Anshuman Khandual <anshuman.khandual@arm.com> To: linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Cc: Anshuman Khandual <anshuman.khandual@arm.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, Sudeep Holla <sudeep.holla@arm.com>, Mike Leach <mike.leach@linaro.org>, James Clark <james.clark@arm.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH V7 03/11] coresight: tmc: Extract device properties from AMBA pid based table lookup Date: Thu, 14 Mar 2024 11:28:35 +0530 [thread overview] Message-ID: <20240314055843.2625883-4-anshuman.khandual@arm.com> (raw) In-Reply-To: <20240314055843.2625883-1-anshuman.khandual@arm.com> This extracts device properties from AMBA pid based table lookup. But first this modifies tmc_etr_setup_caps() to accept csdev access. Cc: Suzuki K Poulose <suzuki.poulose@arm.com> Cc: Mike Leach <mike.leach@linaro.org> Cc: James Clark <james.clark@arm.com> Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> --- drivers/hwtracing/coresight/coresight-tmc-core.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c index 72005b0c633e..1a5ca65d8677 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-core.c +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c @@ -370,16 +370,23 @@ static inline bool tmc_etr_has_non_secure_access(struct tmc_drvdata *drvdata) return (auth & TMC_AUTH_NSID_MASK) == 0x3; } +static const struct amba_id tmc_ids[]; + /* Detect and initialise the capabilities of a TMC ETR */ -static int tmc_etr_setup_caps(struct device *parent, u32 devid, void *dev_caps) +static int tmc_etr_setup_caps(struct device *parent, u32 devid, + struct csdev_access *access) { int rc; - u32 dma_mask = 0; + u32 tmc_pid, dma_mask = 0; struct tmc_drvdata *drvdata = dev_get_drvdata(parent); + void *dev_caps; if (!tmc_etr_has_non_secure_access(drvdata)) return -EACCES; + tmc_pid = coresight_get_pid(access); + dev_caps = coresight_get_uci_data_from_amba(tmc_ids, tmc_pid); + /* Set the unadvertised capabilities */ tmc_etr_init_caps(drvdata, (u32)(unsigned long)dev_caps); @@ -497,8 +504,7 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) desc.type = CORESIGHT_DEV_TYPE_SINK; desc.subtype.sink_subtype = CORESIGHT_DEV_SUBTYPE_SINK_SYSMEM; desc.ops = &tmc_etr_cs_ops; - ret = tmc_etr_setup_caps(dev, devid, - coresight_get_uci_data(id)); + ret = tmc_etr_setup_caps(dev, devid, &desc.access); if (ret) goto out; idr_init(&drvdata->idr); -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-03-14 5:59 UTC|newest] Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-03-14 5:58 [PATCH V7 00/11] coresight: Move remaining AMBA ACPI devices into platform driver Anshuman Khandual 2024-03-14 5:58 ` Anshuman Khandual 2024-03-14 5:58 ` [PATCH V7 01/11] coresight: etm4x: Fix unbalanced pm_runtime_enable() Anshuman Khandual 2024-03-14 5:58 ` Anshuman Khandual 2024-03-14 5:58 ` [PATCH V7 02/11] coresight: stm: Extract device name from AMBA pid based table lookup Anshuman Khandual 2024-03-14 5:58 ` Anshuman Khandual 2024-03-14 5:58 ` Anshuman Khandual [this message] 2024-03-14 5:58 ` [PATCH V7 03/11] coresight: tmc: Extract device properties " Anshuman Khandual 2024-03-14 5:58 ` [PATCH V7 04/11] coresight: Add helpers registering/removing both AMBA and platform drivers Anshuman Khandual 2024-03-14 5:58 ` Anshuman Khandual 2024-03-14 5:58 ` [PATCH V7 05/11] coresight: replicator: Move ACPI support from AMBA driver to platform driver Anshuman Khandual 2024-03-14 5:58 ` Anshuman Khandual 2024-03-14 5:58 ` [PATCH V7 06/11] coresight: funnel: " Anshuman Khandual 2024-03-14 5:58 ` Anshuman Khandual 2024-03-14 5:58 ` [PATCH V7 07/11] coresight: catu: " Anshuman Khandual 2024-03-14 5:58 ` Anshuman Khandual 2024-03-14 5:58 ` [PATCH V7 08/11] coresight: tpiu: " Anshuman Khandual 2024-03-14 5:58 ` Anshuman Khandual 2024-03-14 5:58 ` [PATCH V7 09/11] coresight: tmc: " Anshuman Khandual 2024-03-14 5:58 ` Anshuman Khandual 2024-03-14 5:58 ` [PATCH V7 10/11] coresight: stm: " Anshuman Khandual 2024-03-14 5:58 ` Anshuman Khandual 2024-03-14 5:58 ` [PATCH V7 11/11] coresight: debug: " Anshuman Khandual 2024-03-14 5:58 ` Anshuman Khandual 2024-04-02 4:43 ` [PATCH V7 00/11] coresight: Move remaining AMBA ACPI devices into " Anshuman Khandual 2024-04-02 4:43 ` Anshuman Khandual 2024-04-22 9:59 ` Suzuki K Poulose 2024-04-22 9:59 ` Suzuki K Poulose
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=20240314055843.2625883-4-anshuman.khandual@arm.com \ --to=anshuman.khandual@arm.com \ --cc=alexandre.torgue@foss.st.com \ --cc=coresight@lists.linaro.org \ --cc=james.clark@arm.com \ --cc=linux-acpi@vger.kernel.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-stm32@st-md-mailman.stormreply.com \ --cc=lpieralisi@kernel.org \ --cc=mcoquelin.stm32@gmail.com \ --cc=mike.leach@linaro.org \ --cc=sudeep.holla@arm.com \ --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: linkBe 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.