Skip to contentSkip to conversation

arm: specify PMU type in platform data

PATCH Superseded Mark Rutland 5 participants 12 messages Nov 19, 2014 – Nov 28, 2014

Subsystems (7)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover arm: specify PMU type in platform data

Currently the ARMv6, ARMv7, and XScale PMU drivers are coupled with each other, and all included in the same c file. To enable the splitting of the ARMv6, ARMv7, and XScale PMU drivers, and the conversion of the arm_pmu framework to a pure library, we need to be a be more precise when describing PMUs, to enable association of the PMU with the right driver. In device tree this is already implicit in the compatible string, but platform data currently only specifies "arm-pmu".

Commit 253d8c3d2518ca6f (arm: perf: add more specific platform device IDs) added "armv6-pmu", "armv7-pmu", and "xscale-pmu" platform device IDs, enabling the three to be distinguished. This series updates platform code to use these strings.

A later patch series will decouple the drivers.

Thanks,
Mark.

Mark Rutland (6):
arm: realview: specify PMU types
arm: pxa: specify PMUs are for XScale CPUs
arm: vexpress: specify PMUs are for ARMv7 CPUs
arm: iop: specify PMUs are for XScale CPUs
arm: shmobile: specify PMUs are for ARMv7 CPUs
arm: omap: specify PMUs are for ARMv7 CPUs

 arch/arm/mach-omap2/pmu.c                | 5 +++--
 arch/arm/mach-pxa/devices.c              | 2 +-
 arch/arm/mach-realview/realview_eb.c     | 3 ++-
 arch/arm/mach-realview/realview_pb1176.c | 2 +-
 arch/arm/mach-realview/realview_pb11mp.c | 2 +-
 arch/arm/mach-realview/realview_pba8.c   | 2 +-
 arch/arm/mach-realview/realview_pbx.c    | 2 +-
 arch/arm/mach-shmobile/setup-r8a7740.c   | 2 +-
 arch/arm/mach-shmobile/setup-sh73a0.c    | 2 +-
 arch/arm/mach-vexpress/ct-ca9x4.c        | 2 +-
 arch/arm/plat-iop/pmu.c                  | 2 +-
 11 files changed, 14 insertions(+), 12 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/6 arm: realview: specify PMU types

Now that we can specify which PMU variant we're likely to deal with, do so in the realview board code. This will allow us to split the ARMv6, ARMv7, and XScale PMU drivers.

The Realview EB may be used with ARMv6 or ARMv7 CPUs, but luckily there's only a single ARMv7 CPU, so we can match that explicitly to determine whether or not we have an ARMv7 PMU.

Cc Linus Walleij <[email protected]>
Cc Russell King <[email protected]>
Cc Olof Johansson <[email protected]>
Cc Arnd Bergmann <[email protected]>
---
 arch/arm/mach-realview/realview_eb.c     | 3 ++-
 arch/arm/mach-realview/realview_pb1176.c | 2 +-
 arch/arm/mach-realview/realview_pb11mp.c | 2 +-
 arch/arm/mach-realview/realview_pba8.c   | 2 +-
 arch/arm/mach-realview/realview_pbx.c    | 2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)
arch/arm/mach-realview/realview_eb.c +2 -1
index 739d4f1..64c88d6 100644
@@ -37,6 +37,7 @@
 #include <asm/pgtable.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/smp_twd.h>
+#include <asm/system_info.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -296,7 +297,6 @@ static struct resource pmu_resources[] = {
 };
 
 static struct platform_device pmu_device = {
-	.name			= "arm-pmu",
 	.id			= -1,
 	.num_resources		= ARRAY_SIZE(pmu_resources),
 	.resource		= pmu_resources,
@@ -451,6 +451,7 @@ static void __init realview_eb_init(void)
 		 */
 		l2x0_init(__io_address(REALVIEW_EB11MP_L220_BASE), 0x00790000, 0xfe000fff);
 #endif
+		pmu_device.name = core_tile_a9mp() ? "armv7-pmu" : "armv6-pmu";
 		platform_device_register(&pmu_device);
 	}
 
arch/arm/mach-realview/realview_pb1176.c +1 -1
index b0e0dca..ce92c18 100644
@@ -280,7 +280,7 @@ static struct resource pmu_resource = {
 };
 
 static struct platform_device pmu_device = {
-	.name			= "arm-pmu",
+	.name			= "armv6-pmu",
 	.id			= -1,
 	.num_resources		= 1,
 	.resource		= &pmu_resource,
arch/arm/mach-realview/realview_pb11mp.c +1 -1
index 47bf55f..15c45e2 100644
@@ -262,7 +262,7 @@ static struct resource pmu_resources[] = {
 };
 
 static struct platform_device pmu_device = {
-	.name			= "arm-pmu",
+	.name			= "armv6-pmu",
 	.id			= -1,
 	.num_resources		= ARRAY_SIZE(pmu_resources),
 	.resource		= pmu_resources,
arch/arm/mach-realview/realview_pba8.c +1 -1
index 4e57a85..4c64662 100644
@@ -240,7 +240,7 @@ static struct resource pmu_resource = {
 };
 
 static struct platform_device pmu_device = {
-	.name			= "arm-pmu",
+	.name			= "armv7-pmu",
 	.id			= -1,
 	.num_resources		= 1,
 	.resource		= &pmu_resource,
arch/arm/mach-realview/realview_pbx.c +1 -1
index d89eb40..9a22b86 100644
@@ -280,7 +280,7 @@ static struct resource pmu_resources[] = {
 };
 
 static struct platform_device pmu_device = {
-	.name			= "arm-pmu",
+	.name			= "armv7-pmu",
 	.id			= -1,
 	.num_resources		= ARRAY_SIZE(pmu_resources),
 	.resource		= pmu_resources,
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/6 arm: realview: specify PMU types

Quoted 8 lines · Mark Rutland

Now that we can specify which PMU variant we're likely to deal with, do so in the realview board code. This will allow us to split the ARMv6, ARMv7, and XScale PMU drivers.

The Realview EB may be used with ARMv6 or ARMv7 CPUs, but luckily there's only a single ARMv7 CPU, so we can match that explicitly to determine whether or not we have an ARMv7 PMU.

Quoted 5 lines
Cc Linus Walleij <[email protected]>
Cc Russell King <[email protected]>
Cc Olof Johansson <[email protected]>
Cc Arnd Bergmann <[email protected]>

Yours,
Linus Walleij

#3 lore raw

PATCH 2/6 arm: pxa: specify PMUs are for XScale CPUs

In reply to Mark Rutland

Now that we can specify which PMU variant we're likely to deal with, do so in the pxa board code. This will allow us to split the ARMv6, ARMv7, and XScale PMU drivers.

Cc Daniel Mack <[email protected]>
Cc Haojian Zhuang <[email protected]>
Cc Robert Jarzmik <[email protected]>
Cc Olof Johansson <[email protected]>
Cc Arnd Bergmann <[email protected]>
---
 arch/arm/mach-pxa/devices.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-pxa/devices.c +1 -1
index ac7b3ea..3543466 100644
@@ -40,7 +40,7 @@ static struct resource pxa_resource_pmu = {
 };
 
 struct platform_device pxa_device_pmu = {
-	.name		= "arm-pmu",
+	.name		= "xscale-pmu",
 	.id		= -1,
 	.resource	= &pxa_resource_pmu,
 	.num_resources	= 1,
Signature · 1 line
1.9.1
maintainer
#4 lore raw

PATCH 2/6 arm: pxa: specify PMUs are for XScale CPUs

Quoted 10 lines · Mark Rutland

Now that we can specify which PMU variant we're likely to deal with, do so in the pxa board code. This will allow us to split the ARMv6, ARMv7, and XScale PMU drivers.

Cc Daniel Mack <[email protected]>
Cc Haojian Zhuang <[email protected]>
Cc Robert Jarzmik <[email protected]>
Cc Olof Johansson <[email protected]>
Cc Arnd Bergmann <[email protected]>
Signature · 1 line
Robert
#5 lore raw

PATCH 3/6 arm: vexpress: specify PMUs are for ARMv7 CPUs

In reply to Mark Rutland

Now that we can specify which PMU variant we're likely to deal with, do so in the vexpress board code. This will allow us to split the ARMv6, ARMv7, and XScale PMU drivers.

Cc Russell King <[email protected]>
Cc Pawel Moll <[email protected]>
Cc Olof Johansson <[email protected]>
Cc Arnd Bergmann <[email protected]>
---
 arch/arm/mach-vexpress/ct-ca9x4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-vexpress/ct-ca9x4.c +1 -1
index 27bea04..656a17f 100644
@@ -139,7 +139,7 @@ static struct resource pmu_resources[] = {
 };
 
 static struct platform_device pmu_device = {
-	.name		= "arm-pmu",
+	.name		= "armv7-pmu",
 	.id		= -1,
 	.num_resources	= ARRAY_SIZE(pmu_resources),
 	.resource	= pmu_resources,
Signature · 1 line
1.9.1
#6 lore raw

PATCH 4/6 arm: iop: specify PMUs are for XScale CPUs

In reply to Mark Rutland

Now that we can specify which PMU variant we're likely to deal with, do so in the iop board code. This will allow us to split the ARMv6, ARMv7, and XScale PMU drivers.

Cc Russell King <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Olof Johansson <[email protected]>
Cc Arnd Bergmann <[email protected]>
---
 arch/arm/plat-iop/pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/plat-iop/pmu.c +1 -1
index ad9f974..c6d979a 100644
@@ -24,7 +24,7 @@ static struct resource pmu_resource = {
 };
 
 static struct platform_device pmu_device = {
-	.name		= "arm-pmu",
+	.name		= "xscale-pmu",
 	.id		= -1,
 	.resource	= &pmu_resource,
 	.num_resources	= 1,
Signature · 1 line
1.9.1
#7 lore raw

PATCH 4/6 arm: iop: specify PMUs are for XScale CPUs

Quoted 9 lines · Mark Rutland

Now that we can specify which PMU variant we're likely to deal with, do so in the iop board code. This will allow us to split the ARMv6, ARMv7, and XScale PMU drivers.

Cc Russell King <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Olof Johansson <[email protected]>
Cc Arnd Bergmann <[email protected]>

Yours,
Linus Walleij

#8 lore raw

PATCH 5/6 arm: shmobile: specify PMUs are for ARMv7 CPUs

In reply to Mark Rutland

Now that we can specify which PMU variant we're likely to deal with, do so in the shmobile board code. This will allow us to split the ARMv6, ARMv7, and XScale PMU drivers

Cc Simon Horman <[email protected]>
Cc Magnus Damm <[email protected]>
Cc Olof Johansson <[email protected]>
Cc Arnd Bergmann <[email protected]>
---
 arch/arm/mach-shmobile/setup-r8a7740.c | 2 +-
 arch/arm/mach-shmobile/setup-sh73a0.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-shmobile/setup-r8a7740.c +1 -1
index 8894e1b..f3abc9e 100644
@@ -659,7 +659,7 @@ static struct resource pmu_resources[] = {
 };
 
 static struct platform_device pmu_device = {
-	.name	= "arm-pmu",
+	.name	= "armv7-pmu",
 	.id	= -1,
 	.num_resources = ARRAY_SIZE(pmu_resources),
 	.resource = pmu_resources,
arch/arm/mach-shmobile/setup-sh73a0.c +1 -1
index b7bd8e5..23aa1c1 100644
@@ -546,7 +546,7 @@ static struct resource pmu_resources[] = {
 };
 
 static struct platform_device pmu_device = {
-	.name		= "arm-pmu",
+	.name		= "armv7-pmu",
 	.id		= -1,
 	.num_resources	= ARRAY_SIZE(pmu_resources),
 	.resource	= pmu_resources,
Signature · 1 line
1.9.1
#9 lore raw

PATCH 5/6 arm: shmobile: specify PMUs are for ARMv7 CPUs

Quoted 9 lines · Mark Rutland

Now that we can specify which PMU variant we're likely to deal with, do so in the shmobile board code. This will allow us to split the ARMv6, ARMv7, and XScale PMU drivers

Cc Simon Horman <[email protected]>
Cc Magnus Damm <[email protected]>
Cc Olof Johansson <[email protected]>
Cc Arnd Bergmann <[email protected]>
Quoted 4 lines
---
 arch/arm/mach-shmobile/setup-r8a7740.c | 2 +-
 arch/arm/mach-shmobile/setup-sh73a0.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Hi Mark,

I'm happy to take this through my tree for v3.20.

Quoted 36 lines
arch/arm/mach-shmobile/setup-r8a7740.c +1 -1
index 8894e1b..f3abc9e 100644
@@ -659,7 +659,7 @@ static struct resource pmu_resources[] = {
 };
 
 static struct platform_device pmu_device = {
-	.name	= "arm-pmu",
+	.name	= "armv7-pmu",
 	.id	= -1,
 	.num_resources = ARRAY_SIZE(pmu_resources),
 	.resource = pmu_resources,
arch/arm/mach-shmobile/setup-sh73a0.c +1 -1
index b7bd8e5..23aa1c1 100644
@@ -546,7 +546,7 @@ static struct resource pmu_resources[] = {
 };
 
 static struct platform_device pmu_device = {
-	.name		= "arm-pmu",
+	.name		= "armv7-pmu",
 	.id		= -1,
 	.num_resources	= ARRAY_SIZE(pmu_resources),
 	.resource	= pmu_resources,
Signature · 7 lines
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#10 lore raw

PATCH 6/6 arm: omap: specify PMUs are for ARMv7 CPUs

In reply to Mark Rutland

Now that we can specify which PMU variant we're likely to deal with, do so in the omap board code. This will allow us to split the ARMv6, ARMv7, and XScale PMU drivers.

The unnecessary include of asm/pmu.h is also removed.

Cc Tony Lindgren <[email protected]>
Cc Olof Johansson <[email protected]>
Cc Arnd Bergmann <[email protected]>
---
 arch/arm/mach-omap2/pmu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/pmu.c +3 -2
index 33c8846..a69e9a3 100644
@@ -13,7 +13,7 @@
  */
 #include <linux/of.h>
 
-#include <asm/pmu.h>
+#include <asm/system_info.h>
 
 #include "soc.h"
 #include "omap_hwmod.h"
@@ -37,7 +37,8 @@ static int __init omap2_init_pmu(unsigned oh_num, char *oh_names[])
 {
 	int i;
 	struct omap_hwmod *oh[3];
-	char *dev_name = "arm-pmu";
+	char *dev_name = cpu_architecture() == CPU_ARCH_ARMv6 ?
+			 "armv6-pmu" : "armv7-pmu";
 
 	if ((!oh_num) || (oh_num > 3))
 		return -EINVAL;
Signature · 1 line
1.9.1
maintainer
#11 lore raw

PATCH 6/6 arm: omap: specify PMUs are for ARMv7 CPUs

Quoted 10 lines · Mark Rutland

Now that we can specify which PMU variant we're likely to deal with, do so in the omap board code. This will allow us to split the ARMv6, ARMv7, and XScale PMU drivers.

The unnecessary include of asm/pmu.h is also removed.

Cc Tony Lindgren <[email protected]>
Cc Olof Johansson <[email protected]>
Cc Arnd Bergmann <[email protected]>

Looks OK to me:

Quoted 30 lines
---
 arch/arm/mach-omap2/pmu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/pmu.c +3 -2
index 33c8846..a69e9a3 100644
@@ -13,7 +13,7 @@
  */
 #include <linux/of.h>
 
-#include <asm/pmu.h>
+#include <asm/system_info.h>
 
 #include "soc.h"
 #include "omap_hwmod.h"
@@ -37,7 +37,8 @@ static int __init omap2_init_pmu(unsigned oh_num, char *oh_names[])
 {
 	int i;
 	struct omap_hwmod *oh[3];
-	char *dev_name = "arm-pmu";
+	char *dev_name = cpu_architecture() == CPU_ARCH_ARMv6 ?
+			 "armv6-pmu" : "armv7-pmu";
 
 	if ((!oh_num) || (oh_num > 3))
 		return -EINVAL;
Signature · 1 line
1.9.1