diff options
Diffstat (limited to 'arch/mips/oprofile')
-rw-r--r-- | arch/mips/oprofile/Makefile | 1 | ||||
-rw-r--r-- | arch/mips/oprofile/common.c | 3 | ||||
-rw-r--r-- | arch/mips/oprofile/op_model_mipsxx.c | 32 |
3 files changed, 31 insertions, 5 deletions
diff --git a/arch/mips/oprofile/Makefile b/arch/mips/oprofile/Makefile index 0a50aad5bbe4..bf3be6fcf7ff 100644 --- a/arch/mips/oprofile/Makefile +++ b/arch/mips/oprofile/Makefile | |||
@@ -12,5 +12,6 @@ oprofile-y := $(DRIVER_OBJS) common.o | |||
12 | 12 | ||
13 | oprofile-$(CONFIG_CPU_MIPS32) += op_model_mipsxx.o | 13 | oprofile-$(CONFIG_CPU_MIPS32) += op_model_mipsxx.o |
14 | oprofile-$(CONFIG_CPU_MIPS64) += op_model_mipsxx.o | 14 | oprofile-$(CONFIG_CPU_MIPS64) += op_model_mipsxx.o |
15 | oprofile-$(CONFIG_CPU_R10000) += op_model_mipsxx.o | ||
15 | oprofile-$(CONFIG_CPU_SB1) += op_model_mipsxx.o | 16 | oprofile-$(CONFIG_CPU_SB1) += op_model_mipsxx.o |
16 | oprofile-$(CONFIG_CPU_RM9000) += op_model_rm9000.o | 17 | oprofile-$(CONFIG_CPU_RM9000) += op_model_rm9000.o |
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c index 65eb55400d77..4e0a90b3916b 100644 --- a/arch/mips/oprofile/common.c +++ b/arch/mips/oprofile/common.c | |||
@@ -83,6 +83,9 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
83 | case CPU_74K: | 83 | case CPU_74K: |
84 | case CPU_SB1: | 84 | case CPU_SB1: |
85 | case CPU_SB1A: | 85 | case CPU_SB1A: |
86 | case CPU_R10000: | ||
87 | case CPU_R12000: | ||
88 | case CPU_R14000: | ||
86 | lmodel = &op_model_mipsxx_ops; | 89 | lmodel = &op_model_mipsxx_ops; |
87 | break; | 90 | break; |
88 | 91 | ||
diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c index 1fb240c57bac..455d76ad06d8 100644 --- a/arch/mips/oprofile/op_model_mipsxx.c +++ b/arch/mips/oprofile/op_model_mipsxx.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #define M_PERFCTL_SUPERVISOR (1UL << 2) | 18 | #define M_PERFCTL_SUPERVISOR (1UL << 2) |
19 | #define M_PERFCTL_USER (1UL << 3) | 19 | #define M_PERFCTL_USER (1UL << 3) |
20 | #define M_PERFCTL_INTERRUPT_ENABLE (1UL << 4) | 20 | #define M_PERFCTL_INTERRUPT_ENABLE (1UL << 4) |
21 | #define M_PERFCTL_EVENT(event) ((event) << 5) | 21 | #define M_PERFCTL_EVENT(event) (((event) & 0x3f) << 5) |
22 | #define M_PERFCTL_VPEID(vpe) ((vpe) << 16) | 22 | #define M_PERFCTL_VPEID(vpe) ((vpe) << 16) |
23 | #define M_PERFCTL_MT_EN(filter) ((filter) << 20) | 23 | #define M_PERFCTL_MT_EN(filter) ((filter) << 20) |
24 | #define M_TC_EN_ALL M_PERFCTL_MT_EN(0) | 24 | #define M_TC_EN_ALL M_PERFCTL_MT_EN(0) |
@@ -218,13 +218,23 @@ static inline int __n_counters(void) | |||
218 | 218 | ||
219 | static inline int n_counters(void) | 219 | static inline int n_counters(void) |
220 | { | 220 | { |
221 | int counters = __n_counters(); | 221 | int counters; |
222 | |||
223 | switch (current_cpu_data.cputype) { | ||
224 | case CPU_R10000: | ||
225 | counters = 2; | ||
226 | |||
227 | case CPU_R12000: | ||
228 | case CPU_R14000: | ||
229 | counters = 4; | ||
230 | |||
231 | default: | ||
232 | counters = __n_counters(); | ||
233 | } | ||
222 | 234 | ||
223 | #ifdef CONFIG_MIPS_MT_SMP | 235 | #ifdef CONFIG_MIPS_MT_SMP |
224 | if (current_cpu_data.cputype == CPU_34K) | 236 | counters >> 1; |
225 | return counters >> 1; | ||
226 | #endif | 237 | #endif |
227 | |||
228 | return counters; | 238 | return counters; |
229 | } | 239 | } |
230 | 240 | ||
@@ -284,6 +294,18 @@ static int __init mipsxx_init(void) | |||
284 | op_model_mipsxx_ops.cpu_type = "mips/5K"; | 294 | op_model_mipsxx_ops.cpu_type = "mips/5K"; |
285 | break; | 295 | break; |
286 | 296 | ||
297 | case CPU_R10000: | ||
298 | if ((current_cpu_data.processor_id & 0xff) == 0x20) | ||
299 | op_model_mipsxx_ops.cpu_type = "mips/r10000-v2.x"; | ||
300 | else | ||
301 | op_model_mipsxx_ops.cpu_type = "mips/r10000"; | ||
302 | break; | ||
303 | |||
304 | case CPU_R12000: | ||
305 | case CPU_R14000: | ||
306 | op_model_mipsxx_ops.cpu_type = "mips/r12000"; | ||
307 | break; | ||
308 | |||
287 | case CPU_SB1: | 309 | case CPU_SB1: |
288 | case CPU_SB1A: | 310 | case CPU_SB1A: |
289 | op_model_mipsxx_ops.cpu_type = "mips/sb1"; | 311 | op_model_mipsxx_ops.cpu_type = "mips/sb1"; |