per-axi.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* Copyright (c) 2010, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. /*
  14. *per-axi
  15. *DESCRIPTION
  16. *Header File for Functions related to AXI bus performance counter manipulations.
  17. */
  18. #ifndef __PER_AXI_H__
  19. #define __PER_AXI_H__
  20. unsigned long pm_get_axi_cycle_count(void);
  21. unsigned long pm_get_axi_evt0_count(void);
  22. unsigned long pm_get_axi_evt1_count(void);
  23. unsigned long pm_get_axi_evt2_count(void);
  24. unsigned long pm_get_axi_ten_min_count(void);
  25. unsigned long pm_get_axi_ten_max_count(void);
  26. unsigned long pm_get_axi_ten_total_count(void);
  27. unsigned long pm_get_axi_ten_last_count(void);
  28. unsigned long get_axi_sel_reg0(void);
  29. unsigned long get_axi_sel_seg1(void);
  30. unsigned long get_axi_ten_sel_reg(void);
  31. unsigned long get_axi_valid(void);
  32. unsigned long get_axi_enable(void);
  33. unsigned long get_axi_clear(void);
  34. void pm_axi_clear_cnts(void);
  35. void pm_axi_update_cnts(void);
  36. void pm_axi_init(void);
  37. void pm_axi_start(void);
  38. void pm_axi_update(void);
  39. void pm_axi_disable(void);
  40. void pm_axi_enable(void);
  41. struct perf_mon_axi_cnts{
  42. unsigned long long cycles;
  43. unsigned long long cnt0;
  44. unsigned long long cnt1;
  45. unsigned long long tenure_total;
  46. unsigned long long tenure_min;
  47. unsigned long long tenure_max;
  48. unsigned long long tenure_last;
  49. };
  50. struct perf_mon_axi_data{
  51. struct proc_dir_entry *proc;
  52. unsigned long enable;
  53. unsigned long clear;
  54. unsigned long valid;
  55. unsigned long sel_reg0;
  56. unsigned long sel_reg1;
  57. unsigned long ten_sel_reg;
  58. unsigned long refresh;
  59. };
  60. extern struct perf_mon_axi_data pm_axi_info;
  61. extern struct perf_mon_axi_cnts axi_cnts;
  62. void pm_axi_set_proc_entry(char *name, unsigned long *var,
  63. struct proc_dir_entry *d, int hex);
  64. void pm_axi_get_cnt_proc_entry(char *name, struct perf_mon_axi_cnts *var,
  65. struct proc_dir_entry *d, int hex);
  66. #endif