Skip to contentSkip to conversation

perf: ti_k3_ddr: Add TI K3 DDR performance monitor driver

RFC PATCH NAK MANNURU VENKATESWARLU 1 participant 2 messages Jul 14

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

RFC PATCH 7/22 perf: ti_k3_ddr: Add TI K3 DDR performance monitor driver

From: Aarya Chaumal <[email protected]>

Add a PMU driver for the DDR subsystem performance counters on TI K3 SoCs (J721E, J721S2, J7200, J784S4, AM62, AM62A, AM62P, AM64).

The Cadence DDR controller provides 4 hardware counters, each programmable to count one of 36 events: read/write commands, activates, refreshes, precharges, power-down/self-refresh cycles, bus turnarounds, address collisions, and FIFO utilization cycles.

Each DDR controller registers as a separate PMU named k3_ddr<N> and exposes an identifier sysfs attribute that jevents uses to select the correct JSON event table for the SoC.

---
 drivers/perf/Kconfig          |  11 +
 drivers/perf/Makefile         |   1 +
 drivers/perf/ti_k3_ddr_perf.c | 532 ++++++++++++++++++++++++++++++++++
 3 files changed, 544 insertions(+)
 create mode 100644 drivers/perf/ti_k3_ddr_perf.c
drivers/perf/Kconfig +11 -0
index 245e7bb763b99..821fc6f81bef0 100644
@@ -273,6 +273,17 @@ config ALIBABA_UNCORE_DRW_PMU
 
 source "drivers/perf/hisilicon/Kconfig"
 
+config TI_K3_DDR_PMU
+	tristate "Texas Instruments K3 DDR perf monitor"
+	depends on MFD_TI_DDRSS
+	help
+	  Say Y here to enable the DDR performance monitor on TI K3 SoCs.
+	  Exposes DDR read/write and other memory throughput events via perf.
+	  Supports J721E, J721S2, J7200, J784S4, AM62, AM62A, AM62P, AM64.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called ti_k3_ddr_perf.
+
 config MARVELL_CN10K_DDR_PMU
 	tristate "Enable MARVELL CN10K DRAM Subsystem(DSS) PMU Support"
 	depends on ARCH_THUNDER || (COMPILE_TEST && 64BIT)
drivers/perf/Makefile +1 -0
index eb8a022dad9a7..c11c0013cbfd9 100644
@@ -29,6 +29,7 @@ obj-$(CONFIG_ARM_DMC620_PMU) += arm_dmc620_pmu.o
 obj-$(CONFIG_MARVELL_CN10K_TAD_PMU) += marvell_cn10k_tad_pmu.o
 obj-$(CONFIG_MARVELL_CN10K_DDR_PMU) += marvell_cn10k_ddr_pmu.o
 obj-$(CONFIG_MARVELL_PEM_PMU) += marvell_pem_pmu.o
+obj-$(CONFIG_TI_K3_DDR_PMU) += ti_k3_ddr_perf.o
 obj-$(CONFIG_APPLE_M1_CPU_PMU) += apple_m1_cpu_pmu.o
 obj-$(CONFIG_ALIBABA_UNCORE_DRW_PMU) += alibaba_uncore_drw_pmu.o
 obj-$(CONFIG_DWC_PCIE_PMU) += dwc_pcie_pmu.o
drivers/perf/ti_k3_ddr_perf.c new file +532 -0

532 lines not on this page · raw message

Signature · 1 line
2.34.1
#1 lore raw

RFC PATCH 8/22 docs: perf: Add TI K3 DDR PMU documentation

From: Aarya Chaumal <[email protected]>

Add documentation for the TI K3 DDR PMU driver describing the counter layout, supported events and perf tool usage examples.

---
 Documentation/admin-guide/perf/index.rst  |  1 +
 Documentation/admin-guide/perf/k3-ddr.rst | 57 +++++++++++++++++++++++
 2 files changed, 58 insertions(+)
 create mode 100644 Documentation/admin-guide/perf/k3-ddr.rst
Documentation/admin-guide/perf/index.rst +1 -0
index aa12708ddb965..752384d2d050f 100644
@@ -31,3 +31,4 @@ Performance monitor support
    ampere_cspmu
    mrvl-pem-pmu
    fujitsu_uncore_pmu
+   k3-ddr
Documentation/admin-guide/perf/k3-ddr.rst new file +57 -0

57 lines not on this page · raw message

Signature · 1 line
2.34.1