diff options
-rw-r--r-- | drivers/bus/arm-cci.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c index da485ae2f595..5a86da97a70b 100644 --- a/drivers/bus/arm-cci.c +++ b/drivers/bus/arm-cci.c | |||
@@ -31,7 +31,6 @@ | |||
31 | 31 | ||
32 | #define DRIVER_NAME "CCI-400" | 32 | #define DRIVER_NAME "CCI-400" |
33 | #define DRIVER_NAME_PMU DRIVER_NAME " PMU" | 33 | #define DRIVER_NAME_PMU DRIVER_NAME " PMU" |
34 | #define PMU_NAME "CCI_400" | ||
35 | 34 | ||
36 | #define CCI_PORT_CTRL 0x0 | 35 | #define CCI_PORT_CTRL 0x0 |
37 | #define CCI_CTRL_STATUS 0xc | 36 | #define CCI_CTRL_STATUS 0xc |
@@ -162,6 +161,15 @@ static struct pmu_port_event_ranges port_event_range[] = { | |||
162 | }, | 161 | }, |
163 | }; | 162 | }; |
164 | 163 | ||
164 | /* | ||
165 | * Export different PMU names for the different revisions so userspace knows | ||
166 | * because the event ids are different | ||
167 | */ | ||
168 | static char *const pmu_names[] = { | ||
169 | [CCI_REV_R0] = "CCI_400", | ||
170 | [CCI_REV_R1] = "CCI_400_r1", | ||
171 | }; | ||
172 | |||
165 | struct cci_pmu_drv_data { | 173 | struct cci_pmu_drv_data { |
166 | void __iomem *base; | 174 | void __iomem *base; |
167 | struct arm_pmu *cci_pmu; | 175 | struct arm_pmu *cci_pmu; |
@@ -520,7 +528,7 @@ static void pmu_write_counter(struct perf_event *event, u32 value) | |||
520 | static int cci_pmu_init(struct arm_pmu *cci_pmu, struct platform_device *pdev) | 528 | static int cci_pmu_init(struct arm_pmu *cci_pmu, struct platform_device *pdev) |
521 | { | 529 | { |
522 | *cci_pmu = (struct arm_pmu){ | 530 | *cci_pmu = (struct arm_pmu){ |
523 | .name = PMU_NAME, | 531 | .name = pmu_names[probe_cci_revision()], |
524 | .max_period = (1LLU << 32) - 1, | 532 | .max_period = (1LLU << 32) - 1, |
525 | .get_hw_events = pmu_get_hw_events, | 533 | .get_hw_events = pmu_get_hw_events, |
526 | .get_event_idx = pmu_get_event_idx, | 534 | .get_event_idx = pmu_get_event_idx, |