diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2017-06-01 04:02:09 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-06 14:04:57 -0400 |
commit | 26487b82df0c6604cc40fd6480f7ad7ed4e3efb0 (patch) | |
tree | 84a2180a0b6d964384e1ad6205f998338df74e9e /drivers/gpu/nvgpu/gm20b/clk_gm20b.h | |
parent | 9902a49b0bc43ceb64076bce78fe8189ccd24e17 (diff) |
gpu: nvgpu: move clk_gm20b debugfs to Linux module
Move debugfs code from clk_gm20b.c to file in Linux module
common/linux/debug_clk.c
This file will be compiled only if CONFIG_DEBUG_FS is set
Define below new HAL APIs for various clock operations
which can be accessed from debug file
init_debugfs()
get_voltage()
get_gpcclk_clock_counter()
pll_reg_write()
get_pll_debug_data()
Export nvgpu_pl_to_div() and nvgpu_div_to_pl() so
that these can be accessed from debug_clk.c
Add new structure nvgpu_clk_pll_debug_data so that
all required register values for debugging can be
made available in debug_clk.c
Add new API gm20b_get_gpc_pll_parms() so that statically
defined variable can be accessed in debug_clk.c too
Remove global variable dvfs_safe_max_freq and add
it to struct clk_gk20a so that it can accessed
from both clk_gm20b.c and debug_clk.c
Jira NVGPU-62
Change-Id: I3ae70b40235e78141a686686930e1f178ad59453
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1488903
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/clk_gm20b.h')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/clk_gm20b.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/clk_gm20b.h b/drivers/gpu/nvgpu/gm20b/clk_gm20b.h index f7912345..1e06d651 100644 --- a/drivers/gpu/nvgpu/gm20b/clk_gm20b.h +++ b/drivers/gpu/nvgpu/gm20b/clk_gm20b.h | |||
@@ -21,6 +21,35 @@ | |||
21 | 21 | ||
22 | #include <nvgpu/lock.h> | 22 | #include <nvgpu/lock.h> |
23 | 23 | ||
24 | struct nvgpu_clk_pll_debug_data { | ||
25 | u32 trim_sys_sel_vco_reg; | ||
26 | u32 trim_sys_sel_vco_val; | ||
27 | |||
28 | u32 trim_sys_gpc2clk_out_reg; | ||
29 | u32 trim_sys_gpc2clk_out_val; | ||
30 | |||
31 | u32 trim_sys_bypassctrl_reg; | ||
32 | u32 trim_sys_bypassctrl_val; | ||
33 | |||
34 | u32 trim_sys_gpcpll_cfg_reg; | ||
35 | u32 trim_sys_gpcpll_dvfs2_reg; | ||
36 | |||
37 | u32 trim_sys_gpcpll_cfg_val; | ||
38 | bool trim_sys_gpcpll_cfg_enabled; | ||
39 | bool trim_sys_gpcpll_cfg_locked; | ||
40 | bool trim_sys_gpcpll_cfg_sync_on; | ||
41 | |||
42 | u32 trim_sys_gpcpll_coeff_val; | ||
43 | u32 trim_sys_gpcpll_coeff_mdiv; | ||
44 | u32 trim_sys_gpcpll_coeff_ndiv; | ||
45 | u32 trim_sys_gpcpll_coeff_pldiv; | ||
46 | |||
47 | u32 trim_sys_gpcpll_dvfs0_val; | ||
48 | u32 trim_sys_gpcpll_dvfs0_dfs_coeff; | ||
49 | u32 trim_sys_gpcpll_dvfs0_dfs_det_max; | ||
50 | u32 trim_sys_gpcpll_dvfs0_dfs_dc_offset; | ||
51 | }; | ||
52 | |||
24 | void gm20b_init_clk_ops(struct gpu_ops *gops); | 53 | void gm20b_init_clk_ops(struct gpu_ops *gops); |
25 | 54 | ||
26 | int gm20b_init_clk_setup_sw(struct gk20a *g); | 55 | int gm20b_init_clk_setup_sw(struct gk20a *g); |
@@ -33,5 +62,20 @@ int gm20b_gpcclk_set_rate(struct clk_gk20a *clk, unsigned long rate, | |||
33 | unsigned long parent_rate); | 62 | unsigned long parent_rate); |
34 | long gm20b_round_rate(struct clk_gk20a *clk, unsigned long rate, | 63 | long gm20b_round_rate(struct clk_gk20a *clk, unsigned long rate, |
35 | unsigned long *parent_rate); | 64 | unsigned long *parent_rate); |
65 | struct pll_parms *gm20b_get_gpc_pll_parms(void); | ||
66 | #ifdef CONFIG_DEBUG_FS | ||
67 | int gm20b_clk_init_debugfs(struct gk20a *g); | ||
68 | #endif | ||
69 | |||
70 | /* 1:1 match between post divider settings and divisor value */ | ||
71 | static inline u32 nvgpu_pl_to_div(u32 pl) | ||
72 | { | ||
73 | return pl; | ||
74 | } | ||
75 | |||
76 | static inline u32 nvgpu_div_to_pl(u32 div) | ||
77 | { | ||
78 | return div; | ||
79 | } | ||
36 | 80 | ||
37 | #endif /* _NVHOST_CLK_GM20B_H_ */ | 81 | #endif /* _NVHOST_CLK_GM20B_H_ */ |