* [PATCH 1/2] ARM: shmobile: sh73a0: enable PMU(Performance Monitoring Unit)
2012-09-11 8:05 [GIT] Renesas ARM-based SoC: pmu/cleanup for 3.7 Simon Horman
@ 2012-09-11 8:05 ` Simon Horman
2012-09-11 8:05 ` [PATCH 2/2] ARM: shmobile: emev2: " Simon Horman
2012-09-11 8:49 ` [GIT] Renesas ARM-based SoC: pmu/cleanup for 3.7 Will Deacon
2 siblings, 0 replies; 11+ messages in thread
From: Simon Horman @ 2012-09-11 8:05 UTC (permalink / raw)
To: linux-arm-kernel
From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
This patch enables PMU(Performance Monitoring Unit) for sh73a0.
Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
arch/arm/configs/kzm9g_defconfig | 1 +
arch/arm/mach-shmobile/setup-sh73a0.c | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
index 2388c86..5d0c667 100644
--- a/arch/arm/configs/kzm9g_defconfig
+++ b/arch/arm/configs/kzm9g_defconfig
@@ -14,6 +14,7 @@ CONFIG_NAMESPACES=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_EMBEDDED=y
+CONFIG_PERF_EVENTS=y
CONFIG_SLAB=y
CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
index d230af6..38ed2dd 100644
--- a/arch/arm/mach-shmobile/setup-sh73a0.c
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -734,6 +734,26 @@ static struct platform_device mpdma0_device = {
},
};
+static struct resource pmu_resources[] = {
+ [0] = {
+ .start = gic_spi(55),
+ .end = gic_spi(55),
+ .flags = IORESOURCE_IRQ,
+ },
+ [1] = {
+ .start = gic_spi(56),
+ .end = gic_spi(56),
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device pmu_device = {
+ .name = "arm-pmu",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(pmu_resources),
+ .resource = pmu_resources,
+};
+
static struct platform_device *sh73a0_early_devices[] __initdata = {
&scif0_device,
&scif1_device,
@@ -757,6 +777,7 @@ static struct platform_device *sh73a0_late_devices[] __initdata = {
&i2c4_device,
&dma0_device,
&mpdma0_device,
+ &pmu_device,
};
#define SRCR2 0xe61580b0
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 2/2] ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit)
2012-09-11 8:05 [GIT] Renesas ARM-based SoC: pmu/cleanup for 3.7 Simon Horman
2012-09-11 8:05 ` [PATCH 1/2] ARM: shmobile: sh73a0: enable PMU(Performance Monitoring Unit) Simon Horman
@ 2012-09-11 8:05 ` Simon Horman
2012-09-11 8:49 ` [GIT] Renesas ARM-based SoC: pmu/cleanup for 3.7 Will Deacon
2 siblings, 0 replies; 11+ messages in thread
From: Simon Horman @ 2012-09-11 8:05 UTC (permalink / raw)
To: linux-arm-kernel
From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
This patch enables PMU(Performance Monitoring Unit) for emev2.
Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
arch/arm/configs/kzm9d_defconfig | 1 +
arch/arm/mach-shmobile/setup-emev2.c | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/arch/arm/configs/kzm9d_defconfig b/arch/arm/configs/kzm9d_defconfig
index 26146ff..8c49df6 100644
--- a/arch/arm/configs/kzm9d_defconfig
+++ b/arch/arm/configs/kzm9d_defconfig
@@ -8,6 +8,7 @@ CONFIG_LOG_BUF_SHIFT\x16
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_EMBEDDED=y
+CONFIG_PERF_EVENTS=y
CONFIG_SLAB=y
# CONFIG_BLK_DEV_BSG is not set
# CONFIG_IOSCHED_DEADLINE is not set
diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
index dae9aa6..61446f3 100644
--- a/arch/arm/mach-shmobile/setup-emev2.c
+++ b/arch/arm/mach-shmobile/setup-emev2.c
@@ -356,6 +356,26 @@ static struct platform_device gio4_device = {
},
};
+static struct resource pmu_resources[] = {
+ [0] = {
+ .start = 152,
+ .end = 152,
+ .flags = IORESOURCE_IRQ,
+ },
+ [1] = {
+ .start = 153,
+ .end = 153,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device pmu_device = {
+ .name = "arm-pmu",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(pmu_resources),
+ .resource = pmu_resources,
+};
+
static struct platform_device *emev2_early_devices[] __initdata = {
&uart0_device,
&uart1_device,
@@ -370,6 +390,7 @@ static struct platform_device *emev2_late_devices[] __initdata = {
&gio2_device,
&gio3_device,
&gio4_device,
+ &pmu_device,
};
void __init emev2_add_standard_devices(void)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [GIT] Renesas ARM-based SoC: pmu/cleanup for 3.7
2012-09-11 8:05 [GIT] Renesas ARM-based SoC: pmu/cleanup for 3.7 Simon Horman
2012-09-11 8:05 ` [PATCH 1/2] ARM: shmobile: sh73a0: enable PMU(Performance Monitoring Unit) Simon Horman
2012-09-11 8:05 ` [PATCH 2/2] ARM: shmobile: emev2: " Simon Horman
@ 2012-09-11 8:49 ` Will Deacon
2012-09-11 9:03 ` Simon Horman
2012-09-12 6:08 ` Olof Johansson
2 siblings, 2 replies; 11+ messages in thread
From: Will Deacon @ 2012-09-11 8:49 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Sep 11, 2012 at 09:05:25AM +0100, Simon Horman wrote:
> Hi Will,
Hi Simon,
> please consider the following changes from Kobayashi-san
> for the pmu/cleanup branch.
Thanks for this. It probably makes more sense for the arm-soc guys to pull
it in directly, rather than me send it as another pull request.
Arnd, Olof -- can you pull this into an shmobile perf branch please?
Will
> ----------------------------------------------------------------
> The following changes since commit 051f1b13144dd8553d5a5104dde94c7263ae3ba7:
>
> ARM: perf: move irq registration into pmu implementation (2012-08-23 11:35:52 +0100)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git pmu/cleanup
>
> for you to fetch changes up to e433d4440bf7dd5955a4616cfb9bffd1ec6ab839:
>
> ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit) (2012-09-11 16:27:41 +0900)
>
> ----------------------------------------------------------------
> Tetsuyuki Kobayashi (2):
> ARM: shmobile: sh73a0: enable PMU(Performance Monitoring Unit)
> ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit)
>
> arch/arm/configs/kzm9d_defconfig | 1 +
> arch/arm/configs/kzm9g_defconfig | 1 +
> arch/arm/mach-shmobile/setup-emev2.c | 21 +++++++++++++++++++++
> arch/arm/mach-shmobile/setup-sh73a0.c | 21 +++++++++++++++++++++
> 4 files changed, 44 insertions(+)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [GIT] Renesas ARM-based SoC: pmu/cleanup for 3.7
2012-09-11 8:49 ` [GIT] Renesas ARM-based SoC: pmu/cleanup for 3.7 Will Deacon
@ 2012-09-11 9:03 ` Simon Horman
2012-09-12 6:08 ` Olof Johansson
1 sibling, 0 replies; 11+ messages in thread
From: Simon Horman @ 2012-09-11 9:03 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Sep 11, 2012 at 09:49:14AM +0100, Will Deacon wrote:
> On Tue, Sep 11, 2012 at 09:05:25AM +0100, Simon Horman wrote:
> > Hi Will,
>
> Hi Simon,
>
> > please consider the following changes from Kobayashi-san
> > for the pmu/cleanup branch.
>
> Thanks for this. It probably makes more sense for the arm-soc guys to pull
> it in directly, rather than me send it as another pull request.
Sorry, I was a bit confused about who does the pulling,
naturally that is fine by me.
>
> Arnd, Olof -- can you pull this into an shmobile perf branch please?
>
> Will
>
> > ----------------------------------------------------------------
> > The following changes since commit 051f1b13144dd8553d5a5104dde94c7263ae3ba7:
> >
> > ARM: perf: move irq registration into pmu implementation (2012-08-23 11:35:52 +0100)
> >
> > are available in the git repository at:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git pmu/cleanup
> >
> > for you to fetch changes up to e433d4440bf7dd5955a4616cfb9bffd1ec6ab839:
> >
> > ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit) (2012-09-11 16:27:41 +0900)
> >
> > ----------------------------------------------------------------
> > Tetsuyuki Kobayashi (2):
> > ARM: shmobile: sh73a0: enable PMU(Performance Monitoring Unit)
> > ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit)
> >
> > arch/arm/configs/kzm9d_defconfig | 1 +
> > arch/arm/configs/kzm9g_defconfig | 1 +
> > arch/arm/mach-shmobile/setup-emev2.c | 21 +++++++++++++++++++++
> > arch/arm/mach-shmobile/setup-sh73a0.c | 21 +++++++++++++++++++++
> > 4 files changed, 44 insertions(+)
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [GIT] Renesas ARM-based SoC: pmu/cleanup for 3.7
2012-09-11 8:49 ` [GIT] Renesas ARM-based SoC: pmu/cleanup for 3.7 Will Deacon
2012-09-11 9:03 ` Simon Horman
@ 2012-09-12 6:08 ` Olof Johansson
1 sibling, 0 replies; 11+ messages in thread
From: Olof Johansson @ 2012-09-12 6:08 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Sep 11, 2012 at 1:49 AM, Will Deacon <will.deacon@arm.com> wrote:
> On Tue, Sep 11, 2012 at 09:05:25AM +0100, Simon Horman wrote:
>> Hi Will,
>
> Hi Simon,
>
>> please consider the following changes from Kobayashi-san
>> for the pmu/cleanup branch.
>
> Thanks for this. It probably makes more sense for the arm-soc guys to pull
> it in directly, rather than me send it as another pull request.
>
> Arnd, Olof -- can you pull this into an shmobile perf branch please?
Done, pulled in as renesas/pmu, part of next/soc with proper dependencies.
Thanks,
-Olof
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit)
2012-09-05 2:48 [PATCH 2/2] ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit) Tetsuyuki Kobayshi
@ 2012-09-05 2:58 ` Simon Horman
2012-09-05 4:25 ` Tetsuyuki Kobayashi
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Simon Horman @ 2012-09-05 2:58 UTC (permalink / raw)
To: linux-sh
On Wed, Sep 05, 2012 at 11:48:37AM +0900, Tetsuyuki Kobayshi wrote:
> From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
>
> This patch enables PMU(Performance Monitoring Unit) for emev2 when compiled with CONFIG_HW_PERF_EVENTS.
Hi Kobayshi-san,
Is it appropriate to enable this in the defconfig?
If so, could you send an updated patch?
>
> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
> ---
> arch/arm/mach-shmobile/setup-emev2.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
> index dae9aa6..f3ff171 100644
> --- a/arch/arm/mach-shmobile/setup-emev2.c
> +++ b/arch/arm/mach-shmobile/setup-emev2.c
> @@ -36,6 +36,7 @@
> #include <asm/mach/map.h>
> #include <asm/mach/time.h>
> #include <asm/hardware/gic.h>
> +#include <asm/pmu.h>
>
> static struct map_desc emev2_io_desc[] __initdata = {
> #ifdef CONFIG_SMP
> @@ -356,6 +357,28 @@ static struct platform_device gio4_device = {
> },
> };
>
> +#ifdef CONFIG_HW_PERF_EVENTS
> +static struct resource pmu_resources[] = {
> + [0] = {
> + .start = 152,
> + .end = 152,
> + .flags = IORESOURCE_IRQ,
> + },
> + [1] = {
> + .start = 153,
> + .end = 153,
> + .flags = IORESOURCE_IRQ,
> + },
> +};
> +
> +static struct platform_device pmu_device = {
> + .name = "arm-pmu",
> + .id = ARM_PMU_DEVICE_CPU,
> + .num_resources = ARRAY_SIZE(pmu_resources),
> + .resource = pmu_resources,
> +};
> +#endif
> +
> static struct platform_device *emev2_early_devices[] __initdata = {
> &uart0_device,
> &uart1_device,
> @@ -370,6 +393,9 @@ static struct platform_device *emev2_late_devices[] __initdata = {
> &gio2_device,
> &gio3_device,
> &gio4_device,
> +#ifdef CONFIG_HW_PERF_EVENTS
> + &pmu_device,
> +#endif
> };
>
> void __init emev2_add_standard_devices(void)
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH 2/2] ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit)
2012-09-05 2:48 [PATCH 2/2] ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit) Tetsuyuki Kobayshi
2012-09-05 2:58 ` Simon Horman
@ 2012-09-05 4:25 ` Tetsuyuki Kobayashi
2012-09-05 8:20 ` Magnus Damm
2012-09-05 9:00 ` Tetsuyuki Kobayashi
3 siblings, 0 replies; 11+ messages in thread
From: Tetsuyuki Kobayashi @ 2012-09-05 4:25 UTC (permalink / raw)
To: linux-sh
Simon-san,
(2012/09/05 11:58), Simon Horman wrote:
> On Wed, Sep 05, 2012 at 11:48:37AM +0900, Tetsuyuki Kobayshi wrote:
>> From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
>>
>> This patch enables PMU(Performance Monitoring Unit) for emev2 when compiled with CONFIG_HW_PERF_EVENTS.
>
> Hi Kobayshi-san,
>
> Is it appropriate to enable this in the defconfig?
> If so, could you send an updated patch?
>
OK. I will post v2 patch with defconfig.
>>
>> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
>> ---
>> arch/arm/mach-shmobile/setup-emev2.c | 26 ++++++++++++++++++++++++++
>> 1 file changed, 26 insertions(+)
>>
>> diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
>> index dae9aa6..f3ff171 100644
>> --- a/arch/arm/mach-shmobile/setup-emev2.c
>> +++ b/arch/arm/mach-shmobile/setup-emev2.c
>> @@ -36,6 +36,7 @@
>> #include <asm/mach/map.h>
>> #include <asm/mach/time.h>
>> #include <asm/hardware/gic.h>
>> +#include <asm/pmu.h>
>>
>> static struct map_desc emev2_io_desc[] __initdata = {
>> #ifdef CONFIG_SMP
>> @@ -356,6 +357,28 @@ static struct platform_device gio4_device = {
>> },
>> };
>>
>> +#ifdef CONFIG_HW_PERF_EVENTS
>> +static struct resource pmu_resources[] = {
>> + [0] = {
>> + .start = 152,
>> + .end = 152,
>> + .flags = IORESOURCE_IRQ,
>> + },
>> + [1] = {
>> + .start = 153,
>> + .end = 153,
>> + .flags = IORESOURCE_IRQ,
>> + },
>> +};
>> +
>> +static struct platform_device pmu_device = {
>> + .name = "arm-pmu",
>> + .id = ARM_PMU_DEVICE_CPU,
>> + .num_resources = ARRAY_SIZE(pmu_resources),
>> + .resource = pmu_resources,
>> +};
>> +#endif
>> +
>> static struct platform_device *emev2_early_devices[] __initdata = {
>> &uart0_device,
>> &uart1_device,
>> @@ -370,6 +393,9 @@ static struct platform_device *emev2_late_devices[] __initdata = {
>> &gio2_device,
>> &gio3_device,
>> &gio4_device,
>> +#ifdef CONFIG_HW_PERF_EVENTS
>> + &pmu_device,
>> +#endif
>> };
>>
>> void __init emev2_add_standard_devices(void)
>> --
>> 1.7.9.5
>>
>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH 2/2] ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit)
2012-09-05 2:48 [PATCH 2/2] ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit) Tetsuyuki Kobayshi
2012-09-05 2:58 ` Simon Horman
2012-09-05 4:25 ` Tetsuyuki Kobayashi
@ 2012-09-05 8:20 ` Magnus Damm
2012-09-05 9:00 ` Tetsuyuki Kobayashi
3 siblings, 0 replies; 11+ messages in thread
From: Magnus Damm @ 2012-09-05 8:20 UTC (permalink / raw)
To: linux-sh
Hello Kobayashi-san,
Many thanks for your patches!
On Tue, Sep 4, 2012 at 9:48 PM, Tetsuyuki Kobayshi <koba@kmckk.co.jp> wrote:
> From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
>
> This patch enables PMU(Performance Monitoring Unit) for emev2 when compiled with CONFIG_HW_PERF_EVENTS.
>
> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
> ---
> arch/arm/mach-shmobile/setup-emev2.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
> index dae9aa6..f3ff171 100644
> --- a/arch/arm/mach-shmobile/setup-emev2.c
> +++ b/arch/arm/mach-shmobile/setup-emev2.c
> @@ -36,6 +36,7 @@
> #include <asm/mach/map.h>
> #include <asm/mach/time.h>
> #include <asm/hardware/gic.h>
> +#include <asm/pmu.h>
>
> static struct map_desc emev2_io_desc[] __initdata = {
> #ifdef CONFIG_SMP
> @@ -356,6 +357,28 @@ static struct platform_device gio4_device = {
> },
> };
>
> +#ifdef CONFIG_HW_PERF_EVENTS
> +static struct resource pmu_resources[] = {
> + [0] = {
> + .start = 152,
> + .end = 152,
> + .flags = IORESOURCE_IRQ,
> + },
> + [1] = {
> + .start = 153,
> + .end = 153,
> + .flags = IORESOURCE_IRQ,
> + },
> +};
> +
> +static struct platform_device pmu_device = {
> + .name = "arm-pmu",
> + .id = ARM_PMU_DEVICE_CPU,
> + .num_resources = ARRAY_SIZE(pmu_resources),
> + .resource = pmu_resources,
> +};
> +#endif
> +
> static struct platform_device *emev2_early_devices[] __initdata = {
> &uart0_device,
> &uart1_device,
> @@ -370,6 +393,9 @@ static struct platform_device *emev2_late_devices[] __initdata = {
> &gio2_device,
> &gio3_device,
> &gio4_device,
> +#ifdef CONFIG_HW_PERF_EVENTS
> + &pmu_device,
> +#endif
Is there any special reason why you want to wrap the code in #ifdefs?
As you can see, that's not so common for arch/arm/mach-shmobile to use
#ifdefs.
Usually we try to avoid using #ifdefs for regular platform data since
it makes the code more unreadable. The idea behind this is that the
platform device will exist regardless of the configuration and this
rather low potentially additional memory overhead has so far been seen
as acceptable.
Also, is there some way you can use the PMU with the DT (device tree)?
If so then the per-soc device tree files should be updated as well. We
have been requested this from the ARM soc maintainers. Such changes
should be CC:ed to the ARM mailing list so they can see that we are
following the standard way and working with the device tree.
Thank you!
/ magnus
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH 2/2] ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit)
2012-09-05 2:48 [PATCH 2/2] ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit) Tetsuyuki Kobayshi
` (2 preceding siblings ...)
2012-09-05 8:20 ` Magnus Damm
@ 2012-09-05 9:00 ` Tetsuyuki Kobayashi
3 siblings, 0 replies; 11+ messages in thread
From: Tetsuyuki Kobayashi @ 2012-09-05 9:00 UTC (permalink / raw)
To: linux-sh
Hello Magnus and Paul,
(2012/09/05 17:20), Magnus Damm wrote:
> Hello Kobayashi-san,
>
> Many thanks for your patches!
>
> On Tue, Sep 4, 2012 at 9:48 PM, Tetsuyuki Kobayshi <koba@kmckk.co.jp> wrote:
>> From: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
>>
>> This patch enables PMU(Performance Monitoring Unit) for emev2 when compiled with CONFIG_HW_PERF_EVENTS.
>>
>> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
>> ---
>> arch/arm/mach-shmobile/setup-emev2.c | 26 ++++++++++++++++++++++++++
>> 1 file changed, 26 insertions(+)
>>
>> diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
>> index dae9aa6..f3ff171 100644
>> --- a/arch/arm/mach-shmobile/setup-emev2.c
>> +++ b/arch/arm/mach-shmobile/setup-emev2.c
>> @@ -36,6 +36,7 @@
>> #include <asm/mach/map.h>
>> #include <asm/mach/time.h>
>> #include <asm/hardware/gic.h>
>> +#include <asm/pmu.h>
>>
>> static struct map_desc emev2_io_desc[] __initdata = {
>> #ifdef CONFIG_SMP
>> @@ -356,6 +357,28 @@ static struct platform_device gio4_device = {
>> },
>> };
>>
>> +#ifdef CONFIG_HW_PERF_EVENTS
>> +static struct resource pmu_resources[] = {
>> + [0] = {
>> + .start = 152,
>> + .end = 152,
>> + .flags = IORESOURCE_IRQ,
>> + },
>> + [1] = {
>> + .start = 153,
>> + .end = 153,
>> + .flags = IORESOURCE_IRQ,
>> + },
>> +};
>> +
>> +static struct platform_device pmu_device = {
>> + .name = "arm-pmu",
>> + .id = ARM_PMU_DEVICE_CPU,
>> + .num_resources = ARRAY_SIZE(pmu_resources),
>> + .resource = pmu_resources,
>> +};
>> +#endif
>> +
>> static struct platform_device *emev2_early_devices[] __initdata = {
>> &uart0_device,
>> &uart1_device,
>> @@ -370,6 +393,9 @@ static struct platform_device *emev2_late_devices[] __initdata = {
>> &gio2_device,
>> &gio3_device,
>> &gio4_device,
>> +#ifdef CONFIG_HW_PERF_EVENTS
>> + &pmu_device,
>> +#endif
>
> Is there any special reason why you want to wrap the code in #ifdefs?
> As you can see, that's not so common for arch/arm/mach-shmobile to use
> #ifdefs.
>
I thought I didn't like increasing code size ..
> Usually we try to avoid using #ifdefs for regular platform data since
> it makes the code more unreadable. The idea behind this is that the
> platform device will exist regardless of the configuration and this
> rather low potentially additional memory overhead has so far been seen
> as acceptable.
I see. Paul said the same, too.
I will post revised patch without #ifdefs.
>
> Also, is there some way you can use the PMU with the DT (device tree)?
> If so then the per-soc device tree files should be updated as well. We
> have been requested this from the ARM soc maintainers. Such changes
> should be CC:ed to the ARM mailing list so they can see that we are
> following the standard way and working with the device tree.
I have to study about device tree.
The differece between these 2 patches are only IRQ number.
It is better to get PMU IRQ number from DT.. But how?
Is there any example?
^ permalink raw reply [flat|nested] 11+ messages in thread