Skip to content

Commit ee8e5d5

Browse files
Suzuki K. Poulosewildea01
authored andcommitted
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>
1 parent 772742a commit ee8e5d5

5 files changed

Lines changed: 53 additions & 12 deletions

File tree

‎arch/arm/mach-exynos/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ config SOC_EXYNOS5800
123123
config EXYNOS5420_MCPM
124124
bool "Exynos5420 Multi-Cluster PM support"
125125
depends on MCPM && SOC_EXYNOS5420
126-
select ARM_CCI
126+
select ARM_CCI400_PORT_CTRL
127127
select ARM_CPU_SUSPEND
128128
help
129129
This is needed to provide CPU and cluster power management

‎arch/arm/mach-vexpress/Kconfig‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ config ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA
5353
config ARCH_VEXPRESS_DCSCB
5454
bool "Dual Cluster System Control Block (DCSCB) support"
5555
depends on MCPM
56-
select ARM_CCI
56+
select ARM_CCI400_PORT_CTRL
5757
help
5858
Support for the Dual Cluster System Configuration Block (DCSCB).
5959
This is needed to provide CPU and cluster power management
@@ -71,7 +71,7 @@ config ARCH_VEXPRESS_SPC
7171
config ARCH_VEXPRESS_TC2_PM
7272
bool "Versatile Express TC2 power management"
7373
depends on MCPM
74-
select ARM_CCI
74+
select ARM_CCI400_PORT_CTRL
7575
select ARCH_VEXPRESS_SPC
7676
select ARM_CPU_SUSPEND
7777
help

‎drivers/bus/Kconfig‎

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,32 @@ config OMAP_INTERCONNECT
4343
help
4444
Driver to enable OMAP interconnect error handling driver.
4545

46-
config ARM_CCI
47-
bool "ARM CCI driver support"
46+
config ARM_CCI400_PORT_CTRL
47+
bool
4848
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+
54+
config 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
4960
help
50-
Driver supporting the CCI cache coherent interconnect for ARM
51-
platforms.
61+
Support for PMU events monitoring on the ARM CCI cache coherent
62+
interconnect.
63+
64+
If unsure, say Y
65+
66+
config ARM_CCI400_COMMON
67+
bool
68+
select ARM_CCI
69+
70+
config ARM_CCI
71+
bool
5272

5373
config ARM_CCN
5474
bool "ARM CCN driver support"

‎drivers/bus/arm-cci.c‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
static void __iomem *cci_ctrl_base;
3333
static unsigned long cci_ctrl_phys;
3434

35+
#ifdef CONFIG_ARM_CCI400_PORT_CTRL
3536
struct cci_nb_ports {
3637
unsigned int nb_ace;
3738
unsigned int nb_ace_lite;
@@ -42,12 +43,19 @@ static const struct cci_nb_ports cci400_ports = {
4243
.nb_ace_lite = 3
4344
};
4445

46+
#define CCI400_PORTS_DATA (&cci400_ports)
47+
#else
48+
#define CCI400_PORTS_DATA (NULL)
49+
#endif
50+
4551
static 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
4755
{},
4856
};
4957

50-
#ifdef CONFIG_HW_PERF_EVENTS
58+
#ifdef CONFIG_ARM_CCI400_PMU
5159

5260
#define DRIVER_NAME "CCI-400"
5361
#define DRIVER_NAME_PMU DRIVER_NAME " PMU"
@@ -1022,14 +1030,16 @@ static int __init cci_platform_init(void)
10221030
return platform_driver_register(&cci_platform_driver);
10231031
}
10241032

1025-
#else /* !CONFIG_HW_PERF_EVENTS */
1033+
#else /* !CONFIG_ARM_CCI400_PMU */
10261034

10271035
static int __init cci_platform_init(void)
10281036
{
10291037
return 0;
10301038
}
10311039

1032-
#endif /* CONFIG_HW_PERF_EVENTS */
1040+
#endif /* CONFIG_ARM_CCI400_PMU */
1041+
1042+
#ifdef CONFIG_ARM_CCI400_PORT_CTRL
10331043

10341044
#define CCI_PORT_CTRL 0x0
10351045
#define CCI_CTRL_STATUS 0xc
@@ -1460,6 +1470,12 @@ static int cci_probe_ports(struct device_node *np)
14601470

14611471
return 0;
14621472
}
1473+
#else /* !CONFIG_ARM_CCI400_PORT_CTRL */
1474+
static inline int cci_probe_ports(struct device_node *np)
1475+
{
1476+
return 0;
1477+
}
1478+
#endif /* CONFIG_ARM_CCI400_PORT_CTRL */
14631479

14641480
static int cci_probe(void)
14651481
{

‎include/linux/arm-cci.h‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,16 @@ struct device_node;
3030

3131
#ifdef CONFIG_ARM_CCI
3232
extern bool cci_probed(void);
33+
#else
34+
static inline bool cci_probed(void) { return false; }
35+
#endif
36+
37+
#ifdef CONFIG_ARM_CCI400_PORT_CTRL
3338
extern int cci_ace_get_port(struct device_node *dn);
3439
extern int cci_disable_port_by_cpu(u64 mpidr);
3540
extern int __cci_control_port_by_device(struct device_node *dn, bool enable);
3641
extern int __cci_control_port_by_index(u32 port, bool enable);
3742
#else
38-
static inline bool cci_probed(void) { return false; }
3943
static inline int cci_ace_get_port(struct device_node *dn)
4044
{
4145
return -ENODEV;
@@ -51,6 +55,7 @@ static inline int __cci_control_port_by_index(u32 port, bool enable)
5155
return -ENODEV;
5256
}
5357
#endif
58+
5459
#define cci_disable_port_by_device(dev) \
5560
__cci_control_port_by_device(dev, false)
5661
#define cci_enable_port_by_device(dev) \

0 commit comments

Comments
 (0)