Skip to content

Commit 7d0bfb7

Browse files
jannauwilldeacon
authored andcommitted
drivers/perf: apple_m1: Add Apple M2 support
The PMU itself is compatible with the one found on M1. We still know next to nothing about the counters so keep using CPU uarch specific compatibles/PMU names. Signed-off-by: Janne Grunau <[email protected]> Acked-by: Mark Rutland <[email protected]. Reviewed-by: Hector Martin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 640a3b7 commit 7d0bfb7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/perf/apple_m1_cpu_pmu.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,21 @@ static int m1_pmu_fire_init(struct arm_pmu *cpu_pmu)
559559
return m1_pmu_init(cpu_pmu);
560560
}
561561

562+
static int m2_pmu_avalanche_init(struct arm_pmu *cpu_pmu)
563+
{
564+
cpu_pmu->name = "apple_avalanche_pmu";
565+
return m1_pmu_init(cpu_pmu);
566+
}
567+
568+
static int m2_pmu_blizzard_init(struct arm_pmu *cpu_pmu)
569+
{
570+
cpu_pmu->name = "apple_blizzard_pmu";
571+
return m1_pmu_init(cpu_pmu);
572+
}
573+
562574
static const struct of_device_id m1_pmu_of_device_ids[] = {
575+
{ .compatible = "apple,avalanche-pmu", .data = m2_pmu_avalanche_init, },
576+
{ .compatible = "apple,blizzard-pmu", .data = m2_pmu_blizzard_init, },
563577
{ .compatible = "apple,icestorm-pmu", .data = m1_pmu_ice_init, },
564578
{ .compatible = "apple,firestorm-pmu", .data = m1_pmu_fire_init, },
565579
{ },

0 commit comments

Comments
 (0)