[RFC PATCH] ARM: SOCFPGA: Enable PMU through the CTI

Will Deacon will.deacon at arm.com
Wed May 15 05:12:05 EDT 2013


Hello,

[adding Jon Hunter]

On Wed, May 15, 2013 at 03:58:02AM +0100, dinguyen at altera.com wrote:
> From: Dinh Nguyen <dinguyen at altera.com>
> 
> SOCFPGA has a PMU(Performance Measurement Unit) that has its
> IRQs routed through Coresight using the CTI(Cross-Trigger Interface).
> 
> This patch enables the PMU and initializes the CTI for usage by
> oprofile/perfmon.
> 
> A lot of the code/idea was taken from this:
> https://patchwork.kernel.org/patch/1432541/
> 
> Signed-off-by: Dinh Nguyen <dinguyen at altera.com>
> CC: Ming Lei <ming.lei at canonical.com>
> CC: Will Deacon <will.deacon at arm.com>
> Cc: Paul Walmsley <paul at pwsan.com>
> Cc: Russell King <linux at arm.linux.org.uk>
> CC: Arnd Bergmann <arnd at arndb.de>
> CC: Olof Johansson <olof at lixom.net>
> Cc: Pavel Machek <pavel at denx.de>
> ---
>  arch/arm/boot/dts/socfpga.dtsi      |   18 +++++
>  arch/arm/include/asm/pmu.h          |    3 +
>  arch/arm/kernel/perf_event.c        |   16 +++++
>  arch/arm/mach-socfpga/Makefile      |    1 +
>  arch/arm/mach-socfpga/socfpga.c     |   21 +++++-
>  arch/arm/mach-socfpga/socfpga_cti.c |  125 +++++++++++++++++++++++++++++++++++
>  arch/arm/mach-socfpga/socfpga_cti.h |   16 +++++
>  7 files changed, 199 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/mach-socfpga/socfpga_cti.c
>  create mode 100644 arch/arm/mach-socfpga/socfpga_cti.h

Whilst it's great to see somebody else making use of CTI, I think this would
benefit from Jon's separate CTI driver that he posted once:

  http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/137156.html

Jon -- would you be interested in reviving that work so the socfpga guys can
make use of it?

> diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h
> index f24edad..60324b3 100644
> --- a/arch/arm/include/asm/pmu.h
> +++ b/arch/arm/include/asm/pmu.h
> @@ -38,6 +38,9 @@ struct arm_pmu_platdata {
>  				  irq_handler_t pmu_handler);
>  	int (*runtime_resume)(struct device *dev);
>  	int (*runtime_suspend)(struct device *dev);
> +	int (*init)(struct platform_device *pdev);
> +	int (*start)(struct platform_device *pdev);
> +	int (*stop)(struct platform_device *pdev);

For omap4, we were planning to use the runtime PM callbacks for managing the
CTI iirc.

Will



More information about the linux-arm-kernel mailing list