]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
CLK: HSDK: Check for PLL bypass firstly
authorEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Wed, 29 Jan 2020 11:08:29 +0000 (14:08 +0300)
committerAlexey Brodkin <abrodkin@synopsys.com>
Wed, 12 Feb 2020 17:47:14 +0000 (20:47 +0300)
Pll bypass has priority over enable/disable.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
drivers/clk/clk-hsdk-cgu.c

index 56ef08c032b99b500aa629b065b1df012bf09820..69e6b24b66c884cb6b71f9b2c2ec87c4eb74d871 100644 (file)
@@ -377,14 +377,14 @@ static ulong pll_get(struct clk *sclk)
 
        pr_debug("current configurarion: %#x\n", val);
 
-       /* Check if PLL is disabled */
-       if (val & CGU_PLL_CTRL_PD)
-               return 0;
-
        /* Check if PLL is bypassed */
        if (val & CGU_PLL_CTRL_BYPASS)
                return PARENT_RATE;
 
+       /* Check if PLL is disabled */
+       if (val & CGU_PLL_CTRL_PD)
+               return 0;
+
        /* input divider = reg.idiv + 1 */
        idiv = 1 + ((val & CGU_PLL_CTRL_IDIV_MASK) >> CGU_PLL_CTRL_IDIV_SHIFT);
        /* fb divider = 2*(reg.fbdiv + 1) */