blob: f7d2ec5ee9a1282be6f6089625b97906fbe9df0d [file] [log] [blame]
Russell King2d9e1ae2006-12-19 12:41:22 +00001/**
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
Leo Chen8c5b0f92009-10-15 22:45:41 +010036#ifdef CONFIG_ARCH_BCMRING
37 IRQ_PMUIRQ, /* for BCMRING, ARM PMU interrupt is 43 */
38#endif
Russell King2d9e1ae2006-12-19 12:41:22 +000039};
40
41static void armv6_pmu_stop(void)
42{
43 arm11_stop_pmu();
44 arm11_release_interrupts(irqs, ARRAY_SIZE(irqs));
45}
46
47static int armv6_pmu_start(void)
48{
49 int ret;
50
51 ret = arm11_request_interrupts(irqs, ARRAY_SIZE(irqs));
52 if (ret >= 0)
53 ret = arm11_start_pmu();
54
55 return ret;
56}
57
58static int armv6_detect_pmu(void)
59{
60 return 0;
61}
62
63struct op_arm_model_spec op_armv6_spec = {
64 .init = armv6_detect_pmu,
65 .num_counters = 3,
66 .setup_ctrs = arm11_setup_pmu,
67 .start = armv6_pmu_start,
68 .stop = armv6_pmu_stop,
69 .name = "arm/armv6",
70};