Skip to content

Commit

Permalink
drm/nouveau/clk/gf100-: Clean up PLL locking test
Browse files Browse the repository at this point in the history
Corresponds with GT215. Don't rely on the lock test logic being
unconditionally enabled, and disable test logic when done (presumably
to save power).

v2: Remove warning, nvkm_msec already warns on time-out

Signed-off-by: Roy Spliet <nouveau@spliet.org>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Roy Spliet authored and Ben Skeggs committed Jul 14, 2016
1 parent 20560a9 commit 0f7fbb9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,17 @@ gf100_clk_prog_2(struct gf100_clk *clk, int idx)
if (info->coef) {
nvkm_wr32(device, addr + 0x04, info->coef);
nvkm_mask(device, addr + 0x00, 0x00000001, 0x00000001);

/* Test PLL lock */
nvkm_mask(device, addr + 0x00, 0x00000010, 0x00000000);
nvkm_msec(device, 2000,
if (nvkm_rd32(device, addr + 0x00) & 0x00020000)
break;
);
nvkm_mask(device, addr + 0x00, 0x00020004, 0x00000004);
nvkm_mask(device, addr + 0x00, 0x00000010, 0x00000010);

/* Enable sync mode */
nvkm_mask(device, addr + 0x00, 0x00000004, 0x00000004);
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk104.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,17 @@ gk104_clk_prog_2(struct gk104_clk *clk, int idx)
if (info->coef) {
nvkm_wr32(device, addr + 0x04, info->coef);
nvkm_mask(device, addr + 0x00, 0x00000001, 0x00000001);

/* Test PLL lock */
nvkm_mask(device, addr + 0x00, 0x00000010, 0x00000000);
nvkm_msec(device, 2000,
if (nvkm_rd32(device, addr + 0x00) & 0x00020000)
break;
);
nvkm_mask(device, addr + 0x00, 0x00020004, 0x00000004);
nvkm_mask(device, addr + 0x00, 0x00000010, 0x00000010);

/* Enable sync mode */
nvkm_mask(device, addr + 0x00, 0x00000004, 0x00000004);
}
}

Expand Down

0 comments on commit 0f7fbb9

Please sign in to comment.