diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/clk_gm20b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/clk_gm20b.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c index e4e51220..561a0427 100644 --- a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c | |||
@@ -368,7 +368,9 @@ pll_locked: | |||
368 | static int clk_program_gpc_pll(struct gk20a *g, struct clk_gk20a *clk, | 368 | static int clk_program_gpc_pll(struct gk20a *g, struct clk_gk20a *clk, |
369 | int allow_slide) | 369 | int allow_slide) |
370 | { | 370 | { |
371 | #if !PLDIV_GLITCHLESS | 371 | #if PLDIV_GLITCHLESS |
372 | bool skip_bypass; | ||
373 | #else | ||
372 | u32 data; | 374 | u32 data; |
373 | #endif | 375 | #endif |
374 | u32 cfg, coeff; | 376 | u32 cfg, coeff; |
@@ -406,8 +408,9 @@ static int clk_program_gpc_pll(struct gk20a *g, struct clk_gk20a *clk, | |||
406 | * Limit either FO-to-FO (path A below) or FO-to-bypass (path B below) | 408 | * Limit either FO-to-FO (path A below) or FO-to-bypass (path B below) |
407 | * jump to min_vco/2 by setting post divider >= 1:2. | 409 | * jump to min_vco/2 by setting post divider >= 1:2. |
408 | */ | 410 | */ |
411 | skip_bypass = can_slide && (clk->gpc_pll.M == m); | ||
409 | coeff = gk20a_readl(g, trim_sys_gpcpll_coeff_r()); | 412 | coeff = gk20a_readl(g, trim_sys_gpcpll_coeff_r()); |
410 | if ((clk->gpc_pll.PL < 2) || (pl < 2)) { | 413 | if ((skip_bypass && (clk->gpc_pll.PL < 2)) || (pl < 2)) { |
411 | if (pl != 2) { | 414 | if (pl != 2) { |
412 | coeff = set_field(coeff, | 415 | coeff = set_field(coeff, |
413 | trim_sys_gpcpll_coeff_pldiv_m(), | 416 | trim_sys_gpcpll_coeff_pldiv_m(), |
@@ -418,7 +421,7 @@ static int clk_program_gpc_pll(struct gk20a *g, struct clk_gk20a *clk, | |||
418 | } | 421 | } |
419 | } | 422 | } |
420 | 423 | ||
421 | if (can_slide && (clk->gpc_pll.M == m)) | 424 | if (skip_bypass) |
422 | goto set_pldiv; /* path A: no need to bypass */ | 425 | goto set_pldiv; /* path A: no need to bypass */ |
423 | 426 | ||
424 | /* path B: bypass if either M changes or PLL is disabled */ | 427 | /* path B: bypass if either M changes or PLL is disabled */ |
@@ -442,7 +445,7 @@ static int clk_program_gpc_pll(struct gk20a *g, struct clk_gk20a *clk, | |||
442 | nlo = DIV_ROUND_UP(m * gpc_pll_params.min_vco, clk->gpc_pll.clk_in); | 445 | nlo = DIV_ROUND_UP(m * gpc_pll_params.min_vco, clk->gpc_pll.clk_in); |
443 | n = allow_slide ? nlo : clk->gpc_pll.N; | 446 | n = allow_slide ? nlo : clk->gpc_pll.N; |
444 | #if PLDIV_GLITCHLESS | 447 | #if PLDIV_GLITCHLESS |
445 | pl = trim_sys_gpcpll_coeff_pldiv_v(coeff); | 448 | pl = (clk->gpc_pll.PL < 2) ? 2 : clk->gpc_pll.PL; |
446 | #else | 449 | #else |
447 | pl = clk->gpc_pll.PL; | 450 | pl = clk->gpc_pll.PL; |
448 | #endif | 451 | #endif |