diff options
Diffstat (limited to 'drivers/gpu/nvgpu/clk/clk_domain.h')
-rw-r--r-- | drivers/gpu/nvgpu/clk/clk_domain.h | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_domain.h b/drivers/gpu/nvgpu/clk/clk_domain.h new file mode 100644 index 00000000..443e1c4c --- /dev/null +++ b/drivers/gpu/nvgpu/clk/clk_domain.h | |||
@@ -0,0 +1,116 @@ | |||
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 _CLKDOMAIN_H_ | ||
15 | #define _CLKDOMAIN_H_ | ||
16 | |||
17 | #include "ctrl/ctrlclk.h" | ||
18 | #include "ctrl/ctrlboardobj.h" | ||
19 | #include "pmuif/gpmuifclk.h" | ||
20 | #include "boardobj/boardobjgrp_e32.h" | ||
21 | #include "boardobj/boardobjgrpmask.h" | ||
22 | |||
23 | struct clk_domains; | ||
24 | struct clk_domain; | ||
25 | |||
26 | /*data and function definition to talk to driver*/ | ||
27 | u32 clk_domain_sw_setup(struct gk20a *g); | ||
28 | u32 clk_domain_pmu_setup(struct gk20a *g); | ||
29 | |||
30 | typedef u32 clkproglink(struct gk20a *g, struct clk_pmupstate *pclk, | ||
31 | struct clk_domain *pdomain); | ||
32 | |||
33 | typedef int clkvfsearch(struct gk20a *g, struct clk_pmupstate *pclk, | ||
34 | struct clk_domain *pdomain, u16 *clkmhz, | ||
35 | u32 *voltuv, u8 rail); | ||
36 | |||
37 | typedef int clkgetslaveclk(struct gk20a *g, struct clk_pmupstate *pclk, | ||
38 | struct clk_domain *pdomain, u16 *clkmhz, | ||
39 | u16 masterclkmhz); | ||
40 | |||
41 | typedef u32 clkgetfpoints(struct gk20a *g, struct clk_pmupstate *pclk, | ||
42 | struct clk_domain *pdomain, u32 *pfpointscount, | ||
43 | u16 *pfreqpointsinmhz, u8 rail); | ||
44 | |||
45 | struct clk_domains { | ||
46 | struct boardobjgrp_e32 super; | ||
47 | u8 n_num_entries; | ||
48 | u8 version; | ||
49 | bool b_enforce_vf_monotonicity; | ||
50 | bool b_enforce_vf_smoothening; | ||
51 | u32 vbios_domains; | ||
52 | struct boardobjgrpmask_e32 prog_domains_mask; | ||
53 | struct boardobjgrpmask_e32 master_domains_mask; | ||
54 | u16 cntr_sampling_periodms; | ||
55 | struct ctrl_clk_clk_delta deltas; | ||
56 | |||
57 | struct clk_domain *ordered_noise_aware_list[CTRL_BOARDOBJ_MAX_BOARD_OBJECTS]; | ||
58 | |||
59 | struct clk_domain *ordered_noise_unaware_list[CTRL_BOARDOBJ_MAX_BOARD_OBJECTS]; | ||
60 | }; | ||
61 | |||
62 | struct clk_domain { | ||
63 | struct boardobj super; | ||
64 | u32 api_domain; | ||
65 | u32 part_mask; | ||
66 | u8 domain; | ||
67 | u8 perf_domain_index; | ||
68 | u8 perf_domain_grp_idx; | ||
69 | u8 ratio_domain; | ||
70 | u8 usage; | ||
71 | clkproglink *clkdomainclkproglink; | ||
72 | clkvfsearch *clkdomainclkvfsearch; | ||
73 | clkgetfpoints *clkdomainclkgetfpoints; | ||
74 | }; | ||
75 | |||
76 | struct clk_domain_3x { | ||
77 | struct clk_domain super; | ||
78 | bool b_noise_aware_capable; | ||
79 | }; | ||
80 | |||
81 | struct clk_domain_3x_fixed { | ||
82 | struct clk_domain_3x super; | ||
83 | u16 freq_mhz; | ||
84 | }; | ||
85 | |||
86 | struct clk_domain_3x_prog { | ||
87 | struct clk_domain_3x super; | ||
88 | u8 clk_prog_idx_first; | ||
89 | u8 clk_prog_idx_last; | ||
90 | u8 noise_unaware_ordering_index; | ||
91 | u8 noise_aware_ordering_index; | ||
92 | bool b_force_noise_unaware_ordering; | ||
93 | int factory_offset_khz; | ||
94 | short freq_delta_min_mhz; | ||
95 | short freq_delta_max_mhz; | ||
96 | struct ctrl_clk_clk_delta deltas; | ||
97 | }; | ||
98 | |||
99 | struct clk_domain_3x_master { | ||
100 | struct clk_domain_3x_prog super; | ||
101 | u32 slave_idxs_mask; | ||
102 | }; | ||
103 | |||
104 | struct clk_domain_3x_slave { | ||
105 | struct clk_domain_3x_prog super; | ||
106 | u8 master_idx; | ||
107 | clkgetslaveclk *clkdomainclkgetslaveclk; | ||
108 | }; | ||
109 | |||
110 | u32 clk_domain_clk_prog_link(struct gk20a *g, struct clk_pmupstate *pclk); | ||
111 | |||
112 | #define CLK_CLK_DOMAIN_GET(pclk, idx) \ | ||
113 | ((struct clk_domain *)BOARDOBJGRP_OBJ_GET_BY_IDX( \ | ||
114 | &pclk->clk_domainobjs.super.super, (u8)(idx))) | ||
115 | |||
116 | #endif | ||