Enable imx ddr perfmon on imx8m
Subsystems (4)
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
PATCH 1/3 perf/imx_ddr: Add MODULE_DEVICE_TABLE
This is required for automatic probing when driver is built as a module.
--- drivers/perf/fsl_imx8_ddr_perf.c | 1 + 1 file changed, 1 insertion(+)
drivers/perf/fsl_imx8_ddr_perf.c +1 -0
@@ -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
PATCH 2/3 arm64: dts: imx8m: Add ddr-pmu nodes
In reply to Leonard CrestezThe 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
@@ -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
@@ -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
PATCH 3/3 arm64: defconfig: Build imx8 ddr pmu as module
In reply to Leonard CrestezThis 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
@@ -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
RE: [PATCH 1/3] perf/imx_ddr: Add MODULE_DEVICE_TABLE
In reply to Leonard CrestezQuoted 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: AddMODULE_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 countersupport to perf")
Signed-off-by Leonard Crestez <[email protected]>
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@@ -45,10 +45,11 @@ static DEFINE_IDA(ddr_ida); static const structof_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
RE: [PATCH 2/3] arm64: dts: imx8m: Add ddr-pmu nodes
In reply to Leonard CrestezQuoted 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 statandmemtesteron imx8mm-evk and obtained plausible results.Signed-off-by Leonard Crestez <[email protected]>
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@@ -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@@ -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
RE: [PATCH 3/3] arm64: defconfig: Build imx8 ddr pmu as module
In reply to Leonard CrestezQuoted 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.
Signed-off-by Leonard Crestez <[email protected]>
Quoted 20 lines
--- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)arch/arm64/configs/defconfig +0
-0@@ -766,10 +766,11 @@ CONFIG_PHY_ROCKCHIP_INNO_USB2=y
CONFIG_PHY_ROCKCHIP_PCIE=mCONFIG_PHY_ROCKCHIP_TYPEC=yCONFIG_PHY_UNIPHIER_USB2=yCONFIG_PHY_UNIPHIER_USB3=yCONFIG_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=yCONFIG_NVMEM_IMX_OCOTP=y
--
2.17.1
Shawn Guo
AppliedRe: [PATCH 2/3] arm64: dts: imx8m: Add ddr-pmu nodes
In reply to Leonard CrestezQuoted 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 statandmemtesteron imx8mm-evk and obtained plausible results.Signed-off-by Leonard Crestez <[email protected]>
Applied, thanks.
Shawn Guo
AppliedRe: [PATCH 3/3] arm64: defconfig: Build imx8 ddr pmu as module
In reply to Leonard CrestezQuoted 4 lines · Leonard Crestez
This is available on all imx8 but is not "boot critical" in any way so build as a module.
Signed-off-by Leonard Crestez <[email protected]>
Applied, thanks.