ARM: shmobile: enable PMU(Performance Monitoring Unit)
cover ARM: shmobile: enable PMU(Performance Monitoring Unit)
From: Tetsuyuki Kobayashi <[email protected]>
Hello, Simon-san
ARM core has hardware performance counters and perf command uses these counters for detailed profiling information.
The follewing patches enables PMU(Performance Monitoring Unit) for sh73a0 and emev2 SoCs. I tested these patches on kzm9g board and kzm9d board.
Tetsuyuki Kobayashi (2):
ARM: shmobile: sh73a0: enable PMU(Performance Monitoring Unit)
ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit)
arch/arm/mach-shmobile/setup-emev2.c | 26 ++++++++++++++++++++++++++ arch/arm/mach-shmobile/setup-sh73a0.c | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+)
Signature · 1 line
1.7.9.5
v2 cover ARM: shmobile: enable PMU(Performance Monitoring Unit)
From: Tetsuyuki Kobayashi <[email protected]>
Hello, Simon-san
ARM core has hardware performance counters and perf command uses these counters for detailed profiling information.
The follewing patches enables PMU(Performance Monitoring Unit) for sh73a0 and emev2 SoCs. I tested these patches on kzm9g board and kzm9d board.
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 | 22 ++++++++++++++++++++++ arch/arm/mach-shmobile/setup-sh73a0.c | 22 ++++++++++++++++++++++ 4 files changed, 46 insertions(+)
Signature · 1 line
1.7.9.5
PATCH v2 1/2 ARM: shmobile: sh73a0: enable PMU(Performance Monitoring Unit)
From: Tetsuyuki Kobayashi <[email protected]>
This patch enables PMU(Performance Monitoring Unit) for sh73a0.
---
Changes for v2:
- Removed #ifdef CONFIG_HW_PERF_EVENTS
- Added kzm9g_defconfig
arch/arm/configs/kzm9g_defconfig | 1 + arch/arm/mach-shmobile/setup-sh73a0.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+)
arch/arm/configs/kzm9g_defconfig +1 -0
@@ -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
arch/arm/mach-shmobile/setup-sh73a0.c +22 -0
@@ -39,6 +39,7 @@#include <asm/mach/map.h> #include <asm/mach/arch.h> #include <asm/mach/time.h> +#include <asm/pmu.h> static struct map_desc sh73a0_io_desc[]__initdata = {/* create a 1:1 entity map for 0xe6xxxxxx
@@ -734,6 +735,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 =ARM_PMU_DEVICE_CPU , + .num_resources =ARRAY_SIZE (pmu_resources), + .resource = pmu_resources, +}; +static struct platform_device *sh73a0_early_devices[]__initdata = { &scif0_device, &scif1_device,
@@ -757,6 +778,7 @@ static struct platform_device *sh73a0_late_devices[] __initdata = { &i2c4_device, &dma0_device, &mpdma0_device, + &pmu_device, };#define SRCR2 0xe61580b0
Signature · 1 line
1.7.9.5
PATCH v2 1/2 ARM: shmobile: sh73a0: enable PMU(Performance Monitoring Unit)
Quoted 51 lines · Tetsuyuki Kobayshi
From: Tetsuyuki Kobayashi <[email protected]>
This patch enables PMU(Performance Monitoring Unit) for sh73a0.
Signed-off-by Tetsuyuki Kobayashi <[email protected]>---
Changes for v2:
- Removed #ifdefCONFIG_HW_PERF_EVENTS
- Addedkzm9g_defconfigarch/arm/configs/kzm9g_defconfig | 1 + arch/arm/mach-shmobile/setup-sh73a0.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+)arch/arm/configs/kzm9g_defconfig +1
-0@@ -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=yarch/arm/mach-shmobile/setup-sh73a0.c +10
-0@@ -39,6 +39,7 @@#include <asm/mach/map.h> #include <asm/mach/arch.h> #include <asm/mach/time.h> +#include <asm/pmu.h> static struct map_desc sh73a0_io_desc[]__initdata = {/* create a 1:1 entity map for 0xe6xxxxxx @@ -734,6 +735,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 ),
arch/arm/mach-shmobile/setup-sh73a0.c static struct platform_device mpdma0_device = { · line 756
Quoted 10 lines
arch/arm/mach-shmobile/setup-sh73a0.c +10
-0+ .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, +};
Please check my latest perf stuff to go into arm-soc (pmu/cleanup). The ARM_PMU_DEVICE_CPU crap has disappeared and you won't need to include asm/pmu.h anymore.
Will
PATCH v2 1/2 ARM: shmobile: sh73a0: enable PMU(Performance Monitoring Unit)
Hello, Will
Quoted 58 lines · Will Deacon
Quoted 57 lines · Tetsuyuki Kobayshi
From: Tetsuyuki Kobayashi <[email protected]>
This patch enables PMU(Performance Monitoring Unit) for sh73a0.
Signed-off-by Tetsuyuki Kobayashi <[email protected]>---
Changes for v2:
- Removed #ifdefCONFIG_HW_PERF_EVENTS
- Addedkzm9g_defconfigarch/arm/configs/kzm9g_defconfig | 1 + arch/arm/mach-shmobile/setup-sh73a0.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+)arch/arm/configs/kzm9g_defconfig +1
-0@@ -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=yarch/arm/mach-shmobile/setup-sh73a0.c +16
-0@@ -39,6 +39,7 @@#include <asm/mach/map.h> #include <asm/mach/arch.h> #include <asm/mach/time.h> +#include <asm/pmu.h> static struct map_desc sh73a0_io_desc[]__initdata = {/* create a 1:1 entity map for 0xe6xxxxxx @@ -734,6 +735,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" ,
Quoted 9 lines
arch/arm/mach-shmobile/setup-sh73a0.c static struct platform_device mpdma0_device = { · line 756
Quoted 4 lines
arch/arm/mach-shmobile/setup-sh73a0.c +4
-0+ .id = ARM_PMU_DEVICE_CPU, + .num_resources = ARRAY_SIZE(pmu_resources), + .resource = pmu_resources, +};Please check my latest perf stuff to go into arm-soc (pmu/cleanup). The
ARM_PMU_DEVICE_CPUcrap has disappeared and you won't need to includeasm/pmu.hanymore.
Thak you, Will. I'm checking out pmu/cleanup branch of arm-soc. I will post v3 patch based on it.
v3 cover ARM: shmobile: enable PMU(Performance Monitoring Unit)
From: Tetsuyuki Kobayashi <[email protected]>
Hello, Will
Could you apply this patch set to your pmu/cleanup branch on arm-soc?
The follewing patches enables PMU(Performance Monitoring Unit) for sh73a0 and emev2 SoCs. I tested these patches on kzm9g board and kzm9d board.
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(+)
Signature · 1 line
1.7.9.5
PATCH v3 1/2 ARM: shmobile: sh73a0: enable PMU(Performance Monitoring Unit)
From: Tetsuyuki Kobayashi <[email protected]>
This patch enables PMU(Performance Monitoring Unit) for sh73a0.
---
Changes for v2:
- Removed #ifdef CONFIG_HW_PERF_EVENTS
- Added kzm9g_defconfig
Changes for v3:
- Rebased to pmu/clean on arm-soc.
arch/arm/configs/kzm9g_defconfig | 1 + arch/arm/mach-shmobile/setup-sh73a0.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+)
arch/arm/configs/kzm9g_defconfig +1 -0
@@ -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
arch/arm/mach-shmobile/setup-sh73a0.c +21 -0
@@ -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
Signature · 1 line
1.7.9.5
PATCH v3 2/2 ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit)
In reply to Tetsuyuki KobayshiFrom: Tetsuyuki Kobayashi <[email protected]>
This patch enables PMU(Performance Monitoring Unit) for emev2.
---
Changes for v2:
- Removed #ifdef CONFIG_HW_PERF_EVENTS
- Added kzm9d_defconfig
Changes for v3:
- Rebased to pmu/clean on arm-soc.
arch/arm/configs/kzm9d_defconfig | 1 + arch/arm/mach-shmobile/setup-emev2.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+)
arch/arm/configs/kzm9d_defconfig +1 -0
@@ -8,6 +8,7 @@ CONFIG_LOG_BUF_SHIFT=16 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
arch/arm/mach-shmobile/setup-emev2.c +21 -0
@@ -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 )
Signature · 1 line
1.7.9.5
v3 cover ARM: shmobile: enable PMU(Performance Monitoring Unit)
In reply to Tetsuyuki KobayshiQuoted 3 lines · Tetsuyuki Kobayshi
From: Tetsuyuki Kobayashi <[email protected]>
Hello, Will
Hi,
Thanks for updating the patches.
Quoted 1 line
Could you apply this patch set to your pmu/cleanup branch on arm-soc?
Actually, it's better if you just base your branch against that one when you send it to arm-soc for merging. That way, other SoCs can also develop against that branch without having to worry about each other.
Cheers,
Will
v3 cover ARM: shmobile: enable PMU(Performance Monitoring Unit)
Hi, Will
Hi, Simon
Quoted 7 lines · Will Deacon
Quoted 3 lines · Tetsuyuki Kobayshi
From: Tetsuyuki Kobayashi <[email protected]>
Hello, Will
Hi,
Quoted 8 lines
Thanks for updating the patches.
Quoted 1 line
Could you apply this patch set to your pmu/cleanup branch on arm-soc?
Actually, it's better if you just base your branch against that one when you send it to arm-soc for merging. That way, other SoCs can also develop against that branch without having to worry about each other.
I see.
I thought that removing ARM_PMU_DEVICE_CPU depends on your pmu/cleanup branch, but I found it does not.
I verified this v3 patch can apply cleanly to soc branch on renesus.git and works fine.
Simon-san, could you apply this v3 patch to soc branch after review ?
v3 cover ARM: shmobile: enable PMU(Performance Monitoring Unit)
Quoted 10 lines · Tetsuyuki Kobayashi
Quoted 6 lines · Will Deacon
Quoted 1 line · Tetsuyuki Kobayshi
From: Tetsuyuki Kobayashi <[email protected]>
Actually, it's better if you just base your branch against that one when you send it to arm-soc for merging. That way, other SoCs can also develop against that branch without having to worry about each other.
I see.
I thought that removingARM_PMU_DEVICE_CPUdepends on your pmu/cleanup branch, but I found it does not.
It will probably build alright for you without my patches, but I don't thinkt it will work correctly as we'll fail to reserve the PMU.
Will
v3 cover ARM: shmobile: enable PMU(Performance Monitoring Unit)
In reply to Tetsuyuki KobayashiQuoted 19 lines · Tetsuyuki Kobayashi
Hi, Will
Hi, SimonQuoted 7 lines · Will Deacon
Quoted 3 lines · Tetsuyuki Kobayshi
From: Tetsuyuki Kobayashi <[email protected]>
Hello, Will
Hi,
Quoted 8 lines
Thanks for updating the patches.
Quoted 1 line
Could you apply this patch set to your pmu/cleanup branch on arm-soc?
Actually, it's better if you just base your branch against that one when you send it to arm-soc for merging. That way, other SoCs can also develop against that branch without having to worry about each other.
Quoted 7 lines
I see.
I thought that removingARM_PMU_DEVICE_CPUdepends on your pmu/cleanup branch, but I found it does not.
I verified this v3 patch can apply cleanly to soc branch on renesus.git and works fine.Simon-san, could you apply this v3 patch to soc branch after review ?
Sure, will do.
v3 cover ARM: shmobile: enable PMU(Performance Monitoring Unit)
In reply to Tetsuyuki KobayshiQuoted 7 lines · Tetsuyuki Kobayshi
From: Tetsuyuki Kobayashi <[email protected]>
Hello, Will
Could you apply this patch set to your pmu/cleanup branch on arm-soc?
The follewing patches enables PMU(Performance Monitoring Unit) for sh73a0 and emev2 SoCs. I tested these patches on kzm9g board and kzm9d board.
Thanks, I have pushed this to the pmu/cleanup branch of my renesas tree and sent a pull-request to Will.
PATCH v2 2/2 ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit)
In reply to Tetsuyuki KobayshiFrom: Tetsuyuki Kobayashi <[email protected]>
This patch enables PMU(Performance Monitoring Unit) for emev2.
---
Changes for v2:
- Removed #ifdef CONFIG_HW_PERF_EVENTS
- Added kzm9d_defconfig
arch/arm/configs/kzm9d_defconfig | 1 + arch/arm/mach-shmobile/setup-emev2.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+)
arch/arm/configs/kzm9d_defconfig +1 -0
@@ -8,6 +8,7 @@ CONFIG_LOG_BUF_SHIFT=16 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
arch/arm/mach-shmobile/setup-emev2.c +22 -0
@@ -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,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 =ARM_PMU_DEVICE_CPU , + .num_resources =ARRAY_SIZE (pmu_resources), + .resource = pmu_resources, +}; +static struct platform_device *emev2_early_devices[]__initdata = { &uart0_device, &uart1_device,
@@ -370,6 +391,7 @@ static struct platform_device *emev2_late_devices[] __initdata = { &gio2_device, &gio3_device, &gio4_device, + &pmu_device, };void __init emev2_add_standard_devices (void )
Signature · 1 line
1.7.9.5