aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuzuki K. Poulose <suzuki.poulose@arm.com>2015-03-18 08:24:41 -0400
committerWill Deacon <will.deacon@arm.com>2015-03-27 09:44:43 -0400
commitee8e5d5fbec0e880b18bbdbfe12de53ab1dec21f (patch)
treebfcbad4817089a5b7b2f2d35b61a3b612ce3758e
parent772742a6c7ea4612fe043353531e6435ed33e719 (diff)
arm-cci: Split the code for PMU vs driver support
This patch separates the PMU driver code from the low level CCI driver code and enables the PMU driver for ARM64. Introduces config options for both. ARM_CCI400_PORT_CTRL - controls the low level driver code for CCI400 ports. ARM_CCI400_PMU - controls the PMU driver code ARM_CCI400_COMMON - Common defintions for CCI400 This patch also changes: ARM_CCI - common code for probing the CCI devices. This can be used for adding support for newer CCI versions(e.g, CCI-500). Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Kukjin Kim <kgene@kernel.org> Cc: Abhilash Kesavan <a.kesavan@samsung.com> Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Sudeep Holla <sudeep.holla@arm.com> Cc: Nicolas Pitre <nicolas.pitre@linaro.org> Cc: Punit Agrawal <punit.agrawal@arm.com> Acked-by: Sudeep Holla <sudeep.holla@arm.com> Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org> Acked-by: Punit Agrawal <punit.agrawal@arm.com> Signed-off-by: Suzuki K. Poulose <suzuki.poulose@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--arch/arm/mach-exynos/Kconfig2
-rw-r--r--arch/arm/mach-vexpress/Kconfig4
-rw-r--r--drivers/bus/Kconfig28
-rw-r--r--drivers/bus/arm-cci.c24
-rw-r--r--include/linux/arm-cci.h7
5 files changed, 53 insertions, 12 deletions
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 603820e5aba7..81064cd61a0a 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -123,7 +123,7 @@ config SOC_EXYNOS5800
123config EXYNOS5420_MCPM 123config EXYNOS5420_MCPM
124 bool "Exynos5420 Multi-Cluster PM support" 124 bool "Exynos5420 Multi-Cluster PM support"
125 depends on MCPM && SOC_EXYNOS5420 125 depends on MCPM && SOC_EXYNOS5420
126 select ARM_CCI 126 select ARM_CCI400_PORT_CTRL
127 select ARM_CPU_SUSPEND 127 select ARM_CPU_SUSPEND
128 help 128 help
129 This is needed to provide CPU and cluster power management 129 This is needed to provide CPU and cluster power management
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 3c2509b4b694..daa7ab6cb909 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -53,7 +53,7 @@ config ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA
53config ARCH_VEXPRESS_DCSCB 53config ARCH_VEXPRESS_DCSCB
54 bool "Dual Cluster System Control Block (DCSCB) support" 54 bool "Dual Cluster System Control Block (DCSCB) support"
55 depends on MCPM 55 depends on MCPM
56 select ARM_CCI 56 select ARM_CCI400_PORT_CTRL
57 help 57 help
58 Support for the Dual Cluster System Configuration Block (DCSCB). 58 Support for the Dual Cluster System Configuration Block (DCSCB).
59 This is needed to provide CPU and cluster power management 59 This is needed to provide CPU and cluster power management
@@ -71,7 +71,7 @@ config ARCH_VEXPRESS_SPC
71config ARCH_VEXPRESS_TC2_PM 71config ARCH_VEXPRESS_TC2_PM
72 bool "Versatile Express TC2 power management" 72 bool "Versatile Express TC2 power management"
73 depends on MCPM 73 depends on MCPM
74 select ARM_CCI 74 select ARM_CCI400_PORT_CTRL
75 select ARCH_VEXPRESS_SPC 75 select ARCH_VEXPRESS_SPC
76 select ARM_CPU_SUSPEND 76 select ARM_CPU_SUSPEND
77 help 77 help
diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index b99729e36860..79e297b1f221 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -43,12 +43,32 @@ config OMAP_INTERCONNECT
43 help 43 help
44 Driver to enable OMAP interconnect error handling driver. 44 Driver to enable OMAP interconnect error handling driver.
45 45
46config ARM_CCI 46config ARM_CCI400_PORT_CTRL
47 bool "ARM CCI driver support" 47 bool
48 depends on ARM && OF && CPU_V7 48 depends on ARM && OF && CPU_V7
49 select ARM_CCI400_COMMON
50 help
51 Low level power management driver for CCI400 cache coherent
52 interconnect for ARM platforms.
53
54config ARM_CCI400_PMU
55 bool "ARM CCI400 PMU support"
56 default y
57 depends on ARM || ARM64
58 depends on HW_PERF_EVENTS
59 select ARM_CCI400_COMMON
49 help 60 help
50 Driver supporting the CCI cache coherent interconnect for ARM 61 Support for PMU events monitoring on the ARM CCI cache coherent
51 platforms. 62 interconnect.
63
64 If unsure, say Y
65
66config ARM_CCI400_COMMON
67 bool
68 select ARM_CCI
69
70config ARM_CCI
71 bool
52 72
53config ARM_CCN 73config ARM_CCN
54 bool "ARM CCN driver support" 74 bool "ARM CCN driver support"
diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
index a23663c7a306..054df84562c2 100644
--- a/drivers/bus/arm-cci.c
+++ b/drivers/bus/arm-cci.c
@@ -32,6 +32,7 @@
32static void __iomem *cci_ctrl_base; 32static void __iomem *cci_ctrl_base;
33static unsigned long cci_ctrl_phys; 33static unsigned long cci_ctrl_phys;
34 34
35#ifdef CONFIG_ARM_CCI400_PORT_CTRL
35struct cci_nb_ports { 36struct cci_nb_ports {
36 unsigned int nb_ace; 37 unsigned int nb_ace;
37 unsigned int nb_ace_lite; 38 unsigned int nb_ace_lite;
@@ -42,12 +43,19 @@ static const struct cci_nb_ports cci400_ports = {
42 .nb_ace_lite = 3 43 .nb_ace_lite = 3
43}; 44};
44 45
46#define CCI400_PORTS_DATA (&cci400_ports)
47#else
48#define CCI400_PORTS_DATA (NULL)
49#endif
50
45static const struct of_device_id arm_cci_matches[] = { 51static const struct of_device_id arm_cci_matches[] = {
46 {.compatible = "arm,cci-400", .data = &cci400_ports }, 52#ifdef CONFIG_ARM_CCI400_COMMON
53 {.compatible = "arm,cci-400", .data = CCI400_PORTS_DATA },
54#endif
47 {}, 55 {},
48}; 56};
49 57
50#ifdef CONFIG_HW_PERF_EVENTS 58#ifdef CONFIG_ARM_CCI400_PMU
51 59
52#define DRIVER_NAME "CCI-400" 60#define DRIVER_NAME "CCI-400"
53#define DRIVER_NAME_PMU DRIVER_NAME " PMU" 61#define DRIVER_NAME_PMU DRIVER_NAME " PMU"
@@ -1022,14 +1030,16 @@ static int __init cci_platform_init(void)
1022 return platform_driver_register(&cci_platform_driver); 1030 return platform_driver_register(&cci_platform_driver);
1023} 1031}
1024 1032
1025#else /* !CONFIG_HW_PERF_EVENTS */ 1033#else /* !CONFIG_ARM_CCI400_PMU */
1026 1034
1027static int __init cci_platform_init(void) 1035static int __init cci_platform_init(void)
1028{ 1036{
1029 return 0; 1037 return 0;
1030} 1038}
1031 1039
1032#endif /* CONFIG_HW_PERF_EVENTS */ 1040#endif /* CONFIG_ARM_CCI400_PMU */
1041
1042#ifdef CONFIG_ARM_CCI400_PORT_CTRL
1033 1043
1034#define CCI_PORT_CTRL 0x0 1044#define CCI_PORT_CTRL 0x0
1035#define CCI_CTRL_STATUS 0xc 1045#define CCI_CTRL_STATUS 0xc
@@ -1460,6 +1470,12 @@ static int cci_probe_ports(struct device_node *np)
1460 1470
1461 return 0; 1471 return 0;
1462} 1472}
1473#else /* !CONFIG_ARM_CCI400_PORT_CTRL */
1474static inline int cci_probe_ports(struct device_node *np)
1475{
1476 return 0;
1477}
1478#endif /* CONFIG_ARM_CCI400_PORT_CTRL */
1463 1479
1464static int cci_probe(void) 1480static int cci_probe(void)
1465{ 1481{
diff --git a/include/linux/arm-cci.h b/include/linux/arm-cci.h
index aede5c765eec..521ec1f2e6bc 100644
--- a/include/linux/arm-cci.h
+++ b/include/linux/arm-cci.h
@@ -30,12 +30,16 @@ struct device_node;
30 30
31#ifdef CONFIG_ARM_CCI 31#ifdef CONFIG_ARM_CCI
32extern bool cci_probed(void); 32extern bool cci_probed(void);
33#else
34static inline bool cci_probed(void) { return false; }
35#endif
36
37#ifdef CONFIG_ARM_CCI400_PORT_CTRL
33extern int cci_ace_get_port(struct device_node *dn); 38extern int cci_ace_get_port(struct device_node *dn);
34extern int cci_disable_port_by_cpu(u64 mpidr); 39extern int cci_disable_port_by_cpu(u64 mpidr);
35extern int __cci_control_port_by_device(struct device_node *dn, bool enable); 40extern int __cci_control_port_by_device(struct device_node *dn, bool enable);
36extern int __cci_control_port_by_index(u32 port, bool enable); 41extern int __cci_control_port_by_index(u32 port, bool enable);
37#else 42#else
38static inline bool cci_probed(void) { return false; }
39static inline int cci_ace_get_port(struct device_node *dn) 43static inline int cci_ace_get_port(struct device_node *dn)
40{ 44{
41 return -ENODEV; 45 return -ENODEV;
@@ -51,6 +55,7 @@ static inline int __cci_control_port_by_index(u32 port, bool enable)
51 return -ENODEV; 55 return -ENODEV;
52} 56}
53#endif 57#endif
58
54#define cci_disable_port_by_device(dev) \ 59#define cci_disable_port_by_device(dev) \
55 __cci_control_port_by_device(dev, false) 60 __cci_control_port_by_device(dev, false)
56#define cci_enable_port_by_device(dev) \ 61#define cci_enable_port_by_device(dev) \