Skip to content

Commit af9597a

Browse files
axiqiawilldeacon
authored andcommitted
drivers/perf: add DesignWare PCIe PMU driver
This commit adds the PCIe Performance Monitoring Unit (PMU) driver support for T-Head Yitian SoC chip. Yitian is based on the Synopsys PCI Express Core controller IP which provides statistics feature. The PMU is a PCIe configuration space register block provided by each PCIe Root Port in a Vendor-Specific Extended Capability named RAS D.E.S (Debug, Error injection, and Statistics). To facilitate collection of statistics the controller provides the following two features for each Root Port: - one 64-bit counter for Time Based Analysis (RX/TX data throughput and time spent in each low-power LTSSM state) and - one 32-bit counter for Event Counting (error and non-error events for a specified lane) Note: There is no interrupt for counter overflow. This driver adds PMU devices for each PCIe Root Port. And the PMU device is named based the BDF of Root Port. For example, 30:03.0 PCI bridge: Device 1ded:8000 (rev 01) the PMU device name for this Root Port is dwc_rootport_3018. Example usage of counting PCIe RX TLP data payload (Units of bytes):: $# perf stat -a -e dwc_rootport_3018/Rx_PCIe_TLP_Data_Payload/ average RX bandwidth can be calculated like this: PCIe TX Bandwidth = Rx_PCIe_TLP_Data_Payload / Measure_Time_Window Signed-off-by: Shuai Xue <[email protected]> Reviewed-by: Baolin Wang <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Yicong Yang <[email protected]> Reviewed-and-tested-by: Ilkka Koskinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] [will: Fix sparse error due to use of uninitialised 'vsec' symbol in dwc_pcie_match_des_cap()] Signed-off-by: Will Deacon <[email protected]>
1 parent ac16087 commit af9597a

File tree

3 files changed

+800
-0
lines changed

3 files changed

+800
-0
lines changed

drivers/perf/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ config MARVELL_CN10K_DDR_PMU
217217
Enable perf support for Marvell DDR Performance monitoring
218218
event on CN10K platform.
219219

220+
config DWC_PCIE_PMU
221+
tristate "Synopsys DesignWare PCIe PMU"
222+
depends on PCI
223+
help
224+
Enable perf support for Synopsys DesignWare PCIe PMU Performance
225+
monitoring event on platform including the Alibaba Yitian 710.
226+
220227
source "drivers/perf/arm_cspmu/Kconfig"
221228

222229
source "drivers/perf/amlogic/Kconfig"

drivers/perf/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ obj-$(CONFIG_MARVELL_CN10K_TAD_PMU) += marvell_cn10k_tad_pmu.o
2323
obj-$(CONFIG_MARVELL_CN10K_DDR_PMU) += marvell_cn10k_ddr_pmu.o
2424
obj-$(CONFIG_APPLE_M1_CPU_PMU) += apple_m1_cpu_pmu.o
2525
obj-$(CONFIG_ALIBABA_UNCORE_DRW_PMU) += alibaba_uncore_drw_pmu.o
26+
obj-$(CONFIG_DWC_PCIE_PMU) += dwc_pcie_pmu.o
2627
obj-$(CONFIG_ARM_CORESIGHT_PMU_ARCH_SYSTEM_PMU) += arm_cspmu/
2728
obj-$(CONFIG_MESON_DDR_PMU) += amlogic/
2829
obj-$(CONFIG_CXL_PMU) += cxl_pmu.o

0 commit comments

Comments
 (0)