From: santosh.shilimkar@ti.com (Santosh Shilimkar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] arm: omap4: support pmu
Date: Tue, 1 Mar 2011 19:06:46 +0530 [thread overview]
Message-ID: <98808a1e9a0e0409013a83a66c3847e7@mail.gmail.com> (raw)
In-Reply-To: <1298985434-3009-4-git-send-email-tom.leiming@gmail.com>
> -----Original Message-----
> From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-
> owner at vger.kernel.org] On Behalf Of tom.leiming at gmail.com
> Sent: Tuesday, March 01, 2011 6:47 PM
> To: linux at arm.linux.org.uk
> Cc: linux-arm-kernel at lists.infradead.org; Ming Lei; Woodruff
> Richard; Tony Lindgren; linux-omap at vger.kernel.org
> Subject: [PATCH 3/3] arm: omap4: support pmu
>
> From: Ming Lei <tom.leiming@gmail.com>
>
> This patch supports pmu irq routed from CTI, so
> make pmu/perf working on OMAP4.
>
> The idea is from Woodruff Richard in the disscussion
> "Oprofile on Pandaboard / Omap4" of pandaboard at googlegroups.com.
>
> Cc: Woodruff Richard <r-woodruff2@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: linux-omap at vger.kernel.org
> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
> ---
Thanks Mein Lei for this.
> arch/arm/mach-omap2/devices.c | 54
> ++++++++++++++++++++++++++++++++++++++++-
> 1 files changed, 53 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-
> omap2/devices.c
> index 71f099b..54e9705 100644
> --- a/arch/arm/mach-omap2/devices.c
> +++ b/arch/arm/mach-omap2/devices.c
> @@ -34,6 +34,7 @@
>
> #include "mux.h"
> #include "control.h"
> +#include "dbg44xx.h"
>
> #if defined(CONFIG_VIDEO_OMAP2) ||
> defined(CONFIG_VIDEO_OMAP2_MODULE)
>
> @@ -347,19 +348,70 @@ static struct resource omap3_pmu_resource = {
> .flags = IORESOURCE_IRQ,
> };
>
> +static struct resource omap4_pmu_resource[] = {
> + {
> + .start = OMAP44XX_IRQ_CTI0,
> + .end = OMAP44XX_IRQ_CTI0,
> + .flags = IORESOURCE_IRQ,
> + },
> + {
> + .start = OMAP44XX_IRQ_CTI1,
> + .end = OMAP44XX_IRQ_CTI1,
> + .flags = IORESOURCE_IRQ,
> + }
> +};
> +
> static struct platform_device omap_pmu_device = {
> .name = "arm-pmu",
> .id = ARM_PMU_DEVICE_CPU,
> .num_resources = 1,
> };
>
> +struct pmu_platform_data omap4_pmu_data;
> +
> +static void omap4_configure_pmu_irq(void)
> +{
> + void *base0;
> + void *base1;
> +
> + base0 = ioremap(OMAP4430_CTI0_BASE, 4096);
> + base1 = ioremap(OMAP4430_CTI1_BASE, 4096);
> + if (!base0 && !base1) {
> + pr_err("ioremap for omap4 CTI failed\n");
> + return;
> + }
> +
> + /*configure CTI0 for pmu irq routing*/
> + cti_init(&omap4_pmu_data.cti[0], base0,
> + OMAP44XX_IRQ_CTI0, 6);
> + cti_unlock(&omap4_pmu_data.cti[0]);
> + cti_map_trigger(&omap4_pmu_data.cti[0],
> + 1, 6, 2);
> +
> + /*configure CTI1 for pmu irq routing*/
> + cti_init(&omap4_pmu_data.cti[1], base1,
> + OMAP44XX_IRQ_CTI1, 6);
> + cti_unlock(&omap4_pmu_data.cti[1]);
> + cti_map_trigger(&omap4_pmu_data.cti[1],
> + 1, 6, 3);
> +
> + omap4_pmu_data.cti_cnt = 2;
> + omap4_pmu_data.use_cti_irq = 1;
> +}
> +
> static void omap_init_pmu(void)
> {
> if (cpu_is_omap24xx())
> omap_pmu_device.resource = &omap2_pmu_resource;
> else if (cpu_is_omap34xx())
> omap_pmu_device.resource = &omap3_pmu_resource;
> - else
> + else if (cpu_is_omap44xx()) {
> + omap_pmu_device.resource = omap4_pmu_resource;
> + omap_pmu_device.num_resources = 2;
> + omap_pmu_device.dev.platform_data = &omap4_pmu_data;
> +
> + omap4_configure_pmu_irq();
> + } else
> return;
>
> platform_device_register(&omap_pmu_device);
> --
> 1.7.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-
> omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2011-03-01 13:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-01 13:17 [PATCH 0/3] arm: support pmu irq routed from CTI tom.leiming at gmail.com
2011-03-01 13:17 ` [PATCH 1/3] arm: introduce cross trigger interface helpers tom.leiming at gmail.com
2011-03-01 13:17 ` [PATCH 2/3] arm: pmu: support pmu irq routed from CTI tom.leiming at gmail.com
2011-03-01 14:00 ` Will Deacon
[not found] ` <-294597288559385401@unknownmsgid>
2011-03-01 15:31 ` Ming Lei
2011-03-01 13:17 ` [PATCH 3/3] arm: omap4: support pmu tom.leiming at gmail.com
2011-03-01 13:36 ` Santosh Shilimkar [this message]
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=98808a1e9a0e0409013a83a66c3847e7@mail.gmail.com \
--to=santosh.shilimkar@ti.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).