From 9b764a0dcc67a7bbf6e74b35cdd9e3e7c6d59c83 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 30 Jul 2013 15:11:35 -0700 Subject: exynos5250: Get rid of the PWM timer code we shouldn't be using anymore This code was left over from U-Boot and was superceded by the MCT. Change-Id: Ia85e3b7281dcdd4740238dddd0dfc6f0ba2c94da Signed-off-by: Gabe Black Reviewed-on: https://gerrit.chromium.org/gerrit/63778 Commit-Queue: Gabe Black Reviewed-by: Gabe Black Tested-by: Gabe Black Reviewed-on: http://review.coreboot.org/4401 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/cpu/samsung/exynos5250/clock.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/cpu/samsung/exynos5250/clock.c') diff --git a/src/cpu/samsung/exynos5250/clock.c b/src/cpu/samsung/exynos5250/clock.c index 390fae30f6..a89ceb393a 100644 --- a/src/cpu/samsung/exynos5250/clock.c +++ b/src/cpu/samsung/exynos5250/clock.c @@ -610,9 +610,8 @@ int clock_epll_set_rate(unsigned long rate) unsigned int epll_con, epll_con_k; unsigned int i; unsigned int lockcnt; - unsigned int start; - struct exynos5_clock *clk = - samsung_get_base_clock(); + struct mono_time current, end; + struct exynos5_clock *clk = samsung_get_base_clock(); epll_con = readl(&clk->epll_con0); epll_con &= ~((EPLL_CON0_LOCK_DET_EN_MASK << @@ -646,14 +645,19 @@ int clock_epll_set_rate(unsigned long rate) writel(epll_con, &clk->epll_con0); writel(epll_con_k, &clk->epll_con1); - start = get_timer(0); + timer_monotonic_get(¤t); + end = current; + mono_time_add_msecs(&end, TIMEOUT_EPLL_LOCK); while (!(readl(&clk->epll_con0) & (0x1 << EXYNOS5_EPLLCON0_LOCKED_SHIFT))) { - if (get_timer(start) > TIMEOUT_EPLL_LOCK) { - printk(BIOS_DEBUG, "%s: Timeout waiting for EPLL lock\n", __func__); + if (mono_time_after(¤t, &end)) { + printk(BIOS_DEBUG, + "%s: Timeout waiting for EPLL lock\n", + __func__); return -1; } + timer_monotonic_get(¤t); } return 0; -- cgit v1.2.3