Skip to contentSkip to conversation

dt-bindings: perf: fsl-imx-ddr: Add i.MX91 compatible

PATCH Applied Xu Yang 5 participants 15 messages Sep 24, 2024 – Oct 29, 2024

Subsystems (6)
lore
Share & tools
lore

Xu Yang

author maintainer
#0 lore raw

PATCH 1/3 dt-bindings: perf: fsl-imx-ddr: Add i.MX91 compatible

i.MX91 has a DDR Performance Monitor Unit which is compatible with i.MX93. This will add a compatible for i.MX91.

---
 Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml +3 -1
index 37e8b98f2cdc..8597ea625edb 100644
@@ -31,7 +31,9 @@ properties:
           - const: fsl,imx8dxl-ddr-pmu
           - const: fsl,imx8-ddr-pmu
       - items:
-          - const: fsl,imx95-ddr-pmu
+          - enum:
+              - fsl,imx91-ddr-pmu
+              - fsl,imx95-ddr-pmu
           - const: fsl,imx93-ddr-pmu
 
   reg:
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH 2/3 perf: imx_perf: add support for i.MX91 platform

This will add compatible and identifier for i.MX91 platform.

---
 drivers/perf/fsl_imx9_ddr_perf.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/perf/fsl_imx9_ddr_perf.c +5 -0
index 69f920b1caf2..fe1a51f64751 100644
@@ -81,6 +81,10 @@ struct ddr_pmu {
 	int id;
 };
 
+static const struct imx_ddr_devtype_data imx91_devtype_data = {
+	.identifier = "imx91",
+};
+
 static const struct imx_ddr_devtype_data imx93_devtype_data = {
 	.identifier = "imx93",
 };
@@ -100,6 +104,7 @@ static inline bool is_imx95(struct ddr_pmu *pmu)
 }
 
 static const struct of_device_id imx_ddr_pmu_dt_ids[] = {
+	{ .compatible = "fsl,imx91-ddr-pmu", .data = &imx91_devtype_data },
 	{ .compatible = "fsl,imx93-ddr-pmu", .data = &imx93_devtype_data },
 	{ .compatible = "fsl,imx95-ddr-pmu", .data = &imx95_devtype_data },
 	{ /* sentinel */ }
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 2/3
#2 lore raw

Re: [PATCH 2/3] perf: imx_perf: add support for i.MX91 platform

Quoted 3 lines · Xu Yang

This will add compatible and identifier for i.MX91 platform.

Quoted 30 lines
---
 drivers/perf/fsl_imx9_ddr_perf.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/perf/fsl_imx9_ddr_perf.c +5 -1
index 69f920b1caf2..fe1a51f64751 100644
@@ -81,6 +81,10 @@ struct ddr_pmu {
 	int id;
 };
 
+static const struct imx_ddr_devtype_data imx91_devtype_data = {
+	.identifier = "imx91",
+};
+
 static const struct imx_ddr_devtype_data imx93_devtype_data = {
 	.identifier = "imx93",
 };
@@ -100,6 +104,7 @@ static inline bool is_imx95(struct ddr_pmu *pmu)
 }
 
 static const struct of_device_id imx_ddr_pmu_dt_ids[] = {
+	{ .compatible = "fsl,imx91-ddr-pmu", .data = &imx91_devtype_data },
 	{ .compatible = "fsl,imx93-ddr-pmu", .data = &imx93_devtype_data },
 	{ .compatible = "fsl,imx95-ddr-pmu", .data = &imx95_devtype_data },
 	{ /* sentinel */ }
--

2.34.1

author maintainer
#3 lore raw

PATCH 3/3 perf vendor events arm64: Add i.MX91 DDR Performance Monitor metrics

In reply to Xu Yang

Add JSON metrics for i.MX91 DDR Performance Monitor.

---
 .../arch/arm64/freescale/imx91/sys/ddrc.json  |  9 +++++++
 .../arm64/freescale/imx91/sys/metrics.json    | 26 +++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/ddrc.json
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/metrics.json
tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/ddrc.json new file +9 -0
new file mode 100644
index 000000000000..74ac12660a29
@@ -0,0 +1,9 @@
+[
+   {
+           "BriefDescription": "ddr cycles event",
+           "EventCode": "0x00",
+           "EventName": "imx91_ddr.cycles",
+           "Unit": "imx9_ddr",
+           "Compat": "imx91"
+   }
+]
tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/metrics.json new file +26 -0
new file mode 100644
index 000000000000..f0c5911eb2d0
@@ -0,0 +1,26 @@
+[
+   {
+	    "BriefDescription": "bandwidth usage for lpddr4 evk board",
+	    "MetricName": "imx91_bandwidth_usage.lpddr4",
+	    "MetricExpr": "(((( imx9_ddr0@ddrc_pm_0@ ) * 2 * 8 ) + (( imx9_ddr0@ddrc_pm_3@ + imx9_ddr0@ddrc_pm_5@ + imx9_ddr0@ddrc_pm_7@ + imx9_ddr0@ddrc_pm_9@ - imx9_ddr0@ddrc_pm_2@ - imx9_ddr0@ddrc_pm_4@ - imx9_ddr0@ddrc_pm_6@ - imx9_ddr0@ddrc_pm_8@ ) * 32 )) / duration_time) / (2400 * 1000000 * 2)",
+	    "ScaleUnit": "1e2%",
+	    "Unit": "imx9_ddr",
+	    "Compat": "imx91"
+   },
+   {
+	    "BriefDescription": "bytes all masters read from ddr",
+	    "MetricName": "imx91_ddr_read.all",
+	    "MetricExpr": "( imx9_ddr0@ddrc_pm_0@ ) * 2 * 8",
+	    "ScaleUnit": "9.765625e-4KB",
+	    "Unit": "imx9_ddr",
+	    "Compat": "imx91"
+   },
+   {
+	    "BriefDescription": "bytes all masters write to ddr",
+	    "MetricName": "imx91_ddr_write.all",
+	    "MetricExpr": "( imx9_ddr0@ddrc_pm_3@ + imx9_ddr0@ddrc_pm_5@ + imx9_ddr0@ddrc_pm_7@ + imx9_ddr0@ddrc_pm_9@ - imx9_ddr0@ddrc_pm_2@ - imx9_ddr0@ddrc_pm_4@ - imx9_ddr0@ddrc_pm_6@ - imx9_ddr0@ddrc_pm_8@ ) * 32",
+	    "ScaleUnit": "9.765625e-4KB",
+	    "Unit": "imx9_ddr",
+	    "Compat": "imx91"
+   }
+]
Signature · 1 line
2.34.1
maintainer Acked-by on v1 3/3
#4 lore raw

Re: [PATCH 3/3] perf vendor events arm64: Add i.MX91 DDR Performance Monitor metrics

Hello,

Quoted 9 lines · Xu Yang

Add JSON metrics for i.MX91 DDR Performance Monitor.

---
 .../arch/arm64/freescale/imx91/sys/ddrc.json  |  9 +++++++
 .../arm64/freescale/imx91/sys/metrics.json    | 26 +++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/ddrc.json
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/metrics.json

How do you want to route this? As it's mixed with kernel changes, I would generally request to split but it's a change just to add new files so it should be ok to go with other tree. In that case,

Thanks,
Namhyung

Quoted 51 lines
tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/ddrc.json new file +9 -0
new file mode 100644
index 000000000000..74ac12660a29
@@ -0,0 +1,9 @@
+[
+   {
+           "BriefDescription": "ddr cycles event",
+           "EventCode": "0x00",
+           "EventName": "imx91_ddr.cycles",
+           "Unit": "imx9_ddr",
+           "Compat": "imx91"
+   }
+]
tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/metrics.json new file +26 -0
new file mode 100644
index 000000000000..f0c5911eb2d0
@@ -0,0 +1,26 @@
+[
+   {
+	    "BriefDescription": "bandwidth usage for lpddr4 evk board",
+	    "MetricName": "imx91_bandwidth_usage.lpddr4",
+	    "MetricExpr": "(((( imx9_ddr0@ddrc_pm_0@ ) * 2 * 8 ) + (( imx9_ddr0@ddrc_pm_3@ + imx9_ddr0@ddrc_pm_5@ + imx9_ddr0@ddrc_pm_7@ + imx9_ddr0@ddrc_pm_9@ - imx9_ddr0@ddrc_pm_2@ - imx9_ddr0@ddrc_pm_4@ - imx9_ddr0@ddrc_pm_6@ - imx9_ddr0@ddrc_pm_8@ ) * 32 )) / duration_time) / (2400 * 1000000 * 2)",
+	    "ScaleUnit": "1e2%",
+	    "Unit": "imx9_ddr",
+	    "Compat": "imx91"
+   },
+   {
+	    "BriefDescription": "bytes all masters read from ddr",
+	    "MetricName": "imx91_ddr_read.all",
+	    "MetricExpr": "( imx9_ddr0@ddrc_pm_0@ ) * 2 * 8",
+	    "ScaleUnit": "9.765625e-4KB",
+	    "Unit": "imx9_ddr",
+	    "Compat": "imx91"
+   },
+   {
+	    "BriefDescription": "bytes all masters write to ddr",
+	    "MetricName": "imx91_ddr_write.all",
+	    "MetricExpr": "( imx9_ddr0@ddrc_pm_3@ + imx9_ddr0@ddrc_pm_5@ + imx9_ddr0@ddrc_pm_7@ + imx9_ddr0@ddrc_pm_9@ - imx9_ddr0@ddrc_pm_2@ - imx9_ddr0@ddrc_pm_4@ - imx9_ddr0@ddrc_pm_6@ - imx9_ddr0@ddrc_pm_8@ ) * 32",
+	    "ScaleUnit": "9.765625e-4KB",
+	    "Unit": "imx9_ddr",
+	    "Compat": "imx91"
+   }
+]
Signature · 1 line
2.34.1
author maintainer
#5 lore raw

Re: [PATCH 3/3] perf vendor events arm64: Add i.MX91 DDR Performance Monitor metrics

Hi Namhyung,

Quoted 13 lines · Namhyung Kim

Hello,

Quoted 9 lines · Xu Yang

Add JSON metrics for i.MX91 DDR Performance Monitor.

---
 .../arch/arm64/freescale/imx91/sys/ddrc.json  |  9 +++++++
 .../arm64/freescale/imx91/sys/metrics.json    | 26 +++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/ddrc.json
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/metrics.json
Quoted 3 lines

How do you want to route this? As it's mixed with kernel changes, I would generally request to split but it's a change just to add new files so it should be ok to go with other tree. In that case,

Sorry for late.

How about you pick up this one to perf-tools tree and Will Deacon pick up the first 2 patches to his tree? I didn't see Will apply perf-tools patch before.

Thanks,
Xu Yang

Quoted 57 lines

Thanks,
Namhyung

Quoted 51 lines
tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/ddrc.json new file +9 -0
new file mode 100644
index 000000000000..74ac12660a29
@@ -0,0 +1,9 @@
+[
+   {
+           "BriefDescription": "ddr cycles event",
+           "EventCode": "0x00",
+           "EventName": "imx91_ddr.cycles",
+           "Unit": "imx9_ddr",
+           "Compat": "imx91"
+   }
+]
tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/metrics.json new file +26 -0
new file mode 100644
index 000000000000..f0c5911eb2d0
@@ -0,0 +1,26 @@
+[
+   {
+	    "BriefDescription": "bandwidth usage for lpddr4 evk board",
+	    "MetricName": "imx91_bandwidth_usage.lpddr4",
+	    "MetricExpr": "(((( imx9_ddr0@ddrc_pm_0@ ) * 2 * 8 ) + (( imx9_ddr0@ddrc_pm_3@ + imx9_ddr0@ddrc_pm_5@ + imx9_ddr0@ddrc_pm_7@ + imx9_ddr0@ddrc_pm_9@ - imx9_ddr0@ddrc_pm_2@ - imx9_ddr0@ddrc_pm_4@ - imx9_ddr0@ddrc_pm_6@ - imx9_ddr0@ddrc_pm_8@ ) * 32 )) / duration_time) / (2400 * 1000000 * 2)",
+	    "ScaleUnit": "1e2%",
+	    "Unit": "imx9_ddr",
+	    "Compat": "imx91"
+   },
+   {
+	    "BriefDescription": "bytes all masters read from ddr",
+	    "MetricName": "imx91_ddr_read.all",
+	    "MetricExpr": "( imx9_ddr0@ddrc_pm_0@ ) * 2 * 8",
+	    "ScaleUnit": "9.765625e-4KB",
+	    "Unit": "imx9_ddr",
+	    "Compat": "imx91"
+   },
+   {
+	    "BriefDescription": "bytes all masters write to ddr",
+	    "MetricName": "imx91_ddr_write.all",
+	    "MetricExpr": "( imx9_ddr0@ddrc_pm_3@ + imx9_ddr0@ddrc_pm_5@ + imx9_ddr0@ddrc_pm_7@ + imx9_ddr0@ddrc_pm_9@ - imx9_ddr0@ddrc_pm_2@ - imx9_ddr0@ddrc_pm_4@ - imx9_ddr0@ddrc_pm_6@ - imx9_ddr0@ddrc_pm_8@ ) * 32",
+	    "ScaleUnit": "9.765625e-4KB",
+	    "Unit": "imx9_ddr",
+	    "Compat": "imx91"
+   }
+]
Signature · 1 line
2.34.1
maintainer
#6 lore raw

Re: [PATCH 3/3] perf vendor events arm64: Add i.MX91 DDR Performance Monitor metrics

Quoted 20 lines · Xu Yang

Hi Namhyung,

Quoted 13 lines · Namhyung Kim

Hello,

Quoted 9 lines · Xu Yang

Add JSON metrics for i.MX91 DDR Performance Monitor.

---
 .../arch/arm64/freescale/imx91/sys/ddrc.json  |  9 +++++++
 .../arm64/freescale/imx91/sys/metrics.json    | 26 +++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/ddrc.json
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/metrics.json
Quoted 3 lines

How do you want to route this? As it's mixed with kernel changes, I would generally request to split but it's a change just to add new files so it should be ok to go with other tree. In that case,

Quoted 5 lines

Sorry for late.

How about you pick up this one to perf-tools tree and Will Deacon pick up the first 2 patches to his tree? I didn't see Will apply perf-tools patch before.

Did Will pick up the kernel patches already?

Thanks,
Namhyung

author maintainer
#7 lore raw

Re: [PATCH 3/3] perf vendor events arm64: Add i.MX91 DDR Performance Monitor metrics

Quoted 21 lines · Namhyung Kim
Quoted 20 lines · Xu Yang

Hi Namhyung,

Quoted 16 lines · Namhyung Kim

Hello,

Quoted 9 lines · Xu Yang

Add JSON metrics for i.MX91 DDR Performance Monitor.

---
 .../arch/arm64/freescale/imx91/sys/ddrc.json  |  9 +++++++
 .../arm64/freescale/imx91/sys/metrics.json    | 26 +++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/ddrc.json
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/metrics.json

How do you want to route this? As it's mixed with kernel changes, I would generally request to split but it's a change just to add new files so it should be ok to go with other tree. In that case,

Quoted 7 lines
Quoted 5 lines

Sorry for late.

How about you pick up this one to perf-tools tree and Will Deacon pick up the first 2 patches to his tree? I didn't see Will apply perf-tools patch before.

Did Will pick up the kernel patches already?

Not yet. I could ping you once it's done, is it ok?

Thanks,
Xu Yang

maintainer
#8 lore raw

Re: [PATCH 3/3] perf vendor events arm64: Add i.MX91 DDR Performance Monitor metrics

Quoted 24 lines · Xu Yang
Quoted 23 lines · Namhyung Kim
Quoted 22 lines · Xu Yang

Hi Namhyung,

Quoted 13 lines · Namhyung Kim

Hello,

Quoted 9 lines · Xu Yang

Add JSON metrics for i.MX91 DDR Performance Monitor.

---
 .../arch/arm64/freescale/imx91/sys/ddrc.json  |  9 +++++++
 .../arm64/freescale/imx91/sys/metrics.json    | 26 +++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/ddrc.json
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/metrics.json
Quoted 3 lines

How do you want to route this? As it's mixed with kernel changes, I would generally request to split but it's a change just to add new files so it should be ok to go with other tree. In that case,

Sorry for late.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

How about you pick up this one to perf-tools tree and Will Deacon pick up the first 2 patches to his tree? I didn't see Will apply perf-tools patch before.

Did Will pick up the kernel patches already?

Not yet. I could ping you once it's done, is it ok?

Sure!

Thanks,
Namhyung

author maintainer
#9 lore raw

Re: [PATCH 3/3] perf vendor events arm64: Add i.MX91 DDR Performance Monitor metrics

Hi Namhyung,

Quoted 29 lines · Namhyung Kim
Quoted 28 lines · Xu Yang
Quoted 27 lines · Namhyung Kim
Quoted 25 lines · Xu Yang

Hi Namhyung,

Quoted 13 lines · Namhyung Kim

Hello,

Quoted 9 lines · Xu Yang

Add JSON metrics for i.MX91 DDR Performance Monitor.

---
 .../arch/arm64/freescale/imx91/sys/ddrc.json  |  9 +++++++
 .../arm64/freescale/imx91/sys/metrics.json    | 26 +++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/ddrc.json
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/metrics.json
Quoted 3 lines

How do you want to route this? As it's mixed with kernel changes, I would generally request to split but it's a change just to add new files so it should be ok to go with other tree. In that case,

Sorry for late.

How about you pick up this one to perf-tools tree and Will Deacon pick up the first 2 patches to his tree? I didn't see Will apply perf-tools patch before.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Did Will pick up the kernel patches already?

Not yet. I could ping you once it's done, is it ok?

Sure!

You could pick up this path #3 now. :)

Thanks,
Xu Yang

maintainer
#10 lore raw

Re: [PATCH 3/3] perf vendor events arm64: Add i.MX91 DDR Performance Monitor metrics

In reply to Namhyung Kim
Quoted 21 lines · Namhyung Kim
Quoted 20 lines · Xu Yang

Hi Namhyung,

Quoted 16 lines · Namhyung Kim

Hello,

Quoted 9 lines · Xu Yang

Add JSON metrics for i.MX91 DDR Performance Monitor.

---
 .../arch/arm64/freescale/imx91/sys/ddrc.json  |  9 +++++++
 .../arm64/freescale/imx91/sys/metrics.json    | 26 +++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/ddrc.json
 create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/metrics.json

How do you want to route this? As it's mixed with kernel changes, I would generally request to split but it's a change just to add new files so it should be ok to go with other tree. In that case,

Quoted 7 lines
Quoted 5 lines

Sorry for late.

How about you pick up this one to perf-tools tree and Will Deacon pick up the first 2 patches to his tree? I didn't see Will apply perf-tools patch before.

Did Will pick up the kernel patches already?

I have done now, sorry for the delay.

Will

maintainer Applied
#11 lore raw

Re: [PATCH 3/3] perf vendor events arm64: Add i.MX91 DDR Performance Monitor metrics

In reply to Xu Yang
Quoted 3 lines · Xu Yang

Add JSON metrics for i.MX91 DDR Performance Monitor.

Applied to perf-tools-next, thanks!

Best regards,
Namhyung

maintainer Reviewed-by on v1 1/3
#13 lore raw
In reply to Xu Yang
Quoted 5 lines · Xu Yang

i.MX91 has a DDR Performance Monitor Unit which is compatible with i.MX93. This will add a compatible for i.MX91.

---

Quoted 21 lines
 Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml +3 -2
index 37e8b98f2cdc..8597ea625edb 100644
@@ -31,7 +31,9 @@ properties:
           - const: fsl,imx8dxl-ddr-pmu
           - const: fsl,imx8-ddr-pmu
       - items:
-          - const: fsl,imx95-ddr-pmu
+          - enum:
+              - fsl,imx91-ddr-pmu
+              - fsl,imx95-ddr-pmu
           - const: fsl,imx93-ddr-pmu
 
   reg:
--

2.34.1

maintainer
#14 lore raw
In reply to Xu Yang
Quoted 4 lines · Xu Yang

i.MX91 has a DDR Performance Monitor Unit which is compatible with i.MX93. This will add a compatible for i.MX91.

Applied first two patches to will (for-next/perf), thanks!

[1/3] dt-bindings: perf: fsl-imx-ddr: Add i.MX91 compatible

      https://git.kernel.org/will/c/0263a1e4f5dd
[2/3] perf: imx_perf: add support for i.MX91 platform
      https://git.kernel.org/will/c/44798fe136dc

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev