aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2016-09-02 05:35:18 -0400
committerRussell King <rmk+kernel@armlinux.org.uk>2016-09-06 10:51:09 -0400
commitb828f960215f02e5d2c88bbd27565c694254a15a (patch)
tree7932c62969fc7ce5eaec0aec99b23b89d49a0829 /arch/arm/include
parent8e02676ffa6906a97de7f90772e9cdcb75ea6743 (diff)
ARM: 8611/1: l2x0: add PMU support
The L2C-220 (AKA L220) and L2C-310 (AKA PL310) cache controllers feature a Performance Monitoring Unit (PMU), which can be useful for tuning and/or debugging. This hardware is always present and the relevant registers are accessible to non-secure accesses. Thus, no special firmware interface is necessary. This patch adds support for the PMU, plugging into the usual perf infrastructure. The overflow interrupt is not always available (e.g. on RealView PBX A9 it is not wired up at all), and the hardware counters saturate, so the driver does not make use of this. Instead, the driver periodically polls and reset counters as required to avoid losing events due to saturation. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Acked-by: Pawel Moll <pawel.moll@arm.com> Tested-by: Kim Phillips <kim.phillips@arm.com> Cc: Russell King <linux@armlinux.org.uk> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/hardware/cache-l2x0.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h
index 3a5ec1c25659..736292b42fca 100644
--- a/arch/arm/include/asm/hardware/cache-l2x0.h
+++ b/arch/arm/include/asm/hardware/cache-l2x0.h
@@ -87,6 +87,15 @@
87#define L310_CACHE_ID_RTL_R3P2 0x08 87#define L310_CACHE_ID_RTL_R3P2 0x08
88#define L310_CACHE_ID_RTL_R3P3 0x09 88#define L310_CACHE_ID_RTL_R3P3 0x09
89 89
90#define L2X0_EVENT_CNT_CTRL_ENABLE BIT(0)
91
92#define L2X0_EVENT_CNT_CFG_SRC_SHIFT 2
93#define L2X0_EVENT_CNT_CFG_SRC_MASK 0xf
94#define L2X0_EVENT_CNT_CFG_SRC_DISABLED 0
95#define L2X0_EVENT_CNT_CFG_INT_DISABLED 0
96#define L2X0_EVENT_CNT_CFG_INT_INCR 1
97#define L2X0_EVENT_CNT_CFG_INT_OVERFLOW 2
98
90/* L2C auxiliary control register - bits common to L2C-210/220/310 */ 99/* L2C auxiliary control register - bits common to L2C-210/220/310 */
91#define L2C_AUX_CTRL_WAY_SIZE_SHIFT 17 100#define L2C_AUX_CTRL_WAY_SIZE_SHIFT 17
92#define L2C_AUX_CTRL_WAY_SIZE_MASK (7 << 17) 101#define L2C_AUX_CTRL_WAY_SIZE_MASK (7 << 17)
@@ -157,6 +166,16 @@ static inline int l2x0_of_init(u32 aux_val, u32 aux_mask)
157} 166}
158#endif 167#endif
159 168
169#ifdef CONFIG_CACHE_L2X0_PMU
170void l2x0_pmu_register(void __iomem *base, u32 part);
171void l2x0_pmu_suspend(void);
172void l2x0_pmu_resume(void);
173#else
174static inline void l2x0_pmu_register(void __iomem *base, u32 part) {}
175static inline void l2x0_pmu_suspend(void) {}
176static inline void l2x0_pmu_resume(void) {}
177#endif
178
160struct l2x0_regs { 179struct l2x0_regs {
161 unsigned long phy_base; 180 unsigned long phy_base;
162 unsigned long aux_ctrl; 181 unsigned long aux_ctrl;