aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2006-12-19 07:41:22 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-02-06 11:46:44 -0500
commit2d9e1ae06d8f0bb187ea083fabab2dfb6f589270 (patch)
tree645030f8d06f171535483c73a4bce9f64376e3c9 /arch/arm
parentc265a762aa196de11f38f6f44cc817329f32a813 (diff)
[ARM] oprofile: add ARM11 UP support
Add oprofile glue for ARM11 (ARMv6) oprofile support. This connects the ARM11 core profiling support to the oprofile code for uniprocessor configurations. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/oprofile/Kconfig10
-rw-r--r--arch/arm/oprofile/Makefile1
-rw-r--r--arch/arm/oprofile/common.c4
-rw-r--r--arch/arm/oprofile/op_arm_model.h2
-rw-r--r--arch/arm/oprofile/op_model_v6.c67
5 files changed, 84 insertions, 0 deletions
diff --git a/arch/arm/oprofile/Kconfig b/arch/arm/oprofile/Kconfig
index 615a6b9503a4..40cc1894b517 100644
--- a/arch/arm/oprofile/Kconfig
+++ b/arch/arm/oprofile/Kconfig
@@ -19,8 +19,18 @@ config OPROFILE
19 19
20 If unsure, say N. 20 If unsure, say N.
21 21
22if OPROFILE
23
24config OPROFILE_ARMV6
25 bool
26 depends on CPU_V6 && !SMP
27 default y
28 select OPROFILE_ARM11_CORE
29
22config OPROFILE_ARM11_CORE 30config OPROFILE_ARM11_CORE
23 bool 31 bool
24 32
33endif
34
25endmenu 35endmenu
26 36
diff --git a/arch/arm/oprofile/Makefile b/arch/arm/oprofile/Makefile
index 30352d6c4a25..3d5ff306db78 100644
--- a/arch/arm/oprofile/Makefile
+++ b/arch/arm/oprofile/Makefile
@@ -9,3 +9,4 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
9oprofile-y := $(DRIVER_OBJS) common.o backtrace.o 9oprofile-y := $(DRIVER_OBJS) common.o backtrace.o
10oprofile-$(CONFIG_CPU_XSCALE) += op_model_xscale.o 10oprofile-$(CONFIG_CPU_XSCALE) += op_model_xscale.o
11oprofile-$(CONFIG_OPROFILE_ARM11_CORE) += op_model_arm11_core.o 11oprofile-$(CONFIG_OPROFILE_ARM11_CORE) += op_model_arm11_core.o
12oprofile-$(CONFIG_OPROFILE_ARMV6) += op_model_v6.o
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 6f833358cd06..f1b24fbd8e67 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -135,6 +135,10 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
135 spec = &op_xscale_spec; 135 spec = &op_xscale_spec;
136#endif 136#endif
137 137
138#ifdef CONFIG_OPROFILE_ARMV6
139 spec = &op_armv6_spec;
140#endif
141
138 if (spec) { 142 if (spec) {
139 ret = spec->init(); 143 ret = spec->init();
140 if (ret < 0) 144 if (ret < 0)
diff --git a/arch/arm/oprofile/op_arm_model.h b/arch/arm/oprofile/op_arm_model.h
index 38c6ad158547..ad1c962ed17b 100644
--- a/arch/arm/oprofile/op_arm_model.h
+++ b/arch/arm/oprofile/op_arm_model.h
@@ -24,6 +24,8 @@ struct op_arm_model_spec {
24extern struct op_arm_model_spec op_xscale_spec; 24extern struct op_arm_model_spec op_xscale_spec;
25#endif 25#endif
26 26
27extern struct op_arm_model_spec op_armv6_spec;
28
27extern void arm_backtrace(struct pt_regs * const regs, unsigned int depth); 29extern void arm_backtrace(struct pt_regs * const regs, unsigned int depth);
28 30
29extern int __init op_arm_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec); 31extern int __init op_arm_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec);
diff --git a/arch/arm/oprofile/op_model_v6.c b/arch/arm/oprofile/op_model_v6.c
new file mode 100644
index 000000000000..fe581383d3e2
--- /dev/null
+++ b/arch/arm/oprofile/op_model_v6.c
@@ -0,0 +1,67 @@
1/**
2 * @file op_model_v6.c
3 * ARM11 Performance Monitor Driver
4 *
5 * Based on op_model_xscale.c
6 *
7 * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com>
8 * @remark Copyright 2000-2004 MontaVista Software Inc
9 * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com>
10 * @remark Copyright 2004 Intel Corporation
11 * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk>
12 * @remark Copyright 2004 OProfile Authors
13 *
14 * @remark Read the file COPYING
15 *
16 * @author Tony Lindgren <tony@atomide.com>
17 */
18
19/* #define DEBUG */
20#include <linux/types.h>
21#include <linux/errno.h>
22#include <linux/sched.h>
23#include <linux/oprofile.h>
24#include <linux/interrupt.h>
25#include <asm/irq.h>
26#include <asm/system.h>
27
28#include "op_counter.h"
29#include "op_arm_model.h"
30#include "op_model_arm11_core.h"
31
32static int irqs[] = {
33#ifdef CONFIG_ARCH_OMAP2
34 3,
35#endif
36};
37
38static void armv6_pmu_stop(void)
39{
40 arm11_stop_pmu();
41 arm11_release_interrupts(irqs, ARRAY_SIZE(irqs));
42}
43
44static int armv6_pmu_start(void)
45{
46 int ret;
47
48 ret = arm11_request_interrupts(irqs, ARRAY_SIZE(irqs));
49 if (ret >= 0)
50 ret = arm11_start_pmu();
51
52 return ret;
53}
54
55static int armv6_detect_pmu(void)
56{
57 return 0;
58}
59
60struct op_arm_model_spec op_armv6_spec = {
61 .init = armv6_detect_pmu,
62 .num_counters = 3,
63 .setup_ctrs = arm11_setup_pmu,
64 .start = armv6_pmu_start,
65 .stop = armv6_pmu_stop,
66 .name = "arm/armv6",
67};