From 43933466e74dbdeb38ba8f5882ae8ed2372e3e4b Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 24 Sep 2014 10:27:29 -0500 Subject: exynos: convert to stopwatch API Instead of open coding monotonic timer usage, use the stopwatch API. BUG=None BRANCH=None TEST=None Change-Id: I1c541c1c9f3fde0dec9163ad6cc94322538ac7f7 Signed-off-by: Patrick Georgi Original-Commit-Id: 46ede0897687da6bcf730a8904f25e5a4485d6cd Original-Change-Id: Ia63a05850a1b6afdc42c2422332f77af516d27e3 Original-Signed-off-by: Aaron Durbin Original-Reviewed-on: https://chromium-review.googlesource.com/219716 Original-Reviewed-by: Julius Werner Original-Reviewed-by: David Hendricks Original-Reviewed-by: Furquan Shaikh Reviewed-on: http://review.coreboot.org/8825 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/soc/samsung/exynos5250/clock.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/soc/samsung/exynos5250/clock.c') diff --git a/src/soc/samsung/exynos5250/clock.c b/src/soc/samsung/exynos5250/clock.c index a00af0232a..246b9dc8e2 100644 --- a/src/soc/samsung/exynos5250/clock.c +++ b/src/soc/samsung/exynos5250/clock.c @@ -597,7 +597,7 @@ int clock_epll_set_rate(unsigned long rate) unsigned int epll_con, epll_con_k; unsigned int i; unsigned int lockcnt; - struct mono_time current, end; + struct stopwatch sw; epll_con = readl(&exynos_clock->epll_con0); epll_con &= ~((EPLL_CON0_LOCK_DET_EN_MASK << @@ -631,17 +631,16 @@ int clock_epll_set_rate(unsigned long rate) writel(epll_con, &exynos_clock->epll_con0); writel(epll_con_k, &exynos_clock->epll_con1); - timer_monotonic_get(¤t); - end = current; - mono_time_add_msecs(&end, TIMEOUT_EPLL_LOCK); + stopwatch_init_msecs_expire(&sw, TIMEOUT_EPLL_LOCK); while (!(readl(&exynos_clock->epll_con0) & (0x1 << EXYNOS5_EPLLCON0_LOCKED_SHIFT))) { - if (mono_time_after(¤t, &end)) { - printk(BIOS_DEBUG, "%s: Timeout waiting for EPLL lock\n", __func__); + if (stopwatch_expired(&sw)) { + printk(BIOS_DEBUG, + "%s: Timeout waiting for EPLL lock\n", + __func__); return -1; } - timer_monotonic_get(¤t); } return 0; -- cgit v1.2.3