All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perf/imx_ddr: add enhanced AXI ID filter support
@ 2019-09-06  8:26 Joakim Zhang
  2019-09-06  8:26 ` [PATCH 2/2] doc/perf: add DDR_CAP_AXI_ID_FILTER_ENHANCED quirk explanation Joakim Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Joakim Zhang @ 2019-09-06  8:26 UTC (permalink / raw)
  To: will, mark.rutland, robin.murphy, Frank Li
  Cc: dl-linux-imx, linux-arm-kernel, Joakim Zhang

With DDR_CAP_AXI_ID_FILTER quirk, indicating HW supports AXI ID filter
which only can get bursts of reading/writing DDR, i.e. DDR read/write
request.

This patch add DDR_CAP_AXI_ID_ENHANCED_FILTER quirk, indicating HW
supports AXI ID filter which can get bytes of reading/writing DDR. This
feature is more meaningful due to we always care more about bandwidth.

Need select both above two qiurks together when HW support enhanced AXI
ID filter.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 drivers/perf/fsl_imx8_ddr_perf.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_perf.c
index ce7345745b42..5f70dbfa9607 100644
--- a/drivers/perf/fsl_imx8_ddr_perf.c
+++ b/drivers/perf/fsl_imx8_ddr_perf.c
@@ -45,7 +45,8 @@
 static DEFINE_IDA(ddr_ida);
 
 /* DDR Perf hardware feature */
-#define DDR_CAP_AXI_ID_FILTER          0x1     /* support AXI ID filter */
+#define DDR_CAP_AXI_ID_FILTER			BIT(1)     /* support AXI ID filter */
+#define DDR_CAP_AXI_ID_FILTER_ENHANCED		BIT(2)     /* support enhanced AXI ID filter */
 
 struct fsl_ddr_devtype_data {
 	unsigned int quirks;    /* quirks needed for different DDR Perf core */
@@ -209,7 +210,15 @@ static void ddr_perf_free_counter(struct ddr_pmu *pmu, int counter)
 
 static u32 ddr_perf_read_counter(struct ddr_pmu *pmu, int counter)
 {
-	return readl_relaxed(pmu->base + COUNTER_READ + counter * 4);
+	if ((pmu->devtype_data->quirks & DDR_CAP_AXI_ID_FILTER) &&
+	    (pmu->devtype_data->quirks & DDR_CAP_AXI_ID_FILTER_ENHANCED)) {
+		if ((pmu->events[counter]->attr.config == 0x41) ||
+		    (pmu->events[counter]->attr.config == 0x42))
+			return readl_relaxed(pmu->base + COUNTER_DPCR1 + counter * 4);
+		else
+			return readl_relaxed(pmu->base + COUNTER_READ + counter * 4);
+	} else
+		return readl_relaxed(pmu->base + COUNTER_READ + counter * 4);
 }
 
 static bool ddr_perf_is_filtered(struct perf_event *event)
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-10-31  1:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06  8:26 [PATCH 1/2] perf/imx_ddr: add enhanced AXI ID filter support Joakim Zhang
2019-09-06  8:26 ` [PATCH 2/2] doc/perf: add DDR_CAP_AXI_ID_FILTER_ENHANCED quirk explanation Joakim Zhang
2019-09-16  8:34 ` [PATCH 1/2] perf/imx_ddr: add enhanced AXI ID filter support Joakim Zhang
2019-10-28 14:54 ` Will Deacon
2019-10-29  7:02   ` Joakim Zhang
2019-10-30 15:36     ` Will Deacon
2019-10-31  1:42       ` Joakim Zhang

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.