Skip to content

Commit

Permalink
clk: pistachio: Fix override of clk-pll settings from boot loader
Browse files Browse the repository at this point in the history
PLL enable callbacks are overriding PLL mode (int/frac) and
Noise reduction (on/off) settings set by the boot loader which
results in the incorrect clock rate.

PLL mode and noise reduction are defined by the DSMPD and DACPD bits
of the PLL control register. PLL .enable() callbacks enable PLL
by deasserting all power-down bits of the PLL control register,
including DSMPD and DACPD bits, which is not necessary since
these bits don't actually enable/disable PLL.

This commit fixes the problem by removing DSMPD and DACPD bits
from the "PLL enable" mask.

Fixes: 43049b0("CLK: Pistachio: Add PLL driver")
Cc: <[email protected]> # 4.1
Reviewed-by: Andrew Bresitcker <[email protected]>
Signed-off-by: Zdenko Pulitika <[email protected]>
Signed-off-by: Govindraj Raja <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
  • Loading branch information
Zdenko Pulitika authored and bebarino committed Aug 26, 2015
1 parent 093affb commit e53f21c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/clk/pistachio/clk-pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ static int pll_gf40lp_frac_enable(struct clk_hw *hw)
u32 val;

val = pll_readl(pll, PLL_CTRL3);
val &= ~(PLL_FRAC_CTRL3_PD | PLL_FRAC_CTRL3_DACPD |
PLL_FRAC_CTRL3_DSMPD | PLL_FRAC_CTRL3_FOUTPOSTDIVPD |
val &= ~(PLL_FRAC_CTRL3_PD | PLL_FRAC_CTRL3_FOUTPOSTDIVPD |
PLL_FRAC_CTRL3_FOUT4PHASEPD | PLL_FRAC_CTRL3_FOUTVCOPD);
pll_writel(pll, val, PLL_CTRL3);

Expand Down Expand Up @@ -277,7 +276,7 @@ static int pll_gf40lp_laint_enable(struct clk_hw *hw)
u32 val;

val = pll_readl(pll, PLL_CTRL1);
val &= ~(PLL_INT_CTRL1_PD | PLL_INT_CTRL1_DSMPD |
val &= ~(PLL_INT_CTRL1_PD |
PLL_INT_CTRL1_FOUTPOSTDIVPD | PLL_INT_CTRL1_FOUTVCOPD);
pll_writel(pll, val, PLL_CTRL1);

Expand Down

0 comments on commit e53f21c

Please sign in to comment.