]> git.baikalelectronics.ru Git - uboot.git/commitdiff
ddr: imx9: enable Performance monitor counter
authorYe Li <ye.li@nxp.com>
Tue, 26 Jul 2022 08:41:08 +0000 (16:41 +0800)
committerStefano Babic <sbabic@denx.de>
Tue, 26 Jul 2022 09:29:01 +0000 (11:29 +0200)
Add Kconfig for enabling reference events counter in DDRC performance
monitor by default

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/ddr/imx/imx9/Kconfig
drivers/ddr/imx/imx9/ddr_init.c

index a16ddc65e01e6dbcf11ab6a6a6855bc6e2df7e42..123ad173cfc31ad78e43daa7cb33d40a3a555ed0 100644 (file)
@@ -11,6 +11,12 @@ config IMX9_LPDDR4X
        help
          Select the i.MX9 LPDDR4/4X driver support on i.MX9 SOC.
 
+config IMX9_DRAM_PM_COUNTER
+       bool "imx9 DDRC performance monitor counter"
+       default y
+       help
+         Enable DDR controller performance monitor counter for reference events.
+
 config SAVED_DRAM_TIMING_BASE
        hex "Define the base address for saved dram timing"
        help
index 16eac65105fa1cb95e5feef5be560de265b58093..8b8ec7f8de3f6dd3ec1a102868ef71f80f9deee2 100644 (file)
@@ -112,6 +112,10 @@ int ddr_init(struct dram_timing_info *dram_timing)
        ddrc_config(dram_timing->ddrc_cfg, dram_timing->ddrc_cfg_num);
        debug("DDRINFO: ddrc config done\n");
 
+#ifdef CONFIG_IMX9_DRAM_PM_COUNTER
+       writel(0x200000, REG_DDR_DEBUG_19);
+#endif
+
        check_dfi_init_complete();
 
        regval = readl(REG_DDR_SDRAM_CFG);