Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e691c25 authored by Neil Leeder's avatar Neil Leeder
Browse files

perf: arm64: add support for kryo pmu



Initialise the kryo PMU driver if it is detected.

Change-Id: Idc8c1d515c2d913e8d79af5287aaa8154d7be7f4
Signed-off-by: default avatarNeil Leeder <nleeder@codeaurora.org>
parent d08f000c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ Required properties:
	"arm,arm11mpcore-pmu"
	"arm,arm1176-pmu"
	"arm,arm1136-pmu"
	"qcom,kryo-pmuv3"
	"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.
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -36,6 +36,7 @@ static char *descriptions =
	"14 Perf: arm64: stop counters when going into hotplug\n"
	"15 Perf: arm64: make debug dir handle exportable\n"
	"16 Perf: arm64: add perf trace user\n"
	"17 Perf: arm64: add support for kryo pmu\n"
;

static ssize_t desc_read(struct file *fp, char __user *buf,
+15 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include <linux/uaccess.h>
#include <linux/cpu_pm.h>
#include <linux/debugfs.h>
#include <linux/of.h>

#include <asm/cputype.h>
#include <asm/irq.h>
@@ -1627,14 +1628,28 @@ static struct notifier_block perf_cpu_pm_notifier_block = {
 */
static const struct of_device_id armpmu_of_device_ids[] = {
	{.compatible = "arm,armv8-pmuv3"},
	{.compatible = "qcom,kryo-pmuv3", .data = kryo_pmu_init},
	{},
};

static int armpmu_device_probe(struct platform_device *pdev)
{
	struct device_node *node = pdev->dev.of_node;
	const struct of_device_id *of_id;
	int (*init_fn)(struct arm_pmu *);

	if (!cpu_pmu)
		return -ENODEV;

	if (node) {
		of_id = of_match_node(armpmu_of_device_ids, node);
		if (of_id) {
			init_fn = of_id->data;
			if (init_fn)
				init_fn(cpu_pmu);
		}
	}

	cpu_pmu->plat_device = pdev;
	cpu_pmu->percpu_irq = platform_get_irq(cpu_pmu->plat_device, 0);
	return 0;