summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/clk/clk_vf_point.h
diff options
context:
space:
mode:
authorVijayakumar Subbu <vsubbu@nvidia.com>2016-07-30 13:44:30 -0400
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:56:49 -0500
commit432017248e432df0619dc2df30f915a52634338f (patch)
tree40bb7a77983fb2753271bc46b346a44ebd6121cf /drivers/gpu/nvgpu/clk/clk_vf_point.h
parent38ad90b4840434df4650c617a236e1b01f8a43c6 (diff)
gpu: nvgpu: Add dGPU clocks support
JIRA DNVGPU-42 Change-Id: Ic2fca9d0cf82f2823654ac5e8f0772a1eec7b3b5 Signed-off-by: Vijayakumar Subbu <vsubbu@nvidia.com> Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1205850 (cherry picked from commit b9f5c6bc4e649162d63e33d65b725872340ca114) Reviewed-on: http://git-master/r/1227257 GVS: Gerrit_Virtual_Submit
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..708f80f1
--- /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);
24
25struct clk_vf_points {
26 struct boardobjgrp_e255 super;
27};
28
29struct clk_vf_point {
30 struct boardobj super;
31 u8 vfe_equ_idx;
32 u8 volt_rail_idx;
33 struct ctrl_clk_vf_pair pair;
34};
35
36struct clk_vf_point_volt {
37 struct clk_vf_point super;
38 u32 source_voltage_uv;
39 u8 vf_gain_vfe_equ_idx;
40 u8 clk_domain_idx;
41 u16 vf_gain_value;
42 int freq_delta_khz;
43
44};
45
46struct clk_vf_point_freq {
47 struct clk_vf_point super;
48 int volt_delta_uv;
49};
50
51#define CLK_CLK_VF_POINT_GET(pclk, idx) \
52 ((struct clk_vf_point)BOARDOBJGRP_OBJ_GET_BY_IDX( \
53 &pclk->vfpoints.super.super, (u8)(idx)))
54
55#define clkvfpointpairget(pvfpoint) \
56 (&((pvfpoint)->pair))
57
58#define clkvfpointfreqmhzget(pgpu, pvfpoint) \
59 CTRL_CLK_VF_PAIR_FREQ_MHZ_GET(clkvfpointpairget(pvfpoint))
60
61#define clkvfpointfreqdeltamhzGet(pgpu, pvfPoint) \
62 ((BOARDOBJ_GET_TYPE(pvfpoint) == CTRL_CLK_CLK_VF_POINT_TYPE_VOLT) ? \
63 (((struct clk_vf_point_volt *)(pvfpoint))->freq_delta_khz / 1000) : 0)
64
65#define clkvfpointfreqmhzset(pgpu, pvfpoint, _freqmhz) \
66 CTRL_CLK_VF_PAIR_FREQ_MHZ_SET(clkvfpointpairget(pvfpoint), _freqmhz)
67
68#define clkvfpointvoltageuvset(pgpu, pvfpoint, _voltageuv) \
69 CTRL_CLK_VF_PAIR_VOLTAGE_UV_SET(clkvfpointpairget(pvfpoint), \
70 _voltageuv)
71
72struct clk_vf_point *construct_clk_vf_point(struct gk20a *g, void *pargs);
73
74#endif