summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/perf/vfe_var.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/perf/vfe_var.h')
-rw-r--r--drivers/gpu/nvgpu/perf/vfe_var.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/perf/vfe_var.h b/drivers/gpu/nvgpu/perf/vfe_var.h
new file mode 100644
index 00000000..c443bc4b
--- /dev/null
+++ b/drivers/gpu/nvgpu/perf/vfe_var.h
@@ -0,0 +1,105 @@
1/*
2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef _VFE_VAR_H_
24#define _VFE_VAR_H_
25
26#include "boardobj/boardobjgrp.h"
27#include <nvgpu/pmuif/nvgpu_gpmu_cmdif.h>
28
29u32 vfe_var_sw_setup(struct gk20a *g);
30u32 vfe_var_pmu_setup(struct gk20a *g);
31
32#define VFE_VAR_GET(_pperf, _idx) \
33 ((struct vfe_var)BOARDOBJGRP_OBJ_GET_BY_IDX( \
34 &((_pperf)->vfe.vars.super.super), (_idx)))
35
36#define VFE_VAR_IDX_IS_VALID(_pperf, _idx) \
37 boardobjgrp_idxisvalid(&((_pperf)->vfe.vars.super.super), (_idx))
38
39struct vfe_var {
40 struct boardobj super;
41 u32 out_range_min;
42 u32 out_range_max;
43 bool b_is_dynamic_valid;
44 bool b_is_dynamic;
45};
46
47struct vfe_vars {
48 struct boardobjgrp_e32 super;
49 u8 polling_periodms;
50};
51
52struct vfe_var_derived {
53 struct vfe_var super;
54};
55
56struct vfe_var_derived_product {
57 struct vfe_var_derived super;
58 u8 var_idx0;
59 u8 var_idx1;
60};
61
62struct vfe_var_derived_sum {
63 struct vfe_var_derived super;
64 u8 var_idx0;
65 u8 var_idx1;
66};
67
68struct vfe_var_single {
69 struct vfe_var super;
70 u8 override_type;
71 u32 override_value;
72};
73
74struct vfe_var_single_frequency {
75 struct vfe_var_single super;
76};
77
78struct vfe_var_single_voltage {
79 struct vfe_var_single super;
80};
81
82struct vfe_var_single_sensed {
83 struct vfe_var_single super;
84};
85
86struct vfe_var_single_sensed_fuse {
87 struct vfe_var_single_sensed super;
88 struct nv_pmu_vfe_var_single_sensed_fuse_override_info override_info;
89 struct nv_pmu_vfe_var_single_sensed_fuse_vfield_info vfield_info;
90 struct nv_pmu_vfe_var_single_sensed_fuse_ver_vfield_info vfield_ver_info;
91 u32 fuse_value_integer;
92 u32 fuse_value_hw_integer;
93 u8 fuse_version;
94 bool b_version_check_done;
95};
96
97struct vfe_var_single_sensed_temp {
98 struct vfe_var_single_sensed super;
99 u8 therm_channel_index;
100 int temp_hysteresis_positive;
101 int temp_hysteresis_negative;
102 int temp_default;
103};
104
105#endif