diff options
author | Roy Spliet <rspliet@eclipso.eu> | 2014-08-21 13:45:16 +0200 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-09-15 22:25:01 +1000 |
commit | a749a1fb55b3c46a4f81137c2c1882774dc55296 (patch) | |
tree | 4ec1fde31b8bca20919ae8df50d974cfd168fae8 /drivers/gpu | |
parent | 275dd6f48f9954df94ad15b4dc303fa7f820777c (diff) |
drm/nva3/clk: For PLL clocks always make sure the PLL is not in use
Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/clock/nva3.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/clock/nva3.c b/drivers/gpu/drm/nouveau/core/subdev/clock/nva3.c index fd00397bc15e..53d7ebedf024 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/clock/nva3.c +++ b/drivers/gpu/drm/nouveau/core/subdev/clock/nva3.c @@ -305,8 +305,17 @@ prog_pll(struct nva3_clock_priv *priv, int clk, u32 pll, int idx) const u32 src1 = 0x004160 + (clk * 4); const u32 ctrl = pll + 0; const u32 coef = pll + 4; + u32 bypass; if (info->pll) { + /* Always start from a non-PLL clock */ + bypass = nv_rd32(priv, ctrl) & 0x00000008; + if (!bypass) { + nv_mask(priv, src1, 0x00000101, 0x00000101); + nv_mask(priv, ctrl, 0x00000008, 0x00000008); + udelay(20); + } + nv_mask(priv, src0, 0x003f3141, 0x00000101 | info->clk); nv_wr32(priv, coef, info->pll); nv_mask(priv, ctrl, 0x00000015, 0x00000015); |