diff options
author | Vijayakumar Subbu <vsubbu@nvidia.com> | 2016-07-30 13:44:30 -0400 |
---|---|---|
committer | Deepak Nibade <dnibade@nvidia.com> | 2016-12-27 04:56:49 -0500 |
commit | 432017248e432df0619dc2df30f915a52634338f (patch) | |
tree | 40bb7a77983fb2753271bc46b346a44ebd6121cf /drivers/gpu/nvgpu/clk/clk_prog.h | |
parent | 38ad90b4840434df4650c617a236e1b01f8a43c6 (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_prog.h')
-rw-r--r-- | drivers/gpu/nvgpu/clk/clk_prog.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_prog.h b/drivers/gpu/nvgpu/clk/clk_prog.h new file mode 100644 index 00000000..2dd8f6c8 --- /dev/null +++ b/drivers/gpu/nvgpu/clk/clk_prog.h | |||
@@ -0,0 +1,71 @@ | |||
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 _CLKPROG_H_ | ||
15 | #define _CLKPROG_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 | |||
22 | u32 clk_prog_sw_setup(struct gk20a *g); | ||
23 | u32 clk_prog_pmu_setup(struct gk20a *g); | ||
24 | struct clk_prog_1x_master; | ||
25 | |||
26 | typedef u32 vf_flatten(struct gk20a *g, struct clk_pmupstate *pclk, | ||
27 | struct clk_prog_1x_master *p1xmaster, | ||
28 | u8 clk_domain_idx, u16 *pfreqmaxlastmhz); | ||
29 | |||
30 | struct clk_progs { | ||
31 | struct boardobjgrp_e255 super; | ||
32 | u8 slave_entry_count; | ||
33 | u8 vf_entry_count; | ||
34 | |||
35 | }; | ||
36 | |||
37 | struct clk_prog { | ||
38 | struct boardobj super; | ||
39 | }; | ||
40 | |||
41 | struct clk_prog_1x { | ||
42 | struct clk_prog super; | ||
43 | u8 source; | ||
44 | u16 freq_max_mhz; | ||
45 | union ctrl_clk_clk_prog_1x_source_data source_data; | ||
46 | }; | ||
47 | |||
48 | struct clk_prog_1x_master { | ||
49 | struct clk_prog_1x super; | ||
50 | bool b_o_c_o_v_enabled; | ||
51 | struct ctrl_clk_clk_prog_1x_master_vf_entry *p_vf_entries; | ||
52 | |||
53 | struct ctrl_clk_clk_delta deltas; | ||
54 | vf_flatten *vfflatten; | ||
55 | }; | ||
56 | |||
57 | struct clk_prog_1x_master_ratio { | ||
58 | struct clk_prog_1x_master super; | ||
59 | struct ctrl_clk_clk_prog_1x_master_ratio_slave_entry *p_slave_entries; | ||
60 | }; | ||
61 | |||
62 | struct clk_prog_1x_master_table { | ||
63 | struct clk_prog_1x_master super; | ||
64 | struct ctrl_clk_clk_prog_1x_master_table_slave_entry *p_slave_entries; | ||
65 | }; | ||
66 | |||
67 | #define CLK_CLK_PROG_GET(pclk, idx) \ | ||
68 | ((struct clk_prog *)BOARDOBJGRP_OBJ_GET_BY_IDX( \ | ||
69 | &pclk->clk_progobjs.super.super, (u8)(idx))) | ||
70 | |||
71 | #endif | ||