summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2014-08-12 20:30:08 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:01 -0400
commit9635e19e618b2897d27a21a240110289d424c99e (patch)
treeac2938710a58b49b935398c7e3bacc2391f013a4 /drivers/gpu
parentb2b37c6437a5492f85a1d0f06358e576271d6e0d (diff)
gpu: nvgpu: Don't increase GPCPLL rate before bypass
Do not force GM20b GPCPLL post divider to 1:2 settings before switching to bypass clock if PLL output frequency is increased as a result. Move this step under bypass. However, this step is still needed in case when PLL can be configured without switch to bypass. Bug 1450787 Change-Id: Iab81b0e5a71f44f738a64e15b05df41fdbd61ebe Signed-off-by: Alex Frid <afrid@nvidia.com> Reviewed-on: http://git-master/r/456505 Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Tested-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/nvgpu/gm20b/clk_gm20b.c11
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:
368static int clk_program_gpc_pll(struct gk20a *g, struct clk_gk20a *clk, 368static 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