op_model_v6.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. /* #define DEBUG */
  19. #include <linux/types.h>
  20. #include <linux/errno.h>
  21. #include <linux/sched.h>
  22. #include <linux/oprofile.h>
  23. #include <linux/interrupt.h>
  24. #include <asm/irq.h>
  25. #include <asm/system.h>
  26. #include "op_counter.h"
  27. #include "op_arm_model.h"
  28. #include "op_model_arm11_core.h"
  29. static int irqs[] = {
  30. #ifdef CONFIG_ARCH_OMAP2
  31. 3,
  32. #endif
  33. };
  34. static void armv6_pmu_stop(void)
  35. {
  36. arm11_stop_pmu();
  37. arm11_release_interrupts(irqs, ARRAY_SIZE(irqs));
  38. }
  39. static int armv6_pmu_start(void)
  40. {
  41. int ret;
  42. ret = arm11_request_interrupts(irqs, ARRAY_SIZE(irqs));
  43. if (ret >= 0)
  44. ret = arm11_start_pmu();
  45. return ret;
  46. }
  47. static int armv6_detect_pmu(void)
  48. {
  49. return 0;
  50. }
  51. struct op_arm_model_spec op_armv6_spec = {
  52. .init = armv6_detect_pmu,
  53. .num_counters = 3,
  54. .setup_ctrs = arm11_setup_pmu,
  55. .start = armv6_pmu_start,
  56. .stop = armv6_pmu_stop,
  57. .name = "arm/armv6",
  58. };