[PATCH 4/6] ARM i.MX6 pllv3: Do not use delay functions
Sascha Hauer
s.hauer at pengutronix.de
Thu Dec 6 08:29:46 EST 2012
We may be called very early, before the timer is available,
so don't use it here.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
arch/arm/mach-imx/clk-pllv3.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-imx/clk-pllv3.c b/arch/arm/mach-imx/clk-pllv3.c
index f400a7c..cc9621c 100644
--- a/arch/arm/mach-imx/clk-pllv3.c
+++ b/arch/arm/mach-imx/clk-pllv3.c
@@ -46,7 +46,7 @@ static int clk_pllv3_enable(struct clk *clk)
{
struct clk_pllv3 *pll = to_clk_pllv3(clk);
u32 val;
- int ret;
+ int timeout = 10000;
val = readl(pll->base);
val &= ~BM_PLL_BYPASS;
@@ -57,9 +57,13 @@ static int clk_pllv3_enable(struct clk *clk)
writel(val, pll->base);
/* Wait for PLL to lock */
- ret = wait_on_timeout(10 * MSECOND, !(readl(pll->base) & BM_PLL_LOCK));
- if (ret)
- return ret;
+ while (timeout--) {
+ if (readl(pll->base) & BM_PLL_LOCK)
+ break;
+ }
+
+ if (!timeout)
+ return -ETIMEDOUT;
val = readl(pll->base);
val |= pll->gate_mask;
--
1.7.10.4
More information about the barebox
mailing list