summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/pstate
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/pstate
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/pstate')
-rw-r--r--drivers/gpu/nvgpu/pstate/pstate.c101
-rw-r--r--drivers/gpu/nvgpu/pstate/pstate.h19
2 files changed, 120 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/pstate/pstate.c b/drivers/gpu/nvgpu/pstate/pstate.c
new file mode 100644
index 00000000..83f17937
--- /dev/null
+++ b/drivers/gpu/nvgpu/pstate/pstate.c
@@ -0,0 +1,101 @@
1/*
2 * general p state infrastructure
3 *
4 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#include "gk20a/gk20a.h"
17#include "clk/clk.h"
18#include "perf/perf.h"
19
20/*sw setup for pstate components*/
21int gk20a_init_pstate_support(struct gk20a *g)
22{
23 u32 err;
24
25 gk20a_dbg_fn("");
26
27 err = clk_vin_sw_setup(g);
28 if (err)
29 return err;
30
31 err = clk_fll_sw_setup(g);
32 if (err)
33 return err;
34
35 err = vfe_var_sw_setup(g);
36 if (err)
37 return err;
38
39 err = vfe_equ_sw_setup(g);
40 if (err)
41 return err;
42
43 err = clk_domain_sw_setup(g);
44 if (err)
45 return err;
46
47 err = clk_vf_point_sw_setup(g);
48 if (err)
49 return err;
50
51 err = clk_prog_sw_setup(g);
52 return err;
53}
54
55/*sw setup for pstate components*/
56int gk20a_init_pstate_pmu_support(struct gk20a *g)
57{
58 u32 err;
59
60 gk20a_dbg_fn("");
61
62 err = vfe_var_pmu_setup(g);
63 if (err)
64 return err;
65
66 err = vfe_equ_pmu_setup(g);
67 if (err)
68 return err;
69
70 err = clk_domain_pmu_setup(g);
71 if (err)
72 return err;
73
74 err = clk_prog_pmu_setup(g);
75 if (err)
76 return err;
77
78 err = clk_vin_pmu_setup(g);
79 if (err)
80 return err;
81
82 err = clk_fll_pmu_setup(g);
83 if (err)
84 return err;
85
86 err = clk_vf_point_pmu_setup(g);
87 if (err)
88 return err;
89
90 err = clk_pmu_vin_load(g);
91 if (err)
92 return err;
93
94 err = perf_pmu_vfe_load(g);
95 if (err)
96 return err;
97
98 err = clk_pmu_vf_inject(g);
99 return err;
100}
101
diff --git a/drivers/gpu/nvgpu/pstate/pstate.h b/drivers/gpu/nvgpu/pstate/pstate.h
new file mode 100644
index 00000000..fb49adf3
--- /dev/null
+++ b/drivers/gpu/nvgpu/pstate/pstate.h
@@ -0,0 +1,19 @@
1/*
2 * general p state infrastructure
3 *
4 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#include "gk20a/gk20a.h"
17
18int gk20a_init_pstate_support(struct gk20a *g);
19int gk20a_init_pstate_pmu_support(struct gk20a *g);