common: Move some time functions out of common.h
[oweals/u-boot.git] / arch / arm / mach-imx / timer.c
index 9b011147d66861ccc8c9d2188a8de9536522901b..5fe5c51f6a6761535d51ff63cce5c9d178e0c724 100644 (file)
@@ -1,13 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2007
  * Sascha Hauer, Pengutronix
  *
  * (C) Copyright 2009 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <div64.h>
 #include <asm/arch/imx-regs.h>
@@ -38,8 +38,6 @@ static struct mxc_gpt *cur_gpt = (struct mxc_gpt *)GPT1_BASE_ADDR;
 #define GPTPR_PRESCALER24M_SHIFT 12
 #define GPTPR_PRESCALER24M_MASK (0xF << GPTPR_PRESCALER24M_SHIFT)
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static inline int gpt_has_clk_source_osc(void)
 {
 #if defined(CONFIG_MX6)
@@ -74,8 +72,7 @@ int timer_init(void)
        __raw_writel(GPTCR_SWR, &cur_gpt->control);
 
        /* We have no udelay by now */
-       for (i = 0; i < 100; i++)
-               __raw_writel(0, &cur_gpt->control);
+       __raw_writel(0, &cur_gpt->control);
 
        i = __raw_readl(&cur_gpt->control);
        i &= ~GPTCR_CLKSOURCE_MASK;