aboutsummaryrefslogtreecommitdiff
path: root/src/cpu/samsung/exynos5250/timer.c
diff options
context:
space:
mode:
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 */