blob: 89f67fc5060f117c9a3cd08817254fc6a988f97b [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* Copyright (c) 2010, Code Aurora Forum. 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/*
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__
22unsigned long pm_get_axi_cycle_count(void);
23unsigned long pm_get_axi_evt0_count(void);
24unsigned long pm_get_axi_evt1_count(void);
25unsigned long pm_get_axi_evt2_count(void);
26unsigned long pm_get_axi_ten_min_count(void);
27unsigned long pm_get_axi_ten_max_count(void);
28unsigned long pm_get_axi_ten_total_count(void);
29unsigned long pm_get_axi_ten_last_count(void);
30
31unsigned long get_axi_sel_reg0(void);
32unsigned long get_axi_sel_seg1(void);
33unsigned long get_axi_ten_sel_reg(void);
34unsigned long get_axi_valid(void);
35unsigned long get_axi_enable(void);
36unsigned long get_axi_clear(void);
37
38void pm_axi_clear_cnts(void);
39void pm_axi_update_cnts(void);
40
41void pm_axi_init(void);
42void pm_axi_start(void);
43void pm_axi_update(void);
44void pm_axi_disable(void);
45void pm_axi_enable(void);
46
47struct 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
57struct 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
68extern struct perf_mon_axi_data pm_axi_info;
69extern struct perf_mon_axi_cnts axi_cnts;
70
71void pm_axi_set_proc_entry(char *name, unsigned long *var,
72 struct proc_dir_entry *d, int hex);
73void 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