summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/clk/clk_prog.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/clk/clk_prog.h')
-rw-r--r--drivers/gpu/nvgpu/clk/clk_prog.h71
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
22u32 clk_prog_sw_setup(struct gk20a *g);
23u32 clk_prog_pmu_setup(struct gk20a *g);
24struct clk_prog_1x_master;
25
26typedef 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
30struct clk_progs {
31 struct boardobjgrp_e255 super;
32 u8 slave_entry_count;
33 u8 vf_entry_count;
34
35};
36
37struct clk_prog {
38 struct boardobj super;
39};
40
41struct 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
48struct 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
57struct 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
62struct 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