Skip to content

Commit

Permalink
perf/amlogic: Add support for Amlogic meson G12 SoC DDR PMU driver
Browse files Browse the repository at this point in the history
This patch adds support Amlogic meson G12 series SoC
DDR bandwidth PMU driver framework and interfaces.

The PMU not only can monitor the total DDR bandwidth,
but also the bandwidth which is from individual IP module.

Example usage:

 $ perf stat -a -e aml_ddr_bw/total_rw_bytes/ -I 1000 sleep 10

- or -

 $ perf stat -a -e \
   aml_ddr_bw/total_rw_bytes/,\
   aml_ddr_bw/chan_1_rw_bytes,arm=1/ -I 1000 \
   sleep 10

g12 SoC support 4 channels to monitor DDR bandwidth
simultaneously. Each channel can monitor up to 4 IP modules
simultaneously.

For Instance, If you want to get the sum of DDR bandwidth
from CPU, GPU, USB3.0 and VDEC. You can use the following
command parameters to display.

 $ perf stat -a -e \
   aml_ddr_bw/chan_2_rw_bytes,arm=1,gpu=1,usb3_0=1,nna=1/ -I 1000 \
   sleep 10

Other events are supported, and advertised via perf list.

Signed-off-by: Jiucheng Xu <jiucheng.xu@amlogic.com>
  • Loading branch information
Jiucheng Xu authored and intel-lab-lkp committed Jul 26, 2022
1 parent 91118fa commit be12368
Show file tree
Hide file tree
Showing 8 changed files with 1,040 additions and 0 deletions.
7 changes: 7 additions & 0 deletions MAINTAINERS
Expand Up @@ -1050,6 +1050,13 @@ S: Maintained
F: Documentation/hid/amd-sfh*
F: drivers/hid/amd-sfh-hid/

AMLOGIC DDR PMU DRIVER
M: Jiucheng Xu <jiucheng.xu@amlogic.com>
S: Supported
W: http://www.amlogic.com
F: drivers/perf/amlogic/
F: include/soc/amlogic/

AMPHION VPU CODEC V4L2 DRIVER
M: Ming Qian <ming.qian@nxp.com>
M: Shijie Qin <shijie.qin@nxp.com>
Expand Down
2 changes: 2 additions & 0 deletions drivers/perf/Kconfig
Expand Up @@ -192,4 +192,6 @@ config MARVELL_CN10K_DDR_PMU
Enable perf support for Marvell DDR Performance monitoring
event on CN10K platform.

source "drivers/perf/amlogic/Kconfig"

endmenu
1 change: 1 addition & 0 deletions drivers/perf/Makefile
@@ -1,4 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_AML_DDR_PMU) += amlogic/
obj-$(CONFIG_ARM_CCI_PMU) += arm-cci.o
obj-$(CONFIG_ARM_CCN) += arm-ccn.o
obj-$(CONFIG_ARM_CMN) += arm-cmn.o
Expand Down
10 changes: 10 additions & 0 deletions drivers/perf/amlogic/Kconfig
@@ -0,0 +1,10 @@
# SPDX-License-Identifier: GPL-2.0-only
config AML_DDR_PMU
tristate "Amlogic DDR Bandwidth Performance Monitor"
depends on ARCH_MESON || COMPILE_TEST
help
Provides support for the DDR performance monitor
in Amlogic SoCs, which can give information about
memory throughput and other related events. It
supports multiple channels to monitor the memory
bandwidth simultaneously.
5 changes: 5 additions & 0 deletions drivers/perf/amlogic/Makefile
@@ -0,0 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only

obj-$(CONFIG_AML_DDR_PMU) += aml_ddr_pmu.o

aml_ddr_pmu-y := aml_ddr_pmu_core.o aml_ddr_pmu_g12.o

0 comments on commit be12368

Please sign in to comment.