summaryrefslogtreecommitdiff
path: root/src/cpu/samsung/exynos5250/timer.c
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2013-07-30 15:11:35 -0700
committerPatrick Georgi <patrick@georgi-clan.de>2013-12-21 10:48:49 +0100
commit9b764a0dcc67a7bbf6e74b35cdd9e3e7c6d59c83 (patch)
treebcc96fbc83db41a0770d5e455b716bf0025d31e3 /src/cpu/samsung/exynos5250/timer.c
parent2c116febabe3619933d361ca4289df899ec83e3d (diff)
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 <gabeblack@google.com> Reviewed-on: https://gerrit.chromium.org/gerrit/63778 Commit-Queue: Gabe Black <gabeblack@chromium.org> Reviewed-by: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org> Reviewed-on: http://review.coreboot.org/4401 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'src/cpu/samsung/exynos5250/timer.c')
-rw-r--r--src/cpu/samsung/exynos5250/timer.c62
1 files changed, 2 insertions, 60 deletions
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 <console/console.h>
-#include <arch/io.h>
#include <timer.h>
#include <delay.h>
-#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 */