Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: perf: add support for Cortex-A72

Cortex-A72 has a PMUv3 implementation that is compatible with the PMU
implemented by Cortex-A57.

This patch hooks up the new compatible string so that the Cortex-A57
event mappings are used.

Signed-off-by: Will Deacon <will.deacon@arm.com>

+13 -1
+1
Documentation/devicetree/bindings/arm/pmu.txt
··· 9 9 - compatible : should be one of 10 10 "apm,potenza-pmu" 11 11 "arm,armv8-pmuv3" 12 + "arm,cortex-a72-pmu" 12 13 "arm,cortex-a57-pmu" 13 14 "arm,cortex-a53-pmu" 14 15 "arm,cortex-a17-pmu"
+12 -1
arch/arm64/kernel/perf_event.c
··· 90 90 /* ARMv8 Cortex-A53 specific event types. */ 91 91 #define ARMV8_A53_PERFCTR_PREFETCH_LINEFILL 0xC2 92 92 93 - /* ARMv8 Cortex-A57 specific event types. */ 93 + /* ARMv8 Cortex-A57 and Cortex-A72 specific event types. */ 94 94 #define ARMV8_A57_PERFCTR_L1_DCACHE_ACCESS_LD 0x40 95 95 #define ARMV8_A57_PERFCTR_L1_DCACHE_ACCESS_ST 0x41 96 96 #define ARMV8_A57_PERFCTR_L1_DCACHE_REFILL_LD 0x42 ··· 120 120 [PERF_COUNT_HW_BUS_CYCLES] = ARMV8_PMUV3_PERFCTR_BUS_CYCLES, 121 121 }; 122 122 123 + /* ARM Cortex-A57 and Cortex-A72 events mapping. */ 123 124 static const unsigned armv8_a57_perf_map[PERF_COUNT_HW_MAX] = { 124 125 PERF_MAP_ALL_UNSUPPORTED, 125 126 [PERF_COUNT_HW_CPU_CYCLES] = ARMV8_PMUV3_PERFCTR_CLOCK_CYCLES, ··· 802 801 return armv8pmu_probe_num_events(cpu_pmu); 803 802 } 804 803 804 + static int armv8_a72_pmu_init(struct arm_pmu *cpu_pmu) 805 + { 806 + armv8_pmu_init(cpu_pmu); 807 + cpu_pmu->name = "armv8_cortex_a72"; 808 + cpu_pmu->map_event = armv8_a57_map_event; 809 + cpu_pmu->pmu.attr_groups = armv8_pmuv3_attr_groups; 810 + return armv8pmu_probe_num_events(cpu_pmu); 811 + } 812 + 805 813 static const struct of_device_id armv8_pmu_of_device_ids[] = { 806 814 {.compatible = "arm,armv8-pmuv3", .data = armv8_pmuv3_init}, 807 815 {.compatible = "arm,cortex-a53-pmu", .data = armv8_a53_pmu_init}, 808 816 {.compatible = "arm,cortex-a57-pmu", .data = armv8_a57_pmu_init}, 817 + {.compatible = "arm,cortex-a72-pmu", .data = armv8_a72_pmu_init}, 809 818 {}, 810 819 }; 811 820