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/dp-reg.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/cpu/samsung/exynos5250/dp-reg.c') diff --git a/src/cpu/samsung/exynos5250/dp-reg.c b/src/cpu/samsung/exynos5250/dp-reg.c index ac4208d159..1cc70887ce 100644 --- a/src/cpu/samsung/exynos5250/dp-reg.c +++ b/src/cpu/samsung/exynos5250/dp-reg.c @@ -120,7 +120,7 @@ unsigned int s5p_dp_get_pll_lock_status(struct s5p_dp_device *dp) int s5p_dp_init_analog_func(struct s5p_dp_device *dp) { u32 reg; - u32 start; + struct mono_time current, end; struct exynos5_dp *base = dp->base; writel(0x00, &base->dp_phy_pd); @@ -135,13 +135,17 @@ int s5p_dp_init_analog_func(struct s5p_dp_device *dp) clrbits_le32(&base->dp_pll_ctl, DP_PLL_PD); - start = get_timer(0); + timer_monotonic_get(¤t); + end = current; + mono_time_add_msecs(&end, PLL_LOCK_TIMEOUT); + while (s5p_dp_get_pll_lock_status(dp) == PLL_UNLOCKED) { - if (get_timer(start) > PLL_LOCK_TIMEOUT) { + if (mono_time_after(¤t, &end)) { printk(BIOS_ERR, "%s: PLL is not locked\n", __func__); return -1; } + timer_monotonic_get(¤t); } } @@ -431,11 +435,14 @@ void s5p_dp_enable_video_master(struct s5p_dp_device *dp) int s5p_dp_is_video_stream_on(struct s5p_dp_device *dp) { u32 reg, i = 0; - u32 start; + struct mono_time current, end; struct exynos5_dp *base = dp->base; /* Wait for 4 VSYNC_DET interrupts */ - start = get_timer(0); + timer_monotonic_get(¤t); + end = current; + mono_time_add_msecs(&end, STREAM_ON_TIMEOUT); + do { reg = readl(&base->common_int_sta_1); if (reg & VSYNC_DET) { @@ -444,7 +451,8 @@ int s5p_dp_is_video_stream_on(struct s5p_dp_device *dp) } if (i == 4) break; - } while (get_timer(start) <= STREAM_ON_TIMEOUT); + timer_monotonic_get(¤t); + } while (mono_time_before(¤t, &end)); if (i != 4) { printk(BIOS_DEBUG, "s5p_dp_is_video_stream_on timeout\n"); -- cgit v1.2.3