common: Move some time functions out of common.h
authorSimon Glass <sjg@chromium.org>
Thu, 14 Nov 2019 19:57:26 +0000 (12:57 -0700)
committerTom Rini <trini@konsulko.com>
Mon, 2 Dec 2019 23:23:11 +0000 (18:23 -0500)
These functions belong in time.h so move them over and add comments.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 files changed:
arch/arm/cpu/armv7/ls102xa/timer.c
arch/arm/cpu/armv8/generic_timer.c
arch/arm/mach-imx/syscounter.c
arch/arm/mach-imx/timer.c
arch/m68k/lib/time.c
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
arch/powerpc/cpu/mpc8xxx/srio.c
arch/powerpc/lib/time.c
drivers/crypto/fsl/jr.c
drivers/i2c/fsl_i2c.c
include/common.h
include/time.h

index e79360ada88d6e82acdf14d168904a80d7136d2c..a5f4e31ac70bc27bd4679d38053d8e0f1eb9db2c 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <div64.h>
 #include <asm/arch/immap_ls102xa.h>
index c1706dcec18cec3c856c19002f8d3f7eb28aae9c..46e63294fef016254ceefd1ec1d787015f250fd4 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <time.h>
 #include <asm/system.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index c888a939385be128627c55510a82886af0bfdf54..5a292c396433308ffc98155429afd2ffa50eb633 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <div64.h>
 #include <asm/arch/imx-regs.h>
index ed5eb1c8a776c069d54cd460942b4333f3086262..5fe5c51f6a6761535d51ff63cce5c9d178e0c724 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <div64.h>
 #include <asm/arch/imx-regs.h>
index a6345a0bc9c0c23cdda62ad5af6c25f3fc1fc02f..c76c5fedc99cab60ed2f011bf1a6eecb55949f11 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 
 #include <asm/timer.h>
 #include <asm/immap.h>
index fcfa73023347c4525f1d9f1ae3ff7d55c4386bcc..ebdcd29c13d973b41f9afc2cb0d95971fe7d1482 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <time.h>
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
 #include <hwconfig.h>
 #endif
index ea7dac6e66878df07e4a16667ea29bff371d71c8..a1f9403559611f614156436b335e827f614e59e0 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <config.h>
+#include <time.h>
 #include <asm/fsl_law.h>
 #include <asm/fsl_serdes.h>
 #include <asm/fsl_srio.h>
index a22a73abfa5a7dbc2f040854b5b45af0567ecfe7..e1494fa1292772945b059d94db53d93596800f46 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 
 /* ------------------------------------------------------------------------- */
index 31217623649f012ed6c6a9e5bed4ae01735eae12..1ea9db6850f0681dd086503b79ad280d0a7975a7 100644 (file)
@@ -11,6 +11,7 @@
 #include "jr.h"
 #include "jobdesc.h"
 #include "desc_constr.h"
+#include <time.h>
 #ifdef CONFIG_FSL_CORENET
 #include <asm/fsl_pamu.h>
 #endif
index bf8d52d5ad5ffb2c48debe4c72948e1f1b7a05d1..bbbd6ef5bfdc6e5534f9293a90bd8f51ccd90729 100644 (file)
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <command.h>
 #include <i2c.h>               /* Functional interface */
+#include <time.h>
 #include <asm/io.h>
 #include <asm/fsl_i2c.h>       /* HW definitions */
 #include <clk.h>
index 1e77ed393e474b728436422e0b66a092e6388093..20d143deb81a7ea678fb0beec4f6bb7003e37c2d 100644 (file)
@@ -288,10 +288,6 @@ int cleanup_before_linux_select(int flags);
 uint64_t get_ticks(void);
 void   wait_ticks    (unsigned long);
 
-/* arch/$(ARCH)/lib/time.c */
-ulong  usec2ticks    (unsigned long usec);
-ulong  ticks2usec    (unsigned long ticks);
-
 /* lib/uuid.c */
 #include <uuid.h>
 
index a1149522edf0381a8d2ca3f09e3657da25c9a5a1..a1bdefc164bfb1526fc1ce09c051f25864ba922f 100644 (file)
@@ -70,4 +70,20 @@ uint64_t usec_to_tick(unsigned long usec);
        (time_after_eq(a,b) && \
         time_before(a,c))
 
+/**
+ * usec2ticks() - Convert microseconds to internal ticks
+ *
+ * @usec: Value of microseconds to convert
+ * @return Corresponding internal ticks value, calculated using get_tbclk()
+ */
+ulong usec2ticks(unsigned long usec);
+
+/**
+ * ticks2usec() - Convert internal ticks to microseconds
+ *
+ * @ticks: Value of ticks to convert
+ * @return Corresponding microseconds value, calculated using get_tbclk()
+ */
+ulong ticks2usec(unsigned long ticks);
+
 #endif /* _TIME_H */