Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / arm / cpu / arm926ejs / mxs / timer.c
index f2e72257d15b5d77fb7d583152f2b19b1f32a95f..5ab4ed0c5a3da057a52ed4bc41a2b726d26e2866 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Freescale i.MX28 timer driver
  *
@@ -6,14 +7,15 @@
  *
  * Based on code from LTIB:
  * (C) Copyright 2009-2010 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <init.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
+#include <linux/delay.h>
 
 /* Maximum fixed count */
 #if defined(CONFIG_MX23)
@@ -111,14 +113,9 @@ unsigned long long get_ticks(void)
        return timestamp;
 }
 
-ulong get_timer_masked(void)
-{
-       return tick_to_time(get_ticks());
-}
-
 ulong get_timer(ulong base)
 {
-       return get_timer_masked() - base;
+       return tick_to_time(get_ticks()) - base;
 }
 
 /* We use the HW_DIGCTL_MICROSECONDS register for sub-millisecond timer. */