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.h90
1 files changed, 90 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..60711b4c
--- /dev/null
+++ b/drivers/gpu/nvgpu/clk/clk_prog.h
@@ -0,0 +1,90 @@
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
30typedef u32 vf_lookup(struct gk20a *g, struct clk_pmupstate *pclk,
31 struct clk_prog_1x_master *p1xmaster,
32 u8 *slave_clk_domain_idx, u16 *pclkmhz,
33 u32 *pvoltuv, u8 rail);
34
35typedef int get_slaveclk(struct gk20a *g, struct clk_pmupstate *pclk,
36 struct clk_prog_1x_master *p1xmaster,
37 u8 slave_clk_domain_idx, u16 *pclkmhz,
38 u16 masterclkmhz);
39
40typedef u32 get_fpoints(struct gk20a *g, struct clk_pmupstate *pclk,
41 struct clk_prog_1x_master *p1xmaster,
42 u32 *pfpointscount,
43 u16 **ppfreqpointsinmhz, u8 rail);
44
45
46struct clk_progs {
47 struct boardobjgrp_e255 super;
48 u8 slave_entry_count;
49 u8 vf_entry_count;
50
51};
52
53struct clk_prog {
54 struct boardobj super;
55};
56
57struct clk_prog_1x {
58 struct clk_prog super;
59 u8 source;
60 u16 freq_max_mhz;
61 union ctrl_clk_clk_prog_1x_source_data source_data;
62};
63
64struct clk_prog_1x_master {
65 struct clk_prog_1x super;
66 bool b_o_c_o_v_enabled;
67 struct ctrl_clk_clk_prog_1x_master_vf_entry *p_vf_entries;
68 struct ctrl_clk_clk_delta deltas;
69 union ctrl_clk_clk_prog_1x_master_source_data source_data;
70 vf_flatten *vfflatten;
71 vf_lookup *vflookup;
72 get_fpoints *getfpoints;
73 get_slaveclk *getslaveclk;
74};
75
76struct clk_prog_1x_master_ratio {
77 struct clk_prog_1x_master super;
78 struct ctrl_clk_clk_prog_1x_master_ratio_slave_entry *p_slave_entries;
79};
80
81struct clk_prog_1x_master_table {
82 struct clk_prog_1x_master super;
83 struct ctrl_clk_clk_prog_1x_master_table_slave_entry *p_slave_entries;
84};
85
86#define CLK_CLK_PROG_GET(pclk, idx) \
87 ((struct clk_prog *)BOARDOBJGRP_OBJ_GET_BY_IDX( \
88 &pclk->clk_progobjs.super.super, (u8)(idx)))
89
90#endif