summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
diff options
context:
space:
mode:
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;