arm: specify PMU type in platform data
Subsystems (7)
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
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.
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
Signed-off-by Mark Rutland <[email protected]>Cc Linus Walleij <[email protected]>Cc Russell King <[email protected]>Cc Olof Johansson <[email protected]>Cc Arnd Bergmann <[email protected]>
Yours,
Linus Walleij
PATCH 2/6 arm: pxa: specify PMUs are for XScale CPUs
In reply to Mark RutlandNow 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.
--- arch/arm/mach-pxa/devices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-pxa/devices.c +1 -1
@@ -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
Robert Jarzmik
maintainerPATCH 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.
Signed-off-by Mark Rutland <[email protected]>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
PATCH 3/6 arm: vexpress: specify PMUs are for ARMv7 CPUs
In reply to Mark RutlandNow 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.
--- arch/arm/mach-vexpress/ct-ca9x4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-vexpress/ct-ca9x4.c +1 -1
@@ -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
PATCH 4/6 arm: iop: specify PMUs are for XScale CPUs
In reply to Mark RutlandNow 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.
--- arch/arm/plat-iop/pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/plat-iop/pmu.c +1 -1
@@ -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
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.
Signed-off-by Mark Rutland <[email protected]>Cc Russell King <[email protected]>Cc Linus Walleij <[email protected]>Cc Olof Johansson <[email protected]>Cc Arnd Bergmann <[email protected]>
Yours,
Linus Walleij
PATCH 5/6 arm: shmobile: specify PMUs are for ARMv7 CPUs
In reply to Mark RutlandNow 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
--- 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
@@ -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
@@ -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
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
Signed-off-by Mark Rutland <[email protected]>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@@ -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@@ -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
PATCH 6/6 arm: omap: specify PMUs are for ARMv7 CPUs
In reply to Mark RutlandNow 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.
--- arch/arm/mach-omap2/pmu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/pmu.c +3 -2
@@ -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
Tony Lindgren
maintainerPATCH 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.his also removed.Signed-off-by Mark Rutland <[email protected]>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@@ -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