Support Krait CPU PMUs
Subsystems (5)
v3 cover Support Krait CPU PMUs
This patchset adds support for the Krait CPU PMUs. I split the main patch up into two parts: first the basic support that gets us just the architected events and second the full support patch that tackles the PMRESR interface.
Changes since v2:
* Rebased onto v3.14-rc1
* Fixed problems found by fuzzer (bitmap logic, per-cpu accesses)
Changes since v1:
* Dropped sparse warning patch
* Reworked percpu irq support patch to hide double pointers in dispatch func
* Expanded on comments explaining Krait raw event syntax
* Expanded on DT binding
* Added qcom,no-pc-write property instead of using cpuid scheme
Stephen Boyd (7):
ARM: perf_event: Support percpu irqs for the CPU PMU
ARM: perf_event: Assign pdev pointer earlier for CPU PMUs
ARM: perf_event: Add basic support for Krait CPU PMUs
ARM: perf_event: Add hook for event index clearing
ARM: perf_event: Fully support Krait CPU PMU events
devicetree: bindings: Document Krait performance monitor units (PMU)
ARM: dts: msm: Add krait-pmu to platforms with Krait CPUs
Documentation/devicetree/bindings/arm/pmu.txt | 9 +- arch/arm/boot/dts/qcom-msm8960-cdp.dts | 6 + arch/arm/boot/dts/qcom-msm8974.dtsi | 5 + arch/arm/include/asm/pmu.h | 2 + arch/arm/kernel/perf_event.c | 16 +- arch/arm/kernel/perf_event_cpu.c | 103 +++-- arch/arm/kernel/perf_event_v7.c | 559 ++++++++++++++++++++++++++ 7 files changed, 666 insertions(+), 34 deletions(-)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH v3 1/7 ARM: perf_event: Support percpu irqs for the CPU PMU
Some CPU PMUs are wired up with one PPI for all the CPUs instead of with a different SPI for each CPU. Add support for these devices.
--- arch/arm/kernel/perf_event.c | 14 ++++-- arch/arm/kernel/perf_event_cpu.c | 97 ++++++++++++++++++++++++++++------------ 2 files changed, 80 insertions(+), 31 deletions(-)
arch/arm/kernel/perf_event.c +11 -3
@@ -16,6 +16,8 @@#include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/uaccess.h> +#include <linux/irq.h> +#include <linux/irqdesc.h> #include <asm/irq_regs.h> #include <asm/pmu.h>
@@ -295,9 +297,15 @@ validate_group(struct perf_event *event)static irqreturn_t armpmu_dispatch_irq (int irq,void *dev) { -struct arm_pmu *armpmu = (struct arm_pmu *) dev; -struct platform_device *plat_device = armpmu->plat_device; -struct arm_pmu_platdata *plat =dev_get_platdata (&plat_device->dev); +struct arm_pmu *armpmu; +struct platform_device *plat_device; +struct arm_pmu_platdata *plat; + +if (irq_is_percpu (irq)) + dev = *(void **)dev; + armpmu = dev; + plat_device = armpmu->plat_device; + plat =dev_get_platdata (&plat_device->dev);if (plat && plat->handle_irq)return plat->handle_irq (irq, dev, armpmu->handle_irq);
arch/arm/kernel/perf_event_cpu.c +69 -28
138 lines not on this page · raw message
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH v3 2/7 ARM: perf_event: Assign pdev pointer earlier for CPU PMUs
In reply to Stephen BoydWe want to inspect the of_node that the pdev is pointing to in the Krait CPU specific PMU initialization function. Assign it earlier so that we don't crash with a NULL pointer dereference.
--- arch/arm/kernel/perf_event_cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/kernel/perf_event_cpu.c +3 -2
@@ -311,6 +311,9 @@ static int cpu_pmu_device_probe(struct platform_device *pdev)return -ENOMEM ; } + cpu_pmu = pmu; + cpu_pmu->plat_device = pdev; +if (node && (of_id =of_match_node (cpu_pmu_of_device_ids, pdev->dev.of_node))) { init_fn = of_id->data; ret =init_fn (pmu);
@@ -323,8 +326,6 @@ static int cpu_pmu_device_probe(struct platform_device *pdev) goto out_free; } - cpu_pmu = pmu; - cpu_pmu->plat_device = pdev;cpu_pmu_init (cpu_pmu); ret =armpmu_register (cpu_pmu,PERF_TYPE_RAW );
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH v3 3/7 ARM: perf_event: Add basic support for Krait CPU PMUs
In reply to Stephen BoydAdd basic support for the Krait CPU PMU. This allows us to use the architected functionality of the PMU.
This is based on code originally written by Ashwin Chaugule and Neil Leeder [1].
--- arch/arm/kernel/perf_event_cpu.c | 1 + arch/arm/kernel/perf_event_v7.c | 164 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 165 insertions(+)
arch/arm/kernel/perf_event_cpu.c +1 -0
@@ -229,6 +229,7 @@ static struct of_device_id cpu_pmu_of_device_ids[] = { {.compatible = "arm,arm11mpcore-pmu", .data = armv6mpcore_pmu_init}, {.compatible = "arm,arm1176-pmu", .data = armv6pmu_init}, {.compatible = "arm,arm1136-pmu", .data = armv6pmu_init}, + {.compatible = "qcom,krait-pmu", .data = krait_pmu_init}, {}, };
arch/arm/kernel/perf_event_v7.c +164 -0
186 lines not on this page · raw message
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH v3 4/7 ARM: perf_event: Add hook for event index clearing
In reply to Stephen BoydOn Krait processors we have a many-to-one relationship between raw CPU events and the event programmed into the PMNx counter. Two raw CPU events could map to the same value programmed in the PMNx counter. To avoid this problem, we check for collisions during the get_event_idx() callback by setting a bit in a bitmap whenever a certain event is used in a PMNx counter (see the next patch). Unfortunately, we don't have a hook to clear this bit in the bitmap when the event is deleted so let's add an optional clear_event_idx() callback for this purpose.
--- arch/arm/include/asm/pmu.h | 2 ++ arch/arm/kernel/perf_event.c | 2 ++ 2 files changed, 4 insertions(+)
arch/arm/include/asm/pmu.h +2 -0
@@ -71,6 +71,8 @@ struct arm_pmu {void (*disable)(struct perf_event *event);int (*get_event_idx)(struct pmu_hw_events *hw_events,struct perf_event *event); +void (*clear_event_idx)(struct pmu_hw_events *hw_events, +struct perf_event *event);int (*set_event_filter)(struct hw_perf_event *evt,struct perf_event_attr *attr);u32 (*read_counter)(struct perf_event *event);
arch/arm/kernel/perf_event.c +2 -0
@@ -207,6 +207,8 @@ armpmu_del(struct perf_event *event, int flags)armpmu_stop (event,PERF_EF_UPDATE ); hw_events->events[idx] =NULL ;clear_bit (idx, hw_events->used_mask); +if (armpmu->clear_event_idx) + armpmu->clear_event_idx (hw_events, event);perf_event_update_userpage (event); }
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH v3 5/7 ARM: perf_event: Fully support Krait CPU PMU events
In reply to Stephen BoydKrait supports a set of performance monitor region event selection registers (PMRESR) sitting behind a cp15 based interface that extend the architected PMU events to include Krait CPU and Venum VFP specific events. To use these events the user is expected to program the region register (PMRESRn) with the event code shifted into the group they care about and then point the PMNx event at that region+group combo by writing a PMRESRn_GROUPx event. Add support for this hardware.
Note: the raw event number is a pure software construct that allows us to map the multi-dimensional number space of regions, groups, and event codes into a flat event number space suitable for use by the perf framework.
This is based on code originally written by Ashwin Chaugule and Neil Leeder [1].
--- arch/arm/kernel/perf_event_v7.c | 407 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 401 insertions(+), 6 deletions(-)
arch/arm/kernel/perf_event_v7.c +401 -6
@@ -18,6 +18,10 @@#ifdef CONFIG_CPU_V7 +#include <asm/cp15.h> +#include <asm/vfp.h> +#include "../vfp/vfpinstr.h" +/* * Common ARMv7 event types *
@@ -109,6 +113,20 @@ enum armv7_a15_perf_types { ARMV7_A15_PERFCTR_PC_WRITE_SPEC = 0x76, }; +/* ARMv7 Krait specific event types */ +enum krait_perf_types { +KRAIT_PMRESR0_GROUP0 =0xcc , +KRAIT_PMRESR1_GROUP0 =0xd0 , +KRAIT_PMRESR2_GROUP0 =0xd4 , +KRAIT_VPMRESR0_GROUP0 =0xd8 , + +KRAIT_PERFCTR_L1_ICACHE_ACCESS =0x10011 , +KRAIT_PERFCTR_L1_ICACHE_MISS =0x10010 , + +KRAIT_PERFCTR_L1_ITLB_ACCESS =0x12222 , +KRAIT_PERFCTR_L1_DTLB_ACCESS =0x12210 , +}; +/* * Cortex-A8 HW events mapping *
@@ -779,8 +797,8 @@ static const unsigned krait_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] }, [C(L1I)] = { [C(OP_READ)] = { - [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, - [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, + [C(RESULT_ACCESS)] = KRAIT_PERFCTR_L1_ICACHE_ACCESS, + [C(RESULT_MISS)] = KRAIT_PERFCTR_L1_ICACHE_MISS, }, [C(OP_WRITE)] = { [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
@@ -807,11 +825,11 @@ static const unsigned krait_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] }, [C(DTLB)] = { [C(OP_READ)] = { - [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, + [C(RESULT_ACCESS)] = KRAIT_PERFCTR_L1_DTLB_ACCESS, [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, }, [C(OP_WRITE)] = { - [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, + [C(RESULT_ACCESS)] = KRAIT_PERFCTR_L1_DTLB_ACCESS, [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, }, [C(OP_PREFETCH)] = {
@@ -821,11 +839,11 @@ static const unsigned krait_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] }, [C(ITLB)] = { [C(OP_READ)] = { - [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, + [C(RESULT_ACCESS)] = KRAIT_PERFCTR_L1_ITLB_ACCESS, [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, }, [C(OP_WRITE)] = { - [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, + [C(RESULT_ACCESS)] = KRAIT_PERFCTR_L1_ITLB_ACCESS, [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, }, [C(OP_PREFETCH)] = {
@@ -1428,6 +1446,378 @@ static int armv7_a7_pmu_init(struct arm_pmu *cpu_pmu)return 0 ; } +/* +* Krait Performance Monitor Region Event Selection Register (PMRESRn) +* +* 31 30 24 16 8 0 +* +--------------------------------+ +* PMRESR0 | EN | CC | CC | CC | CC | N = 1, R = 0 +* +--------------------------------+ +* PMRESR1 | EN | CC | CC | CC | CC | N = 1, R = 1 +* +--------------------------------+ +* PMRESR2 | EN | CC | CC | CC | CC | N = 1, R = 2 +* +--------------------------------+ +* VPMRESR0 | EN | CC | CC | CC | CC | N = 2, R = ? +* +--------------------------------+ +* EN | G=3 | G=2 | G=1 | G=0 +* +* Event Encoding: +* +* hwc->config_base = 0xNRCCG +* +* N = prefix, 1 for Krait CPU (PMRESRn), 2 for Venum VFP (VPMRESR) +* R = region register +* CC = class of events the group G is choosing from +* G = group or particular event +* +* Example: 0x12021 is a Krait CPU event in PMRESR2's group 1 with code 2 +* +* A region (R) corresponds to a piece of the CPU (execution unit, instruction +* unit, etc.) while the event code (CC) corresponds to a particular class of +* events (interrupts for example). An event code is broken down into +* groups (G) that can be mapped into the PMU (irq, fiqs, and irq+fiqs for +* example). +*/ + +#define KRAIT_EVENT (1 << 16) +#define VENUM_EVENT (2 << 16) +#define KRAIT_EVENT_MASK (KRAIT_EVENT | VENUM_EVENT) +#define PMRESRn_EN BIT(31) + +static u32 krait_read_pmresrn (int n) +{ +u32 val; + +switch (n) { +case 0 : + asmvolatile ("mrc p15, 1, %0, c9, c15, 0" :"=r" (val)); +break ; +case 1 : + asmvolatile ("mrc p15, 1, %0, c9, c15, 1" :"=r" (val)); +break ; +case 2 : + asmvolatile ("mrc p15, 1, %0, c9, c15, 2" :"=r" (val)); +break ; +default : +BUG ();/* Should be validated in krait_pmu_get_event_idx() */ + } + +return val; +} + +static void krait_write_pmresrn (int n,u32 val) +{ +switch (n) { +case 0 : + asmvolatile ("mcr p15, 1, %0, c9, c15, 0" : :"r" (val)); +break ; +case 1 : + asmvolatile ("mcr p15, 1, %0, c9, c15, 1" : :"r" (val)); +break ; +case 2 : + asmvolatile ("mcr p15, 1, %0, c9, c15, 2" : :"r" (val)); +break ; +default : +BUG ();/* Should be validated in krait_pmu_get_event_idx() */ + } +} + +static u32 krait_read_vpmresr0 (void ) +{ +u32 val; + asmvolatile ("mrc p10, 7, %0, c11, c0, 0" :"=r" (val)); +return val; +} + +static void krait_write_vpmresr0 (u32 val) +{ + asmvolatile ("mcr p10, 7, %0, c11, c0, 0" : :"r" (val)); +} + +static void krait_pre_vpmresr0 (u32 *venum_orig_val,u32 *fp_orig_val) +{ +u32 venum_new_val; +u32 fp_new_val; + +BUG_ON (preemptible ()); +/* CPACR Enable CP10 and CP11 access */ + *venum_orig_val =get_copro_access (); + venum_new_val = *venum_orig_val |CPACC_SVC (10 ) |CPACC_SVC (11 ); +set_copro_access (venum_new_val); + +/* Enable FPEXC */ + *fp_orig_val =fmrx (FPEXC ); + fp_new_val = *fp_orig_val |FPEXC_EN ; +fmxr (FPEXC , fp_new_val); +} + +static void krait_post_vpmresr0 (u32 venum_orig_val,u32 fp_orig_val) +{ +BUG_ON (preemptible ()); +/* Restore FPEXC */ +fmxr (FPEXC , fp_orig_val); +isb (); +/* Restore CPACR */ +set_copro_access (venum_orig_val); +} + +static u32 krait_get_pmresrn_event (unsigned int region) +{ +static const u32 pmresrn_table[] = {KRAIT_PMRESR0_GROUP0 , +KRAIT_PMRESR1_GROUP0 , +KRAIT_PMRESR2_GROUP0 }; +return pmresrn_table[region]; +} + +static void krait_evt_setup (int idx,u32 config_base) +{ +u32 val; +u32 mask; +u32 vval, fval; +unsigned int region; +unsigned int group; +unsigned int code; +unsigned int group_shift; +bool venum_event; + + venum_event = !!(config_base &VENUM_EVENT ); + region = (config_base >>12 ) &0xf ; + code = (config_base >>4 ) &0xff ; + group = (config_base >>0 ) &0xf ; + + group_shift = group *8 ; + mask =0xff << group_shift; + +/* Configure evtsel for the region and group */ +if (venum_event) + val =KRAIT_VPMRESR0_GROUP0 ; +else + val =krait_get_pmresrn_event (region); + val += group; +/* Mix in mode-exclusion bits */ + val |= config_base & (ARMV7_EXCLUDE_USER |ARMV7_EXCLUDE_PL1 ); +armv7_pmnc_write_evtsel (idx, val); + + asmvolatile ("mcr p15, 0, %0, c9, c15, 0" : :"r" (0 )); + +if (venum_event) { +krait_pre_vpmresr0 (&vval, &fval); + val =krait_read_vpmresr0 (); + val &= ~mask; + val |= code << group_shift; + val |= PMRESRn_EN; +krait_write_vpmresr0 (val); +krait_post_vpmresr0 (vval, fval); + }else { + val =krait_read_pmresrn (region); + val &= ~mask; + val |= code << group_shift; + val |= PMRESRn_EN; +krait_write_pmresrn (region, val); + } +} + +static u32 krait_clear_pmresrn_group (u32 val,int group) +{ +u32 mask; +int group_shift; + + group_shift = group *8 ; + mask =0xff << group_shift; + val &= ~mask; + +/* Don't clear enable bit if entire region isn't disabled */ +if (val & ~PMRESRn_EN) +return val |= PMRESRn_EN; + +return 0 ; +} + +static void krait_clearpmu (u32 config_base) +{ +u32 val; +u32 vval, fval; +unsigned int region; +unsigned int group; +bool venum_event; + + venum_event = !!(config_base &VENUM_EVENT ); + region = (config_base >>12 ) &0xf ; + group = (config_base >>0 ) &0xf ; + +if (venum_event) { +krait_pre_vpmresr0 (&vval, &fval); + val =krait_read_vpmresr0 (); + val =krait_clear_pmresrn_group (val, group); +krait_write_vpmresr0 (val); +krait_post_vpmresr0 (vval, fval); + }else { + val =krait_read_pmresrn (region); + val =krait_clear_pmresrn_group (val, group); +krait_write_pmresrn (region, val); + } +} + +static void krait_pmu_disable_event (struct perf_event *event) +{ +unsigned long flags; +struct hw_perf_event *hwc = &event->hw; +int idx = hwc->idx; +struct pmu_hw_events *events = cpu_pmu->get_hw_events (); + +/* Disable counter and interrupt */ +raw_spin_lock_irqsave (&events->pmu_lock, flags); + +/* Disable counter */ +armv7_pmnc_disable_counter (idx); + +/* +* Clear pmresr code (if destined for PMNx counters) +*/ +if (hwc->config_base &KRAIT_EVENT_MASK ) +krait_clearpmu (hwc->config_base); + +/* Disable interrupt for this counter */ +armv7_pmnc_disable_intens (idx); + +raw_spin_unlock_irqrestore (&events->pmu_lock, flags); +} + +static void krait_pmu_enable_event (struct perf_event *event) +{ +unsigned long flags; +struct hw_perf_event *hwc = &event->hw; +int idx = hwc->idx; +struct pmu_hw_events *events = cpu_pmu->get_hw_events (); + +/* +* Enable counter and interrupt, and set the counter to count +* the event that we're interested in. +*/ +raw_spin_lock_irqsave (&events->pmu_lock, flags); + +/* Disable counter */ +armv7_pmnc_disable_counter (idx); + +/* +* Set event (if destined for PMNx counters) +* We set the event for the cycle counter because we +* have the ability to perform event filtering. +*/ +if (hwc->config_base &KRAIT_EVENT_MASK ) +krait_evt_setup (idx, hwc->config_base); +else +armv7_pmnc_write_evtsel (idx, hwc->config_base); + +/* Enable interrupt for this counter */ +armv7_pmnc_enable_intens (idx); + +/* Enable counter */ +armv7_pmnc_enable_counter (idx); + +raw_spin_unlock_irqrestore (&events->pmu_lock, flags); +} + +static void krait_pmu_reset (void *info) +{ +u32 vval, fval; + +armv7pmu_reset (info); + +/* Clear all pmresrs */ +krait_write_pmresrn (0 ,0 ); +krait_write_pmresrn (1 ,0 ); +krait_write_pmresrn (2 ,0 ); + +krait_pre_vpmresr0 (&vval, &fval); +krait_write_vpmresr0 (0 ); +krait_post_vpmresr0 (vval, fval); +} + +static int krait_event_to_bit (struct perf_event *event,unsigned int region, +unsigned int group) +{ +int bit; +struct hw_perf_event *hwc = &event->hw; +struct arm_pmu *cpu_pmu =to_arm_pmu (event->pmu); + +if (hwc->config_base &VENUM_EVENT ) + bit =KRAIT_VPMRESR0_GROUP0 ; +else + bit =krait_get_pmresrn_event (region); + bit -=krait_get_pmresrn_event (0 ); + bit += group; +/* +* Lower bits are reserved for use by the counters (see +* armv7pmu_get_event_idx() for more info) +*/ + bit +=ARMV7_IDX_COUNTER_LAST (cpu_pmu) +1 ; + +return bit; +} + +/* +* We check for column exclusion constraints here. +* Two events cant use the same group within a pmresr register. +*/ +static int krait_pmu_get_event_idx (struct pmu_hw_events *cpuc, +struct perf_event *event) +{ +int idx; +int bit; +unsigned int prefix; +unsigned int region; +unsigned int code; +unsigned int group; +bool krait_event; +struct hw_perf_event *hwc = &event->hw; + + region = (hwc->config_base >>12 ) &0xf ; + code = (hwc->config_base >>4 ) &0xff ; + group = (hwc->config_base >>0 ) &0xf ; + krait_event = !!(hwc->config_base &KRAIT_EVENT_MASK ); + +if (krait_event) { +/* Ignore invalid events */ +if (group >3 || region >2 ) +return -EINVAL ; + prefix = hwc->config_base &KRAIT_EVENT_MASK ; +if (prefix !=KRAIT_EVENT && prefix !=VENUM_EVENT ) +return -EINVAL ; +if (prefix ==VENUM_EVENT && (code &0xe0 )) +return -EINVAL ; + + bit =krait_event_to_bit (event, region, group); +if (test_and_set_bit (bit, cpuc->used_mask)) +return -EAGAIN ; + } + + idx =armv7pmu_get_event_idx (cpuc, event); +if (idx <0 && krait_event) +clear_bit (bit, cpuc->used_mask); + +return idx; +} + +static void krait_pmu_clear_event_idx (struct pmu_hw_events *cpuc, +struct perf_event *event) +{ +int bit; +struct hw_perf_event *hwc = &event->hw; +unsigned int region; +unsigned int group; +bool krait_event; + + region = (hwc->config_base >>12 ) &0xf ; + group = (hwc->config_base >>0 ) &0xf ; + krait_event = !!(hwc->config_base &KRAIT_EVENT_MASK ); + +if (krait_event) { + bit =krait_event_to_bit (event, region, group); +clear_bit (bit, cpuc->used_mask); + } +} +static int krait_pmu_init (struct arm_pmu *cpu_pmu) {armv7pmu_init (cpu_pmu);
@@ -1440,6 +1830,11 @@ static int krait_pmu_init(struct arm_pmu *cpu_pmu) cpu_pmu->map_event = krait_map_event; cpu_pmu->num_events =armv7_read_num_pmnc_events (); cpu_pmu->set_event_filter = armv7pmu_set_event_filter; + cpu_pmu->reset = krait_pmu_reset; + cpu_pmu->enable = krait_pmu_enable_event; + cpu_pmu->disable = krait_pmu_disable_event; + cpu_pmu->get_event_idx = krait_pmu_get_event_idx; + cpu_pmu->clear_event_idx = krait_pmu_clear_event_idx; return 0; }#else
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH v3 6/7 devicetree: bindings: Document Krait performance monitor units (PMU)
In reply to Stephen BoydDocument the Krait PMU compatible string.
--- Documentation/devicetree/bindings/arm/pmu.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/arm/pmu.txt +8 -1
@@ -16,7 +16,14 @@ Required properties: "arm,arm11mpcore-pmu" "arm,arm1176-pmu" "arm,arm1136-pmu" -- interrupts : 1 combined interrupt or 1 per core. + "qcom,krait-pmu" +- interrupts : 1 combined interrupt or 1 per core. If the interrupt is a per-cpu + interrupt (PPI) then 1 interrupt should be specified. + +Optional properties: + +- qcom,no-pc-write : Indicates that this PMU doesn't support the 0xc and 0xd + events. Example:
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH v3 7/7 ARM: dts: msm: Add krait-pmu to platforms with Krait CPUs
In reply to Stephen BoydAllows us to probe the performance counters on Krait CPUs.
--- arch/arm/boot/dts/qcom-msm8960-cdp.dts | 6 ++++++ arch/arm/boot/dts/qcom-msm8974.dtsi | 5 +++++ 2 files changed, 11 insertions(+)
arch/arm/boot/dts/qcom-msm8960-cdp.dts +6 -0
@@ -9,6 +9,12 @@ compatible = "qcom,msm8960-cdp", "qcom,msm8960"; interrupt-parent = <&intc>; + cpu-pmu { + compatible = "qcom,krait-pmu"; + interrupts = <1 10 0x304>; + qcom,no-pc-write; + }; + intc: interrupt-controller at 2000000 { compatible = "qcom,msm-qgic2"; interrupt-controller;
arch/arm/boot/dts/qcom-msm8974.dtsi +5 -0
@@ -9,6 +9,11 @@ compatible = "qcom,msm8974"; interrupt-parent = <&intc>; + cpu-pmu { + compatible = "qcom,krait-pmu"; + interrupts = <1 7 0xf04>; + }; + soc: soc { #address-cells = <1>; #size-cells = <1>;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation