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/timer.c | 62 ++------------------------------------ 1 file changed, 2 insertions(+), 60 deletions(-) (limited to 'src/cpu/samsung/exynos5250/timer.c') diff --git a/src/cpu/samsung/exynos5250/timer.c b/src/cpu/samsung/exynos5250/timer.c index 405effac5b..0c2e64143c 100644 --- a/src/cpu/samsung/exynos5250/timer.c +++ b/src/cpu/samsung/exynos5250/timer.c @@ -18,72 +18,14 @@ */ #include -#include #include #include -#include "timer.h" -#include "pwm.h" -#include "clk.h" -#include "cpu.h" - -static unsigned long long timer_reset_value; -static unsigned long lastinc; - -/* macro to read the 16 bit timer */ -static inline struct s5p_timer *s5p_get_base_timer(void) -{ - return samsung_get_base_timer(); -} -/** - * Read the countdown timer. - * - * This operates at 1MHz and counts downwards. It will wrap about every - * hour (2^32 microseconds). - * - * @return current value of timer - */ -static unsigned long timer_get_us_down(void) -{ - struct s5p_timer *const timer = s5p_get_base_timer(); - - return readl(&timer->tcnto4); -} +#include "clk.h" void init_timer(void) { - /* Timer may have been enabled in SPL */ - if (!pwm_check_enabled(4)) { - /* PWM Timer 4 */ - pwm_init(4, MUX_DIV_4, 0); - pwm_config(4, 100000, 100000); - pwm_enable(4); - - /* Use this as the current monotonic time in us */ - timer_reset_value = 0; - - /* Use this as the last timer value we saw */ - lastinc = timer_get_us_down(); - } -} - -/* - * timer without interrupts - */ -unsigned long get_timer(unsigned long base) -{ - unsigned long now = timer_get_us_down(); - - /* - * Increment the time by the amount elapsed since the last read. - * The timer may have wrapped around, but it makes no difference to - * our arithmetic here. - */ - timer_reset_value += lastinc - now; - lastinc = now; - - /* Divide by 1000 to convert from us to ms */ - return timer_reset_value / 1000 - base; + mct_start(); } /* delay x useconds */ -- cgit v1.2.3