clk: at91: sckc: optimize boot time
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Tue, 20 Sep 2016 20:58:31 +0000 (22:58 +0200)
committerStephen Boyd <sboyd@codeaurora.org>
Wed, 21 Sep 2016 00:03:04 +0000 (17:03 -0700)
Assume that if the oscillator is enabled (OSC32EN bit is present), the
delay has already elapsed as the bootloader probably waited for the
oscillator to settle. This could waste up to 1.2s.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/at91/sckc.c

index 199d1b3f5ad3bf41a9dd90334719e23f77df077b..ab6ecefc49ad85424a02dda7b3d3342d76598884 100644 (file)
@@ -69,7 +69,7 @@ static int clk_slow_osc_prepare(struct clk_hw *hw)
        void __iomem *sckcr = osc->sckcr;
        u32 tmp = readl(sckcr);
 
-       if (tmp & AT91_SCKC_OSC32BYP)
+       if (tmp & (AT91_SCKC_OSC32BYP | AT91_SCKC_OSC32EN))
                return 0;
 
        writel(tmp | AT91_SCKC_OSC32EN, sckcr);