Skip to content

Commit 8d75537

Browse files
robherringwilldeacon
authored andcommitted
perf/arm: Move 32-bit PMU drivers to drivers/perf/
It is preferred to put drivers under drivers/ rather than under arch/. The PMU drivers also depend on arm_pmu.c, so it's better to place them all together. Acked-by: Mark Rutland <[email protected]> Signed-off-by: Rob Herring (Arm) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 598c1a2 commit 8d75537

File tree

6 files changed

+15
-11
lines changed

6 files changed

+15
-11
lines changed

arch/arm/kernel/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o
7878
obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o
7979
obj-$(CONFIG_IWMMXT) += iwmmxt.o
8080
obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o
81-
obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_xscale.o perf_event_v6.o \
82-
perf_event_v7.o
8381
AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt
8482
obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o
8583
obj-$(CONFIG_VDSO) += vdso.o

drivers/perf/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ config ARM_PMU
5656
Say y if you want to use CPU performance monitors on ARM-based
5757
systems.
5858

59+
config ARM_V6_PMU
60+
depends on ARM_PMU && (CPU_V6 || CPU_V6K)
61+
def_bool y
62+
63+
config ARM_V7_PMU
64+
depends on ARM_PMU && CPU_V7
65+
def_bool y
66+
67+
config ARM_XSCALE_PMU
68+
depends on ARM_PMU && CPU_XSCALE
69+
def_bool y
70+
5971
config RISCV_PMU
6072
depends on RISCV
6173
bool "RISC-V PMU framework"

drivers/perf/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ obj-$(CONFIG_ARM_DSU_PMU) += arm_dsu_pmu.o
66
obj-$(CONFIG_ARM_PMU) += arm_pmu.o arm_pmu_platform.o
77
obj-$(CONFIG_ARM_PMU_ACPI) += arm_pmu_acpi.o
88
obj-$(CONFIG_ARM_PMUV3) += arm_pmuv3.o
9+
obj-$(CONFIG_ARM_V6_PMU) += arm_v6_pmu.o
10+
obj-$(CONFIG_ARM_V7_PMU) += arm_v7_pmu.o
11+
obj-$(CONFIG_ARM_XSCALE_PMU) += arm_xscale_pmu.o
912
obj-$(CONFIG_ARM_SMMU_V3_PMU) += arm_smmuv3_pmu.o
1013
obj-$(CONFIG_FSL_IMX8_DDR_PMU) += fsl_imx8_ddr_perf.o
1114
obj-$(CONFIG_FSL_IMX9_DDR_PMU) += fsl_imx9_ddr_perf.o

arch/arm/kernel/perf_event_v6.c renamed to drivers/perf/arm_v6_pmu.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
* enable the interrupt.
3232
*/
3333

34-
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
35-
3634
#include <asm/cputype.h>
3735
#include <asm/irq_regs.h>
3836

@@ -445,4 +443,3 @@ static struct platform_driver armv6_pmu_driver = {
445443
};
446444

447445
builtin_platform_driver(armv6_pmu_driver);
448-
#endif /* CONFIG_CPU_V6 || CONFIG_CPU_V6K */

arch/arm/kernel/perf_event_v7.c renamed to drivers/perf/arm_v7_pmu.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
* counter and all 4 performance counters together can be reset separately.
1818
*/
1919

20-
#ifdef CONFIG_CPU_V7
21-
2220
#include <asm/cp15.h>
2321
#include <asm/cputype.h>
2422
#include <asm/irq_regs.h>
@@ -2002,4 +2000,3 @@ static struct platform_driver armv7_pmu_driver = {
20022000
};
20032001

20042002
builtin_platform_driver(armv7_pmu_driver);
2005-
#endif /* CONFIG_CPU_V7 */

arch/arm/kernel/perf_event_xscale.c renamed to drivers/perf/arm_xscale_pmu.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
* PMU structures.
1414
*/
1515

16-
#ifdef CONFIG_CPU_XSCALE
17-
1816
#include <asm/cputype.h>
1917
#include <asm/irq_regs.h>
2018

@@ -745,4 +743,3 @@ static struct platform_driver xscale_pmu_driver = {
745743
};
746744

747745
builtin_platform_driver(xscale_pmu_driver);
748-
#endif /* CONFIG_CPU_XSCALE */

0 commit comments

Comments
 (0)