summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cpu/samsung/exynos5250/mct.c9
-rw-r--r--src/cpu/samsung/exynos5250/monotonic_timer.c9
-rw-r--r--src/cpu/samsung/exynos5250/timer.c4
-rw-r--r--src/cpu/samsung/exynos5420/mct.c9
-rw-r--r--src/cpu/samsung/exynos5420/monotonic_timer.c9
-rw-r--r--src/cpu/samsung/exynos5420/timer.c4
6 files changed, 12 insertions, 32 deletions
diff --git a/src/cpu/samsung/exynos5250/mct.c b/src/cpu/samsung/exynos5250/mct.c
index b02fc6d9fa..bbb90e49bb 100644
--- a/src/cpu/samsung/exynos5250/mct.c
+++ b/src/cpu/samsung/exynos5250/mct.c
@@ -21,16 +21,8 @@
#include <arch/io.h>
#include "clk.h"
-static int enabled = 0;
-
uint64_t mct_raw_value(void)
{
- if (!enabled) {
- writel(readl(&exynos_mct->g_tcon) | (0x1 << 8),
- &exynos_mct->g_tcon);
- enabled = 1;
- }
-
uint64_t upper = readl(&exynos_mct->g_cnt_u);
uint64_t lower = readl(&exynos_mct->g_cnt_l);
@@ -41,5 +33,4 @@ void mct_start(void)
{
writel(readl(&exynos_mct->g_tcon) | (0x1 << 8),
&exynos_mct->g_tcon);
- enabled = 1;
}
diff --git a/src/cpu/samsung/exynos5250/monotonic_timer.c b/src/cpu/samsung/exynos5250/monotonic_timer.c
index 267d9c3aef..89ac416eb1 100644
--- a/src/cpu/samsung/exynos5250/monotonic_timer.c
+++ b/src/cpu/samsung/exynos5250/monotonic_timer.c
@@ -22,16 +22,13 @@
#include "clk.h"
-static int initialized;
-
static const uint32_t clocks_per_usec = MCT_HZ/1000000;
void timer_monotonic_get(struct mono_time *mt)
{
- if (!initialized) {
- mct_start();
- initialized = 1;
- }
+ /* We don't have to call mct_start() here
+ * because it was already called in the bootblock
+ */
mono_time_set_usecs(mt, mct_raw_value() / clocks_per_usec);
}
diff --git a/src/cpu/samsung/exynos5250/timer.c b/src/cpu/samsung/exynos5250/timer.c
index 88e1f3e489..5d402bc4bc 100644
--- a/src/cpu/samsung/exynos5250/timer.c
+++ b/src/cpu/samsung/exynos5250/timer.c
@@ -25,7 +25,9 @@
void init_timer(void)
{
- mct_start();
+ /* Nothing to do because we manually
+ * call mct_start() in the bootblock
+ */
}
/* delay x useconds */
diff --git a/src/cpu/samsung/exynos5420/mct.c b/src/cpu/samsung/exynos5420/mct.c
index b02fc6d9fa..bbb90e49bb 100644
--- a/src/cpu/samsung/exynos5420/mct.c
+++ b/src/cpu/samsung/exynos5420/mct.c
@@ -21,16 +21,8 @@
#include <arch/io.h>
#include "clk.h"
-static int enabled = 0;
-
uint64_t mct_raw_value(void)
{
- if (!enabled) {
- writel(readl(&exynos_mct->g_tcon) | (0x1 << 8),
- &exynos_mct->g_tcon);
- enabled = 1;
- }
-
uint64_t upper = readl(&exynos_mct->g_cnt_u);
uint64_t lower = readl(&exynos_mct->g_cnt_l);
@@ -41,5 +33,4 @@ void mct_start(void)
{
writel(readl(&exynos_mct->g_tcon) | (0x1 << 8),
&exynos_mct->g_tcon);
- enabled = 1;
}
diff --git a/src/cpu/samsung/exynos5420/monotonic_timer.c b/src/cpu/samsung/exynos5420/monotonic_timer.c
index 267d9c3aef..89ac416eb1 100644
--- a/src/cpu/samsung/exynos5420/monotonic_timer.c
+++ b/src/cpu/samsung/exynos5420/monotonic_timer.c
@@ -22,16 +22,13 @@
#include "clk.h"
-static int initialized;
-
static const uint32_t clocks_per_usec = MCT_HZ/1000000;
void timer_monotonic_get(struct mono_time *mt)
{
- if (!initialized) {
- mct_start();
- initialized = 1;
- }
+ /* We don't have to call mct_start() here
+ * because it was already called in the bootblock
+ */
mono_time_set_usecs(mt, mct_raw_value() / clocks_per_usec);
}
diff --git a/src/cpu/samsung/exynos5420/timer.c b/src/cpu/samsung/exynos5420/timer.c
index f8d3110000..ae13342c92 100644
--- a/src/cpu/samsung/exynos5420/timer.c
+++ b/src/cpu/samsung/exynos5420/timer.c
@@ -25,7 +25,9 @@
void init_timer(void)
{
- mct_start();
+ /* Nothing to do because we manually
+ * call mct_start() in the bootblock
+ */
}
/* delay x useconds */