diff options
Diffstat (limited to 'drivers/gpu/nvgpu/clk/clk_fll.h')
-rw-r--r-- | drivers/gpu/nvgpu/clk/clk_fll.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_fll.h b/drivers/gpu/nvgpu/clk/clk_fll.h new file mode 100644 index 00000000..06872f48 --- /dev/null +++ b/drivers/gpu/nvgpu/clk/clk_fll.h | |||
@@ -0,0 +1,68 @@ | |||
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 _CLKFLL_H_ | ||
15 | #define _CLKFLL_H_ | ||
16 | |||
17 | #include "pmuif/gpmuifclk.h" | ||
18 | #include "boardobj/boardobjgrp_e32.h" | ||
19 | #include "boardobj/boardobjgrpmask.h" | ||
20 | |||
21 | /*data and function definition to talk to driver*/ | ||
22 | u32 clk_fll_sw_setup(struct gk20a *g); | ||
23 | u32 clk_fll_pmu_setup(struct gk20a *g); | ||
24 | |||
25 | struct avfsfllobjs { | ||
26 | struct boardobjgrp_e32 super; | ||
27 | struct boardobjgrpmask_e32 lut_prog_master_mask; | ||
28 | u32 lut_step_size_uv; | ||
29 | u32 lut_min_voltage_uv; | ||
30 | u8 lut_num_entries; | ||
31 | u16 max_min_freq_mhz; | ||
32 | }; | ||
33 | |||
34 | struct fll_device; | ||
35 | |||
36 | typedef u32 fll_lut_broadcast_slave_register(struct gk20a *g, | ||
37 | struct avfsfllobjs *pfllobjs, | ||
38 | struct fll_device *pfll, | ||
39 | struct fll_device *pfll_slave); | ||
40 | |||
41 | struct fll_device { | ||
42 | struct boardobj super; | ||
43 | u8 id; | ||
44 | u8 mdiv; | ||
45 | u16 input_freq_mhz; | ||
46 | u32 clk_domain; | ||
47 | u8 vin_idx_logic; | ||
48 | u8 vin_idx_sram; | ||
49 | u8 rail_idx_for_lut; | ||
50 | struct nv_pmu_clk_lut_device_desc lut_device; | ||
51 | struct nv_pmu_clk_regime_desc regime_desc; | ||
52 | u8 min_freq_vfe_idx; | ||
53 | u8 freq_ctrl_idx; | ||
54 | u8 target_regime_id_override; | ||
55 | struct boardobjgrpmask_e32 lut_prog_broadcast_slave_mask; | ||
56 | fll_lut_broadcast_slave_register *lut_broadcast_slave_register; | ||
57 | }; | ||
58 | |||
59 | #define CLK_FLL_LUT_VF_NUM_ENTRIES(pclk) \ | ||
60 | (pclk->avfs_fllobjs.lut_num_entries) | ||
61 | |||
62 | #define CLK_FLL_LUT_MIN_VOLTAGE_UV(pclk) \ | ||
63 | (pclk->avfs_fllobjs.lut_min_voltage_uv) | ||
64 | #define CLK_FLL_LUT_STEP_SIZE_UV(pclk) \ | ||
65 | (pclk->avfs_fllobjs.lut_step_size_uv) | ||
66 | |||
67 | #endif | ||
68 | |||