diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-12-06 12:43:14 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-12-06 12:55:56 +0100 |
commit | 85e4576d6a753f94bb3ea3cf644d1297f65622f3 (patch) | |
tree | 7b784abbf710c99ccc31526ec66990d20c2a3a7c /arch | |
parent | 802d901450b7a180ca55c0679feb8d1f5141cc72 (diff) | |
download | barebox-85e4576d6a753f94bb3ea3cf644d1297f65622f3.tar.gz barebox-85e4576d6a753f94bb3ea3cf644d1297f65622f3.tar.xz |
ARM i.MX6 pllv3: Do not use delay functions
We may be called very early, before the timer is available,
so don't use it here.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/clk-pllv3.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/arm/mach-imx/clk-pllv3.c b/arch/arm/mach-imx/clk-pllv3.c index f400a7ca1c..cc9621c8f9 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; |