Skip to contentSkip to conversation

Enable imx ddr perfmon on imx8m

PATCH Applied Leonard Crestez 3 participants 9 messages Jul 4, 2019 – Jul 22, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover Enable imx ddr perfmon on imx8m

Driver was upstreamed for imx8qxp and it seems to work on imx8mq/imx8mm without changes.

Add soc-specific compat strings in case we find minor differences later.

Leonard Crestez (3):
perf/imx_ddr: Add MODULE_DEVICE_TABLE
arm64: dts: imx8m: Add ddr-pmu nodes
arm64: defconfig: Build imx8 ddr pmu as module

 arch/arm64/boot/dts/freescale/imx8mm.dtsi | 7 +++++++
 arch/arm64/boot/dts/freescale/imx8mq.dtsi | 7 +++++++
 arch/arm64/configs/defconfig              | 1 +
 drivers/perf/fsl_imx8_ddr_perf.c          | 1 +
 4 files changed, 16 insertions(+)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/3 perf/imx_ddr: Add MODULE_DEVICE_TABLE

This is required for automatic probing when driver is built as a module.

Fixes 9a66d36cc7ac ("drivers/perf: imx_ddr: Add DDR performance counter support to perf")
---
 drivers/perf/fsl_imx8_ddr_perf.c | 1 +
 1 file changed, 1 insertion(+)
drivers/perf/fsl_imx8_ddr_perf.c +1 -0
index 63fe21600072..0e3310dbb145 100644
@@ -45,10 +45,11 @@ static DEFINE_IDA(ddr_ida);
 static const struct of_device_id imx_ddr_pmu_dt_ids[] = {
 	{ .compatible = "fsl,imx8-ddr-pmu",},
 	{ .compatible = "fsl,imx8m-ddr-pmu",},
 	{ /* sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, imx_ddr_pmu_dt_ids);
 
 struct ddr_pmu {
 	struct pmu pmu;
 	void __iomem *base;
 	unsigned int cpu;
Signature · 1 line
2.17.1
maintainer Acked-by on v1 1/3
#2 lore raw

RE: [PATCH 1/3] perf/imx_ddr: Add MODULE_DEVICE_TABLE

Quoted 15 lines

-----Original Message-----
From: Leonard Crestez <[email protected]>
Sent: Thursday, July 4, 2019 3:53 AM
To: Shawn Guo <[email protected]>; Will Deacon <[email protected]>; Frank Li <[email protected]>
Cc: Rob Herring <[email protected]>; Andrey Smirnov <[email protected]>; Mark Rutland <[email protected]>; Aisheng Dong <[email protected]>; Fabio Estevam <[email protected]>; Jacky Bai <[email protected]>; [email protected]; [email protected]; dl-linux-imx <linux- [email protected]>; [email protected]
Subject: [PATCH 1/3] perf/imx_ddr: Add MODULE_DEVICE_TABLE

Quoted 5 lines

This is required for automatic probing when driver is built as a module.

Fixes 9a66d36cc7ac ("drivers/perf: imx_ddr: Add DDR performance counter

support to perf")

Quoted 22 lines
---
 drivers/perf/fsl_imx8_ddr_perf.c | 1 +
 1 file changed, 1 insertion(+)
drivers/perf/fsl_imx8_ddr_perf.c +1 -1
index 63fe21600072..0e3310dbb145 100644
@@ -45,10 +45,11 @@ static DEFINE_IDA(ddr_ida);  static const struct
 of_device_id imx_ddr_pmu_dt_ids[] = {
 	{ .compatible = "fsl,imx8-ddr-pmu",},
 	{ .compatible = "fsl,imx8m-ddr-pmu",},
 	{ /* sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, imx_ddr_pmu_dt_ids);
 
 struct ddr_pmu {
 	struct pmu pmu;
 	void __iomem *base;
 	unsigned int cpu;
--

2.17.1

#3 lore raw

PATCH 2/3 arm64: dts: imx8m: Add ddr-pmu nodes

In reply to Leonard Crestez

The same ddr perfomance counter IP from 8qxp is also available on imx8m series so add it to dts.

Tested with perf stat and memtester on imx8mm-evk and obtained plausible results.

---
 arch/arm64/boot/dts/freescale/imx8mm.dtsi | 7 +++++++
 arch/arm64/boot/dts/freescale/imx8mq.dtsi | 7 +++++++
 2 files changed, 14 insertions(+)
arch/arm64/boot/dts/freescale/imx8mm.dtsi +7 -0
index 232a7412755a..9a8d8cd21ef0 100644
@@ -816,7 +816,14 @@
 			      <0x38880000 0xc0000>; /* GICR (RD_base + SGI_base) */
 			#interrupt-cells = <3>;
 			interrupt-controller;
 			interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
 		};
+
+		ddr-pmu@3d800000 {
+			compatible = "fsl,imx8mm-ddr-pmu", "fsl,imx8m-ddr-pmu";
+			reg = <0x3d800000 0x400000>;
+			interrupt-parent = <&gic>;
+			interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;
+		};
 	};
 };
arch/arm64/boot/dts/freescale/imx8mq.dtsi +7 -0
index d09b808eff87..fb0fdee5f889 100644
@@ -1031,7 +1031,14 @@
 			#interrupt-cells = <3>;
 			interrupt-controller;
 			interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
 			interrupt-parent = <&gic>;
 		};
+
+		ddr-pmu@3d800000 {
+			compatible = "fsl,imx8mq-ddr-pmu", "fsl,imx8m-ddr-pmu";
+			reg = <0x3d800000 0x400000>;
+			interrupt-parent = <&gic>;
+			interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;
+		};
 	};
 };
Signature · 1 line
2.17.1
maintainer Acked-by on v1 2/3
#4 lore raw

RE: [PATCH 2/3] arm64: dts: imx8m: Add ddr-pmu nodes

Quoted 15 lines

-----Original Message-----
From: Leonard Crestez <[email protected]>
Sent: Thursday, July 4, 2019 3:53 AM
To: Shawn Guo <[email protected]>; Will Deacon <[email protected]>; Frank Li <[email protected]>
Cc: Rob Herring <[email protected]>; Andrey Smirnov <[email protected]>; Mark Rutland <[email protected]>; Aisheng Dong <[email protected]>; Fabio Estevam <[email protected]>; Jacky Bai <[email protected]>; [email protected]; [email protected]; dl-linux-imx <linux- [email protected]>; [email protected]
Subject: [PATCH 2/3] arm64: dts: imx8m: Add ddr-pmu nodes

Quoted 7 lines

The same ddr perfomance counter IP from 8qxp is also available on imx8m series so add it to dts.

Tested with perf stat and memtester on imx8mm-evk and obtained plausible results.

Quoted 50 lines
---
 arch/arm64/boot/dts/freescale/imx8mm.dtsi | 7 +++++++
arch/arm64/boot/dts/freescale/imx8mq.dtsi | 7 +++++++
 2 files changed, 14 insertions(+)
arch/arm64/boot/dts/freescale/imx8mm.dtsi +0 -0
index 232a7412755a..9a8d8cd21ef0 100644
@@ -816,7 +816,14 @@
 			      <0x38880000 0xc0000>; /* GICR (RD_base +

SGI_base) */

arch/arm64/boot/dts/freescale/imx8mm.dtsi +3 -0
 			#interrupt-cells = <3>;
 			interrupt-controller;
 			interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
 		};
+
+		ddr-pmu@3d800000 {
+			compatible = "fsl,imx8mm-ddr-pmu", "fsl,imx8m-ddr-

pmu";

arch/arm64/boot/dts/freescale/imx8mm.dtsi +4 -0
+			reg = <0x3d800000 0x400000>;
+			interrupt-parent = <&gic>;
+			interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;
+		};
 	};
 };
arch/arm64/boot/dts/freescale/imx8mq.dtsi +7 -0
index d09b808eff87..fb0fdee5f889 100644
@@ -1031,7 +1031,14 @@
 			#interrupt-cells = <3>;
 			interrupt-controller;
 			interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
 			interrupt-parent = <&gic>;
 		};
+
+		ddr-pmu@3d800000 {
+			compatible = "fsl,imx8mq-ddr-pmu", "fsl,imx8m-ddr-
 pmu";
+			reg = <0x3d800000 0x400000>;
+			interrupt-parent = <&gic>;
+			interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;
+		};
 	};

};
--
2.17.1

Applied
#5 lore raw

Re: [PATCH 2/3] arm64: dts: imx8m: Add ddr-pmu nodes

In reply to Leonard Crestez
Quoted 7 lines · Leonard Crestez

The same ddr perfomance counter IP from 8qxp is also available on imx8m series so add it to dts.

Tested with perf stat and memtester on imx8mm-evk and obtained plausible results.

Applied, thanks.

#6 lore raw

PATCH 3/3 arm64: defconfig: Build imx8 ddr pmu as module

In reply to Leonard Crestez

This is available on all imx8 but is not "boot critical" in any way so build as a module.

---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index 812fe887477d..134a4067846f 100644
@@ -766,10 +766,11 @@ CONFIG_PHY_ROCKCHIP_INNO_USB2=y
 CONFIG_PHY_ROCKCHIP_PCIE=m
 CONFIG_PHY_ROCKCHIP_TYPEC=y
 CONFIG_PHY_UNIPHIER_USB2=y
 CONFIG_PHY_UNIPHIER_USB3=y
 CONFIG_PHY_TEGRA_XUSB=y
+CONFIG_FSL_IMX8_DDR_PMU=m
 CONFIG_HISI_PMU=y
 CONFIG_QCOM_L2_PMU=y
 CONFIG_QCOM_L3_PMU=y
 CONFIG_NVMEM_SUNXI_SID=y
 CONFIG_NVMEM_IMX_OCOTP=y
Signature · 1 line
2.17.1
maintainer Acked-by on v1 3/3
#7 lore raw

RE: [PATCH 3/3] arm64: defconfig: Build imx8 ddr pmu as module

Quoted 15 lines

-----Original Message-----
From: Leonard Crestez <[email protected]>
Sent: Thursday, July 4, 2019 3:53 AM
To: Shawn Guo <[email protected]>; Will Deacon <[email protected]>; Frank Li <[email protected]>
Cc: Rob Herring <[email protected]>; Andrey Smirnov <[email protected]>; Mark Rutland <[email protected]>; Aisheng Dong <[email protected]>; Fabio Estevam <[email protected]>; Jacky Bai <[email protected]>; [email protected]; [email protected]; dl-linux-imx <linux- [email protected]>; [email protected]
Subject: [PATCH 3/3] arm64: defconfig: Build imx8 ddr pmu as module

Quoted 4 lines

This is available on all imx8 but is not "boot critical" in any way so build as a module.

Quoted 20 lines
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +0 -0
index 812fe887477d..134a4067846f 100644
@@ -766,10 +766,11 @@ CONFIG_PHY_ROCKCHIP_INNO_USB2=y

CONFIG_PHY_ROCKCHIP_PCIE=m CONFIG_PHY_ROCKCHIP_TYPEC=y CONFIG_PHY_UNIPHIER_USB2=y CONFIG_PHY_UNIPHIER_USB3=y CONFIG_PHY_TEGRA_XUSB=y +CONFIG_FSL_IMX8_DDR_PMU=m
CONFIG_HISI_PMU=y
CONFIG_QCOM_L2_PMU=y
CONFIG_QCOM_L3_PMU=y
CONFIG_NVMEM_SUNXI_SID=y CONFIG_NVMEM_IMX_OCOTP=y
--
2.17.1