linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 3/6] ARM: OMAP: register PMU IRQs during board initialisation
Date: Fri, 12 Mar 2010 17:29:41 +0000	[thread overview]
Message-ID: <1268414985-22699-4-git-send-email-will.deacon@arm.com> (raw)
In-Reply-To: <1268414985-22699-3-git-send-email-will.deacon@arm.com>

This patch updates the initialisation routines for the OMAP2 and OMAP3 boards
so that they register their PMU IRQs with the PMU framework in the Kernel.

Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 arch/arm/mach-omap2/devices.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 18ad931..83d06d8 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -17,8 +17,10 @@
 #include <linux/clk.h>
 
 #include <mach/hardware.h>
+#include <mach/irqs.h>
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
+#include <asm/pmu.h>
 
 #include <plat/control.h>
 #include <plat/tc.h>
@@ -435,6 +437,33 @@ static void omap_init_mcspi(void)
 static inline void omap_init_mcspi(void) {}
 #endif
 
+static int omap2_pmu_irqs[] = {
+	3,
+};
+
+static int omap3_pmu_irqs[] = {
+	INT_34XX_BENCH_MPU_EMUL,
+};
+
+static struct pmu_irqs cpu_pmu_device = {
+	.device_type = ARM_PMU_DEVICE_CPU,
+};
+
+static void omap_init_pmu(void)
+{
+	if (cpu_is_omap24xx()) {
+		cpu_pmu_device.irqs = omap2_pmu_irqs;;
+		cpu_pmu_device.num_irqs = ARRAY_SIZE(omap2_pmu_irqs);
+	} else if (cpu_is_omap34xx()) {
+		cpu_pmu_device.irqs = omap3_pmu_irqs;
+		cpu_pmu_device.num_irqs = ARRAY_SIZE(omap3_pmu_irqs);
+	} else {
+		return;
+	}
+
+	pmu_device_register(&cpu_pmu_device);
+}
+
 #ifdef CONFIG_OMAP_SHA1_MD5
 static struct resource sha1_md5_resources[] = {
 	{
@@ -774,6 +803,7 @@ static int __init omap2_init_devices(void)
 	omap_init_camera();
 	omap_init_mbox();
 	omap_init_mcspi();
+	omap_init_pmu();
 	omap_hdq_init();
 	omap_init_sti();
 	omap_init_sha1_md5();
-- 
1.6.3.3

  reply	other threads:[~2010-03-12 17:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-12 17:29 [RFC PATCH 0/6] ARM: pmu: provide a registration mechanism for IRQs [v2] Will Deacon
2010-03-12 17:29 ` [RFC PATCH 1/6] ARM: pmu: register IRQs at runtime Will Deacon
2010-03-12 17:29   ` [RFC PATCH 2/6] ARM: Realview: register PMU IRQs during board initialisation Will Deacon
2010-03-12 17:29     ` Will Deacon [this message]
2010-03-12 17:29       ` [RFC PATCH 4/6] ARM: BCMRING: register PMU IRQ " Will Deacon
2010-03-12 17:29         ` [RFC PATCH 5/6] ARM: iop3xx: register PMU IRQs " Will Deacon
2010-03-12 17:29           ` [RFC PATCH 6/6] ARM: pxa: " Will Deacon
2010-03-16 11:41   ` [RFC PATCH 1/6] ARM: pmu: register IRQs at runtime Jamie Iles
2010-03-17 16:06     ` Will Deacon
2010-03-17 16:11     ` Will Deacon
2010-03-17 16:11       ` [RFC PATCH 2/6] ARM: Realview: register PMU IRQs during board initialisation Will Deacon
2010-03-18 12:20       ` [RFC PATCH 1/6] ARM: pmu: register IRQs at runtime Jamie Iles
2010-03-24 15:50         ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1268414985-22699-4-git-send-email-will.deacon@arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).