Skip to content

Commit b5ef94f

Browse files
committed
Merge branch 'for-next/perf' into for-next/core
* for-next/perf: (25 commits) perf/marvell: Fix !CONFIG_OF build for CN10K DDR PMU driver drivers/perf: Add Apple icestorm/firestorm CPU PMU driver drivers/perf: arm_pmu: Handle 47 bit counters arm64: perf: Consistently make all event numbers as 16-bits arm64: perf: Expose some Armv9 common events under sysfs perf/marvell: cn10k DDR perf event core ownership perf/marvell: cn10k DDR perfmon event overflow handling perf/marvell: CN10k DDR performance monitor support dt-bindings: perf: marvell: cn10k ddr performance monitor perf/arm-cmn: Update watchpoint format perf/arm-cmn: Hide XP PUB events for CMN-600 perf: replace bitmap_weight with bitmap_empty where appropriate perf: Replace acpi_bus_get_device() perf/marvell_cn10k: Fix unused variable warning when W=1 and CONFIG_OF=n perf/arm-cmn: Make arm_cmn_debugfs static perf: MARVELL_CN10K_TAD_PMU should depend on ARCH_THUNDER perf/arm-ccn: Use platform_get_irq() to get the interrupt irqchip/apple-aic: Move PMU-specific registers to their own include file arm64: dts: apple: Add t8303 PMU nodes arm64: dts: apple: Add t8103 PMU interrupt affinities ...
2 parents 292ca2d + 6676a42 commit b5ef94f

23 files changed

Lines changed: 1800 additions & 198 deletions

File tree

Documentation/devicetree/bindings/arm/pmu.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ properties:
2020
items:
2121
- enum:
2222
- apm,potenza-pmu
23+
- apple,firestorm-pmu
24+
- apple,icestorm-pmu
2325
- arm,armv8-pmuv3 # Only for s/w models
2426
- arm,arm1136-pmu
2527
- arm,arm1176-pmu

Documentation/devicetree/bindings/interrupt-controller/apple,aic.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ properties:
5656
- 1: virtual HV timer
5757
- 2: physical guest timer
5858
- 3: virtual guest timer
59+
- 4: 'efficient' CPU PMU
60+
- 5: 'performance' CPU PMU
5961
6062
The 3rd cell contains the interrupt flags. This is normally
6163
IRQ_TYPE_LEVEL_HIGH (4).
@@ -68,6 +70,35 @@ properties:
6870
power-domains:
6971
maxItems: 1
7072

73+
affinities:
74+
type: object
75+
additionalProperties: false
76+
description:
77+
FIQ affinity can be expressed as a single "affinities" node,
78+
containing a set of sub-nodes, one per FIQ with a non-default
79+
affinity.
80+
patternProperties:
81+
"^.+-affinity$":
82+
type: object
83+
additionalProperties: false
84+
properties:
85+
apple,fiq-index:
86+
description:
87+
The interrupt number specified as a FIQ, and for which
88+
the affinity is not the default.
89+
$ref: /schemas/types.yaml#/definitions/uint32
90+
maximum: 5
91+
92+
cpus:
93+
$ref: /schemas/types.yaml#/definitions/phandle-array
94+
description:
95+
Should be a list of phandles to CPU nodes (as described in
96+
Documentation/devicetree/bindings/arm/cpus.yaml).
97+
98+
required:
99+
- fiq-index
100+
- cpus
101+
71102
required:
72103
- compatible
73104
- '#interrupt-cells'
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/perf/marvell-cn10k-ddr.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Marvell CN10K DDR performance monitor
8+
9+
maintainers:
10+
- Bharat Bhushan <bbhushan2@marvell.com>
11+
12+
properties:
13+
compatible:
14+
items:
15+
- enum:
16+
- marvell,cn10k-ddr-pmu
17+
18+
reg:
19+
maxItems: 1
20+
21+
required:
22+
- compatible
23+
- reg
24+
25+
additionalProperties: false
26+
27+
examples:
28+
- |
29+
bus {
30+
#address-cells = <2>;
31+
#size-cells = <2>;
32+
33+
pmu@87e1c0000000 {
34+
compatible = "marvell,cn10k-ddr-pmu";
35+
reg = <0x87e1 0xc0000000 0x0 0x10000>;
36+
};
37+
};

arch/arm64/boot/dts/apple/t8103.dtsi

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,18 @@
9797
<AIC_FIQ AIC_TMR_HV_VIRT IRQ_TYPE_LEVEL_HIGH>;
9898
};
9999

100+
pmu-e {
101+
compatible = "apple,icestorm-pmu";
102+
interrupt-parent = <&aic>;
103+
interrupts = <AIC_FIQ AIC_CPU_PMU_E IRQ_TYPE_LEVEL_HIGH>;
104+
};
105+
106+
pmu-p {
107+
compatible = "apple,firestorm-pmu";
108+
interrupt-parent = <&aic>;
109+
interrupts = <AIC_FIQ AIC_CPU_PMU_P IRQ_TYPE_LEVEL_HIGH>;
110+
};
111+
100112
clkref: clock-ref {
101113
compatible = "fixed-clock";
102114
#clock-cells = <0>;
@@ -213,6 +225,18 @@
213225
interrupt-controller;
214226
reg = <0x2 0x3b100000 0x0 0x8000>;
215227
power-domains = <&ps_aic>;
228+
229+
affinities {
230+
e-core-pmu-affinity {
231+
apple,fiq-index = <AIC_CPU_PMU_E>;
232+
cpus = <&cpu0 &cpu1 &cpu2 &cpu3>;
233+
};
234+
235+
p-core-pmu-affinity {
236+
apple,fiq-index = <AIC_CPU_PMU_P>;
237+
cpus = <&cpu4 &cpu5 &cpu6 &cpu7>;
238+
};
239+
};
216240
};
217241

218242
pmgr: power-management@23b700000 {
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
#ifndef __ASM_APPLE_M1_PMU_h
4+
#define __ASM_APPLE_M1_PMU_h
5+
6+
#include <linux/bits.h>
7+
#include <asm/sysreg.h>
8+
9+
/* Counters */
10+
#define SYS_IMP_APL_PMC0_EL1 sys_reg(3, 2, 15, 0, 0)
11+
#define SYS_IMP_APL_PMC1_EL1 sys_reg(3, 2, 15, 1, 0)
12+
#define SYS_IMP_APL_PMC2_EL1 sys_reg(3, 2, 15, 2, 0)
13+
#define SYS_IMP_APL_PMC3_EL1 sys_reg(3, 2, 15, 3, 0)
14+
#define SYS_IMP_APL_PMC4_EL1 sys_reg(3, 2, 15, 4, 0)
15+
#define SYS_IMP_APL_PMC5_EL1 sys_reg(3, 2, 15, 5, 0)
16+
#define SYS_IMP_APL_PMC6_EL1 sys_reg(3, 2, 15, 6, 0)
17+
#define SYS_IMP_APL_PMC7_EL1 sys_reg(3, 2, 15, 7, 0)
18+
#define SYS_IMP_APL_PMC8_EL1 sys_reg(3, 2, 15, 9, 0)
19+
#define SYS_IMP_APL_PMC9_EL1 sys_reg(3, 2, 15, 10, 0)
20+
21+
/* Core PMC control register */
22+
#define SYS_IMP_APL_PMCR0_EL1 sys_reg(3, 1, 15, 0, 0)
23+
#define PMCR0_CNT_ENABLE_0_7 GENMASK(7, 0)
24+
#define PMCR0_IMODE GENMASK(10, 8)
25+
#define PMCR0_IMODE_OFF 0
26+
#define PMCR0_IMODE_PMI 1
27+
#define PMCR0_IMODE_AIC 2
28+
#define PMCR0_IMODE_HALT 3
29+
#define PMCR0_IMODE_FIQ 4
30+
#define PMCR0_IACT BIT(11)
31+
#define PMCR0_PMI_ENABLE_0_7 GENMASK(19, 12)
32+
#define PMCR0_STOP_CNT_ON_PMI BIT(20)
33+
#define PMCR0_CNT_GLOB_L2C_EVT BIT(21)
34+
#define PMCR0_DEFER_PMI_TO_ERET BIT(22)
35+
#define PMCR0_ALLOW_CNT_EN_EL0 BIT(30)
36+
#define PMCR0_CNT_ENABLE_8_9 GENMASK(33, 32)
37+
#define PMCR0_PMI_ENABLE_8_9 GENMASK(45, 44)
38+
39+
#define SYS_IMP_APL_PMCR1_EL1 sys_reg(3, 1, 15, 1, 0)
40+
#define PMCR1_COUNT_A64_EL0_0_7 GENMASK(15, 8)
41+
#define PMCR1_COUNT_A64_EL1_0_7 GENMASK(23, 16)
42+
#define PMCR1_COUNT_A64_EL0_8_9 GENMASK(41, 40)
43+
#define PMCR1_COUNT_A64_EL1_8_9 GENMASK(49, 48)
44+
45+
#define SYS_IMP_APL_PMCR2_EL1 sys_reg(3, 1, 15, 2, 0)
46+
#define SYS_IMP_APL_PMCR3_EL1 sys_reg(3, 1, 15, 3, 0)
47+
#define SYS_IMP_APL_PMCR4_EL1 sys_reg(3, 1, 15, 4, 0)
48+
49+
#define SYS_IMP_APL_PMESR0_EL1 sys_reg(3, 1, 15, 5, 0)
50+
#define PMESR0_EVT_CNT_2 GENMASK(7, 0)
51+
#define PMESR0_EVT_CNT_3 GENMASK(15, 8)
52+
#define PMESR0_EVT_CNT_4 GENMASK(23, 16)
53+
#define PMESR0_EVT_CNT_5 GENMASK(31, 24)
54+
55+
#define SYS_IMP_APL_PMESR1_EL1 sys_reg(3, 1, 15, 6, 0)
56+
#define PMESR1_EVT_CNT_6 GENMASK(7, 0)
57+
#define PMESR1_EVT_CNT_7 GENMASK(15, 8)
58+
#define PMESR1_EVT_CNT_8 GENMASK(23, 16)
59+
#define PMESR1_EVT_CNT_9 GENMASK(31, 24)
60+
61+
#define SYS_IMP_APL_PMSR_EL1 sys_reg(3, 1, 15, 13, 0)
62+
#define PMSR_OVERFLOW GENMASK(9, 0)
63+
64+
#endif /* __ASM_APPLE_M1_PMU_h */

0 commit comments

Comments
 (0)