summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/clk/clk_vf_point.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/clk/clk_vf_point.h')
-rw-r--r--drivers/gpu/nvgpu/clk/clk_vf_point.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_vf_point.h b/drivers/gpu/nvgpu/clk/clk_vf_point.h
new file mode 100644
index 00000000..15920066
--- /dev/null
+++ b/drivers/gpu/nvgpu/clk/clk_vf_point.h
@@ -0,0 +1,74 @@
1/*
2* Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
3*
4* This program is free software; you can redistribute it and/or modify it
5* under the terms and conditions of the GNU General Public License,
6* version 2, as published by the Free Software Foundation.
7*
8* This program is distributed in the hope it will be useful, but WITHOUT
9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11* more details.
12*/
13
14#ifndef _CLKVFPOINT_H_
15#define _CLKVFPOINT_H_
16#include "ctrl/ctrlclk.h"
17#include "ctrl/ctrlboardobj.h"
18#include "pmuif/gpmuifclk.h"
19#include "boardobj/boardobjgrp_e32.h"
20#include "boardobj/boardobjgrpmask.h"
21
22u32 clk_vf_point_sw_setup(struct gk20a *g);
23u32 clk_vf_point_pmu_setup(struct gk20a *g);
24u32 clk_vf_point_cache(struct gk20a *g);
25
26struct clk_vf_points {
27 struct boardobjgrp_e255 super;
28};
29
30struct clk_vf_point {
31 struct boardobj super;
32 u8 vfe_equ_idx;
33 u8 volt_rail_idx;
34 struct ctrl_clk_vf_pair pair;
35};
36
37struct clk_vf_point_volt {
38 struct clk_vf_point super;
39 u32 source_voltage_uv;
40 int freq_delta_khz;
41};
42
43struct clk_vf_point_freq {
44 struct clk_vf_point super;
45 int volt_delta_uv;
46};
47
48#define CLK_CLK_VF_POINT_GET(pclk, idx) \
49 ((struct clk_vf_point *)BOARDOBJGRP_OBJ_GET_BY_IDX( \
50 &pclk->clk_vf_pointobjs.super.super, (u8)(idx)))
51
52#define clkvfpointpairget(pvfpoint) \
53 (&((pvfpoint)->pair))
54
55#define clkvfpointfreqmhzget(pgpu, pvfpoint) \
56 CTRL_CLK_VF_PAIR_FREQ_MHZ_GET(clkvfpointpairget(pvfpoint))
57
58#define clkvfpointfreqdeltamhzGet(pgpu, pvfPoint) \
59 ((BOARDOBJ_GET_TYPE(pvfpoint) == CTRL_CLK_CLK_VF_POINT_TYPE_VOLT) ? \
60 (((struct clk_vf_point_volt *)(pvfpoint))->freq_delta_khz / 1000) : 0)
61
62#define clkvfpointfreqmhzset(pgpu, pvfpoint, _freqmhz) \
63 CTRL_CLK_VF_PAIR_FREQ_MHZ_SET(clkvfpointpairget(pvfpoint), _freqmhz)
64
65#define clkvfpointvoltageuvset(pgpu, pvfpoint, _voltageuv) \
66 CTRL_CLK_VF_PAIR_VOLTAGE_UV_SET(clkvfpointpairget(pvfpoint), \
67 _voltageuv)
68
69#define clkvfpointvoltageuvget(pgpu, pvfpoint) \
70 CTRL_CLK_VF_PAIR_VOLTAGE_UV_GET(clkvfpointpairget(pvfpoint)) \
71
72struct clk_vf_point *construct_clk_vf_point(struct gk20a *g, void *pargs);
73
74#endif