Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2010, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 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 | /* |
| 15 | *per-axi |
| 16 | *DESCRIPTION |
| 17 | *Header File for Functions related to AXI bus performance counter manipulations. |
| 18 | */ |
| 19 | |
| 20 | #ifndef __PER_AXI_H__ |
| 21 | #define __PER_AXI_H__ |
| 22 | unsigned long pm_get_axi_cycle_count(void); |
| 23 | unsigned long pm_get_axi_evt0_count(void); |
| 24 | unsigned long pm_get_axi_evt1_count(void); |
| 25 | unsigned long pm_get_axi_evt2_count(void); |
| 26 | unsigned long pm_get_axi_ten_min_count(void); |
| 27 | unsigned long pm_get_axi_ten_max_count(void); |
| 28 | unsigned long pm_get_axi_ten_total_count(void); |
| 29 | unsigned long pm_get_axi_ten_last_count(void); |
| 30 | |
| 31 | unsigned long get_axi_sel_reg0(void); |
| 32 | unsigned long get_axi_sel_seg1(void); |
| 33 | unsigned long get_axi_ten_sel_reg(void); |
| 34 | unsigned long get_axi_valid(void); |
| 35 | unsigned long get_axi_enable(void); |
| 36 | unsigned long get_axi_clear(void); |
| 37 | |
| 38 | void pm_axi_clear_cnts(void); |
| 39 | void pm_axi_update_cnts(void); |
| 40 | |
| 41 | void pm_axi_init(void); |
| 42 | void pm_axi_start(void); |
| 43 | void pm_axi_update(void); |
| 44 | void pm_axi_disable(void); |
| 45 | void pm_axi_enable(void); |
| 46 | |
| 47 | struct perf_mon_axi_cnts{ |
| 48 | unsigned long long cycles; |
| 49 | unsigned long long cnt0; |
| 50 | unsigned long long cnt1; |
| 51 | unsigned long long tenure_total; |
| 52 | unsigned long long tenure_min; |
| 53 | unsigned long long tenure_max; |
| 54 | unsigned long long tenure_last; |
| 55 | }; |
| 56 | |
| 57 | struct perf_mon_axi_data{ |
| 58 | struct proc_dir_entry *proc; |
| 59 | unsigned long enable; |
| 60 | unsigned long clear; |
| 61 | unsigned long valid; |
| 62 | unsigned long sel_reg0; |
| 63 | unsigned long sel_reg1; |
| 64 | unsigned long ten_sel_reg; |
| 65 | unsigned long refresh; |
| 66 | }; |
| 67 | |
| 68 | extern struct perf_mon_axi_data pm_axi_info; |
| 69 | extern struct perf_mon_axi_cnts axi_cnts; |
| 70 | |
| 71 | void pm_axi_set_proc_entry(char *name, unsigned long *var, |
| 72 | struct proc_dir_entry *d, int hex); |
| 73 | void pm_axi_get_cnt_proc_entry(char *name, struct perf_mon_axi_cnts *var, |
| 74 | struct proc_dir_entry *d, int hex); |
| 75 | |
| 76 | #endif |