summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-08-11 16:35:24 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-14 14:18:31 -0400
commit36f02cf49729b32aa241cb9f1f235749da681dd1 (patch)
treeac2569ec2c828489a56aedcf9c85cadcbc0dee62 /drivers/gpu/nvgpu/gm20b/clk_gm20b.c
parent4412728b9606a2e2506961ed6e444a344af7ca29 (diff)
gpu: nvgpu: Add struct gk20a ptr to FUSE APIs
Add a pointer to struct gk20a to the FUSE APIs. This helps QNX builds avoid any static data definitions. Also this change plumbs struct gk20a in some of the Linux clk code and fixes a few minor style nits. Change-Id: I27dfb2c4e9a352f784d6cead150460d8e9e808d3 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1537611 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Richard Zhao <rizhao@nvidia.com> Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Sourab Gupta <sourabg@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/clk_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/clk_gm20b.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
index 22501c64..027d4fb6 100644
--- a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
@@ -258,12 +258,13 @@ static inline int fuse_get_gpcpll_adc_intercept_uv(u32 val)
258 return ((val >> 4) & 0x3ff) * 1000 + ((val >> 0) & 0xf) * 100; 258 return ((val >> 4) & 0x3ff) * 1000 + ((val >> 0) & 0xf) * 100;
259} 259}
260 260
261static int nvgpu_fuse_calib_gpcpll_get_adc(int *slope_uv, int *intercept_uv) 261static int nvgpu_fuse_calib_gpcpll_get_adc(struct gk20a *g,
262 int *slope_uv, int *intercept_uv)
262{ 263{
263 u32 val; 264 u32 val;
264 int ret; 265 int ret;
265 266
266 ret = nvgpu_tegra_fuse_read_reserved_calib(&val); 267 ret = nvgpu_tegra_fuse_read_reserved_calib(g, &val);
267 if (ret) 268 if (ret)
268 return ret; 269 return ret;
269 270
@@ -276,9 +277,9 @@ static int nvgpu_fuse_calib_gpcpll_get_adc(int *slope_uv, int *intercept_uv)
276} 277}
277 278
278#ifdef CONFIG_TEGRA_USE_NA_GPCPLL 279#ifdef CONFIG_TEGRA_USE_NA_GPCPLL
279static bool nvgpu_fuse_can_use_na_gpcpll(void) 280static bool nvgpu_fuse_can_use_na_gpcpll(struct gk20a *g)
280{ 281{
281 return nvgpu_tegra_get_gpu_speedo_id(); 282 return nvgpu_tegra_get_gpu_speedo_id(g);
282} 283}
283#endif 284#endif
284 285
@@ -291,7 +292,7 @@ static int clk_config_calibration_params(struct gk20a *g)
291 int slope, offs; 292 int slope, offs;
292 struct pll_parms *p = &gpc_pll_params; 293 struct pll_parms *p = &gpc_pll_params;
293 294
294 if (!nvgpu_fuse_calib_gpcpll_get_adc(&slope, &offs)) { 295 if (!nvgpu_fuse_calib_gpcpll_get_adc(g, &slope, &offs)) {
295 p->uvdet_slope = slope; 296 p->uvdet_slope = slope;
296 p->uvdet_offs = offs; 297 p->uvdet_offs = offs;
297 } 298 }
@@ -1186,7 +1187,7 @@ int gm20b_init_clk_setup_sw(struct gk20a *g)
1186 */ 1187 */
1187 clk_config_calibration_params(g); 1188 clk_config_calibration_params(g);
1188#ifdef CONFIG_TEGRA_USE_NA_GPCPLL 1189#ifdef CONFIG_TEGRA_USE_NA_GPCPLL
1189 if (nvgpu_fuse_can_use_na_gpcpll()) { 1190 if (nvgpu_fuse_can_use_na_gpcpll(g)) {
1190 /* NA mode is supported only at max update rate 38.4 MHz */ 1191 /* NA mode is supported only at max update rate 38.4 MHz */
1191 BUG_ON(clk->gpc_pll.clk_in != gpc_pll_params.max_u); 1192 BUG_ON(clk->gpc_pll.clk_in != gpc_pll_params.max_u);
1192 clk->gpc_pll.mode = GPC_PLL_MODE_DVFS; 1193 clk->gpc_pll.mode = GPC_PLL_MODE_DVFS;