common: Move get_ticks() function out of common.h

This function belongs in time.h so move it over and add a comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/arch/arm/cpu/arm920t/ep93xx/timer.c b/arch/arm/cpu/arm920t/ep93xx/timer.c
index 49bf49b..4829c99 100644
--- a/arch/arm/cpu/arm920t/ep93xx/timer.c
+++ b/arch/arm/cpu/arm920t/ep93xx/timer.c
@@ -12,6 +12,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <linux/types.h>
 #include <asm/arch/ep93xx.h>
 #include <asm/io.h>
diff --git a/arch/arm/cpu/arm920t/imx/timer.c b/arch/arm/cpu/arm920t/imx/timer.c
index 96fff3f..17081dd 100644
--- a/arch/arm/cpu/arm920t/imx/timer.c
+++ b/arch/arm/cpu/arm920t/imx/timer.c
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #if defined (CONFIG_IMX)
 
 #include <asm/arch/imx-regs.h>
diff --git a/arch/arm/cpu/arm926ejs/armada100/timer.c b/arch/arm/cpu/arm926ejs/armada100/timer.c
index d2ecbd0..6c6948a 100644
--- a/arch/arm/cpu/arm926ejs/armada100/timer.c
+++ b/arch/arm/cpu/arm926ejs/armada100/timer.c
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/armada100.h>
 
diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/timer.c b/arch/arm/cpu/arm926ejs/lpc32xx/timer.c
index b3ca686..3a896d1 100644
--- a/arch/arm/cpu/arm926ejs/lpc32xx/timer.c
+++ b/arch/arm/cpu/arm926ejs/lpc32xx/timer.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/timer.h>
diff --git a/arch/arm/cpu/arm926ejs/mx27/timer.c b/arch/arm/cpu/arm926ejs/mx27/timer.c
index 94b5d45..f51f0df 100644
--- a/arch/arm/cpu/arm926ejs/mx27/timer.c
+++ b/arch/arm/cpu/arm926ejs/mx27/timer.c
@@ -17,6 +17,7 @@
 
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 
diff --git a/arch/arm/cpu/arm926ejs/mxs/timer.c b/arch/arm/cpu/arm926ejs/mxs/timer.c
index 7492ba4..226401d 100644
--- a/arch/arm/cpu/arm926ejs/mxs/timer.c
+++ b/arch/arm/cpu/arm926ejs/mxs/timer.c
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
diff --git a/arch/arm/cpu/arm926ejs/spear/timer.c b/arch/arm/cpu/arm926ejs/spear/timer.c
index e7b5bda..28c09e9 100644
--- a/arch/arm/cpu/arm926ejs/spear/timer.c
+++ b/arch/arm/cpu/arm926ejs/spear/timer.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_gpt.h>
diff --git a/arch/arm/cpu/armv7/arch_timer.c b/arch/arm/cpu/armv7/arch_timer.c
index 5de6305..2eb5710 100644
--- a/arch/arm/cpu/armv7/arch_timer.c
+++ b/arch/arm/cpu/armv7/arch_timer.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <div64.h>
 #include <bootstage.h>
diff --git a/arch/arm/cpu/armv7/iproc-common/timer.c b/arch/arm/cpu/armv7/iproc-common/timer.c
index aaa767d..668b5e1 100644
--- a/arch/arm/cpu/armv7/iproc-common/timer.c
+++ b/arch/arm/cpu/armv7/iproc-common/timer.c
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/iproc-common/timer.h>
 #include <asm/iproc-common/sysmap.h>
diff --git a/arch/arm/cpu/armv7/s5p-common/timer.c b/arch/arm/cpu/armv7/s5p-common/timer.c
index 0048cd8..e54cfb0 100644
--- a/arch/arm/cpu/armv7/s5p-common/timer.c
+++ b/arch/arm/cpu/armv7/s5p-common/timer.c
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/pwm.h>
 #include <asm/arch/clk.h>
diff --git a/arch/arm/cpu/armv7/stv0991/timer.c b/arch/arm/cpu/armv7/stv0991/timer.c
index d1b763d..695bdd7 100644
--- a/arch/arm/cpu/armv7/stv0991/timer.c
+++ b/arch/arm/cpu/armv7/stv0991/timer.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch-stv0991/hardware.h>
 #include <asm/arch-stv0991/stv0991_cgu.h>
diff --git a/arch/arm/cpu/armv7/sunxi/timer.c b/arch/arm/cpu/armv7/sunxi/timer.c
index 304c1ac..6bda5fb 100644
--- a/arch/arm/cpu/armv7/sunxi/timer.c
+++ b/arch/arm/cpu/armv7/sunxi/timer.c
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/timer.h>
 
diff --git a/arch/arm/cpu/armv7/vf610/timer.c b/arch/arm/cpu/armv7/vf610/timer.c
index 821a279..f858de9 100644
--- a/arch/arm/cpu/armv7/vf610/timer.c
+++ b/arch/arm/cpu/armv7/vf610/timer.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <div64.h>
 #include <asm/arch/imx-regs.h>
diff --git a/arch/arm/cpu/armv7m/systick-timer.c b/arch/arm/cpu/armv7m/systick-timer.c
index d04f67a..5c310d3 100644
--- a/arch/arm/cpu/armv7m/systick-timer.c
+++ b/arch/arm/cpu/armv7m/systick-timer.c
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/arch/arm/cpu/sa1100/timer.c b/arch/arm/cpu/sa1100/timer.c
index 0fac5c1..c6b1b2c 100644
--- a/arch/arm/cpu/sa1100/timer.c
+++ b/arch/arm/cpu/sa1100/timer.c
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <SA-1100.h>
+#include <time.h>
 
 static ulong get_timer_masked (void)
 {
diff --git a/arch/arm/mach-at91/arm920t/timer.c b/arch/arm/mach-at91/arm920t/timer.c
index 6db541a..3aef953 100644
--- a/arch/arm/mach-at91/arm920t/timer.c
+++ b/arch/arm/mach-at91/arm920t/timer.c
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
diff --git a/arch/arm/mach-davinci/timer.c b/arch/arm/mach-davinci/timer.c
index 99f1eab..9846463 100644
--- a/arch/arm/mach-davinci/timer.c
+++ b/arch/arm/mach-davinci/timer.c
@@ -21,6 +21,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/timer_defs.h>
 #include <div64.h>
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 87b674e..dbb68f7 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -16,6 +16,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/clock.h>
diff --git a/arch/arm/mach-orion5x/timer.c b/arch/arm/mach-orion5x/timer.c
index 6aaf94a..9da9783 100644
--- a/arch/arm/mach-orion5x/timer.c
+++ b/arch/arm/mach-orion5x/timer.c
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 
 #define UBOOT_CNTR	0	/* counter to use for uboot timer */
diff --git a/arch/arm/mach-rmobile/timer.c b/arch/arm/mach-rmobile/timer.c
index bf74955..9fcab44 100644
--- a/arch/arm/mach-rmobile/timer.c
+++ b/arch/arm/mach-rmobile/timer.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch-armv7/globaltimer.h>
 #include <asm/arch/rmobile.h>
diff --git a/arch/arm/mach-socfpga/clock_manager_gen5.c b/arch/arm/mach-socfpga/clock_manager_gen5.c
index 3a64600..54a821a 100644
--- a/arch/arm/mach-socfpga/clock_manager_gen5.c
+++ b/arch/arm/mach-socfpga/clock_manager_gen5.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <dm.h>
 #include <asm/arch/clock_manager.h>
diff --git a/arch/arm/mach-sunxi/dram_helpers.c b/arch/arm/mach-sunxi/dram_helpers.c
index 239ab42..520b597 100644
--- a/arch/arm/mach-sunxi/dram_helpers.c
+++ b/arch/arm/mach-sunxi/dram_helpers.c
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/barriers.h>
 #include <asm/io.h>
 #include <asm/arch/dram.h>
diff --git a/arch/arm/mach-sunxi/p2wi.c b/arch/arm/mach-sunxi/p2wi.c
index e84e1d8..7c5c122 100644
--- a/arch/arm/mach-sunxi/p2wi.c
+++ b/arch/arm/mach-sunxi/p2wi.c
@@ -15,6 +15,7 @@
 
 #include <common.h>
 #include <errno.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/gpio.h>
diff --git a/arch/arm/mach-sunxi/rsb.c b/arch/arm/mach-sunxi/rsb.c
index 005ca58..01bb09b 100644
--- a/arch/arm/mach-sunxi/rsb.c
+++ b/arch/arm/mach-sunxi/rsb.c
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <errno.h>
+#include <time.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/prcm.h>
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index e539ad8..31b6aa2 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -9,6 +9,7 @@
 #include <div64.h>
 #include <dm.h>
 #include <errno.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/tegra.h>
diff --git a/arch/microblaze/cpu/timer.c b/arch/microblaze/cpu/timer.c
index 58e5c30..805eac7 100644
--- a/arch/microblaze/cpu/timer.c
+++ b/arch/microblaze/cpu/timer.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <fdtdec.h>
+#include <time.h>
 #include <asm/microblaze_timer.h>
 #include <asm/microblaze_intc.h>
 
diff --git a/arch/mips/mach-jz47xx/jz4780/timer.c b/arch/mips/mach-jz47xx/jz4780/timer.c
index a689b9d..988ebd2 100644
--- a/arch/mips/mach-jz47xx/jz4780/timer.c
+++ b/arch/mips/mach-jz47xx/jz4780/timer.c
@@ -9,6 +9,7 @@
 #include <config.h>
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/mipsregs.h>
 #include <mach/jz4780.h>
diff --git a/arch/nds32/cpu/n1213/ag101/timer.c b/arch/nds32/cpu/n1213/ag101/timer.c
index dfec5b3..cbfe07e 100644
--- a/arch/nds32/cpu/n1213/ag101/timer.c
+++ b/arch/nds32/cpu/n1213/ag101/timer.c
@@ -9,6 +9,7 @@
  */
 #ifndef CONFIG_TIMER
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <faraday/fttmr010.h>
 
diff --git a/arch/sh/lib/time_sh2.c b/arch/sh/lib/time_sh2.c
index 14bef6b..d82c1d2 100644
--- a/arch/sh/lib/time_sh2.c
+++ b/arch/sh/lib/time_sh2.c
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 
diff --git a/arch/xtensa/lib/time.c b/arch/xtensa/lib/time.c
index 81459b4..62bbe37 100644
--- a/arch/xtensa/lib/time.c
+++ b/arch/xtensa/lib/time.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <linux/stringify.h>
 
diff --git a/board/armltd/integrator/timer.c b/board/armltd/integrator/timer.c
index 7ecfa49..e65ae99 100644
--- a/board/armltd/integrator/timer.c
+++ b/board/armltd/integrator/timer.c
@@ -18,6 +18,7 @@
 
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 
 #ifdef CONFIG_ARCH_CINTEGRATOR
 #define DIV_CLOCK_INIT	1
diff --git a/board/broadcom/bcmstb/bcmstb.c b/board/broadcom/bcmstb/bcmstb.c
index 5fc2c05..23500df 100644
--- a/board/broadcom/bcmstb/bcmstb.c
+++ b/board/broadcom/bcmstb/bcmstb.c
@@ -6,6 +6,7 @@
  * Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
  */
 
+#include <time.h>
 #include <linux/types.h>
 #include <common.h>
 #include <env.h>
diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c
index abdd580..75056aa 100644
--- a/board/xilinx/versal/board.c
+++ b/board/xilinx/versal/board.c
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <fdtdec.h>
 #include <malloc.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
diff --git a/common/autoboot.c b/common/autoboot.c
index b28bd68..8faac20 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -15,6 +15,7 @@
 #include <memalign.h>
 #include <menu.h>
 #include <post.h>
+#include <time.h>
 #include <u-boot/sha256.h>
 #include <bootcount.h>
 
diff --git a/common/bootretry.c b/common/bootretry.c
index 47aaaa8..dac891f 100644
--- a/common/bootretry.c
+++ b/common/bootretry.c
@@ -9,6 +9,7 @@
 #include <cli.h>
 #include <env.h>
 #include <errno.h>
+#include <time.h>
 #include <watchdog.h>
 
 #ifndef CONFIG_BOOT_RETRY_MIN
diff --git a/common/cli_readline.c b/common/cli_readline.c
index ea510ed..6ef7a3e 100644
--- a/common/cli_readline.c
+++ b/common/cli_readline.c
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <bootretry.h>
 #include <cli.h>
+#include <time.h>
 #include <watchdog.h>
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/common/iotrace.c b/common/iotrace.c
index ba955af..295ee07 100644
--- a/common/iotrace.c
+++ b/common/iotrace.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <mapmem.h>
+#include <time.h>
 #include <asm/io.h>
 #include <u-boot/crc.h>
 
diff --git a/drivers/clk/clk_stm32mp1.c b/drivers/clk/clk_stm32mp1.c
index e223f84..3718970 100644
--- a/drivers/clk/clk_stm32mp1.c
+++ b/drivers/clk/clk_stm32mp1.c
@@ -10,6 +10,7 @@
 #include <regmap.h>
 #include <spl.h>
 #include <syscon.h>
+#include <time.h>
 #include <vsprintf.h>
 #include <linux/io.h>
 #include <linux/iopoll.h>
diff --git a/drivers/mailbox/mailbox-uclass.c b/drivers/mailbox/mailbox-uclass.c
index 9fdb627..5968c9b 100644
--- a/drivers/mailbox/mailbox-uclass.c
+++ b/drivers/mailbox/mailbox-uclass.c
@@ -7,6 +7,7 @@
 #include <dm.h>
 #include <mailbox.h>
 #include <mailbox-uclass.h>
+#include <time.h>
 
 static inline struct mbox_ops *mbox_dev_ops(struct udevice *dev)
 {
diff --git a/drivers/misc/tegra186_bpmp.c b/drivers/misc/tegra186_bpmp.c
index b3ed03e..89e27dd 100644
--- a/drivers/misc/tegra186_bpmp.c
+++ b/drivers/misc/tegra186_bpmp.c
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <dm/lists.h>
 #include <dm/root.h>
 #include <mailbox.h>
diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c
index bc9ee95..39c93db 100644
--- a/drivers/mmc/bcm2835_sdhci.c
+++ b/drivers/mmc/bcm2835_sdhci.c
@@ -41,6 +41,7 @@
 #include <malloc.h>
 #include <memalign.h>
 #include <sdhci.h>
+#include <time.h>
 #include <asm/arch/msg.h>
 #include <asm/arch/mbox.h>
 #include <mach/sdhci.h>
diff --git a/drivers/mmc/mxcmmc.c b/drivers/mmc/mxcmmc.c
index dcf17c5..269882b 100644
--- a/drivers/mmc/mxcmmc.c
+++ b/drivers/mmc/mxcmmc.c
@@ -23,6 +23,7 @@
 #include <part.h>
 #include <malloc.h>
 #include <mmc.h>
+#include <time.h>
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
diff --git a/drivers/net/pic32_eth.c b/drivers/net/pic32_eth.c
index 5c706c0..b0f7677 100644
--- a/drivers/net/pic32_eth.c
+++ b/drivers/net/pic32_eth.c
@@ -9,6 +9,7 @@
 #include <net.h>
 #include <miiphy.h>
 #include <console.h>
+#include <time.h>
 #include <wait_bit.h>
 #include <asm/gpio.h>
 
diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
index f915817..cddcc2f 100644
--- a/drivers/nvme/nvme.c
+++ b/drivers/nvme/nvme.c
@@ -9,6 +9,7 @@
 #include <errno.h>
 #include <memalign.h>
 #include <pci.h>
+#include <time.h>
 #include <dm/device-internal.h>
 #include "nvme.h"
 
diff --git a/drivers/power/pmic/stpmic1.c b/drivers/power/pmic/stpmic1.c
index de31934..2297af4 100644
--- a/drivers/power/pmic/stpmic1.c
+++ b/drivers/power/pmic/stpmic1.c
@@ -9,6 +9,7 @@
 #include <i2c.h>
 #include <misc.h>
 #include <sysreset.h>
+#include <time.h>
 #include <dm/device.h>
 #include <dm/lists.h>
 #include <power/pmic.h>
diff --git a/drivers/sound/broadwell_i2s.c b/drivers/sound/broadwell_i2s.c
index 998792b..3d57740 100644
--- a/drivers/sound/broadwell_i2s.c
+++ b/drivers/sound/broadwell_i2s.c
@@ -12,6 +12,7 @@
 #include <common.h>
 #include <dm.h>
 #include <i2s.h>
+#include <time.h>
 #include <asm/io.h>
 #include "broadwell_i2s.h"
 
diff --git a/drivers/spi/ath79_spi.c b/drivers/spi/ath79_spi.c
index 2070692..0b8ebaa 100644
--- a/drivers/spi/ath79_spi.c
+++ b/drivers/spi/ath79_spi.c
@@ -8,6 +8,7 @@
 #include <dm.h>
 #include <div64.h>
 #include <errno.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/addrspace.h>
 #include <asm/types.h>
diff --git a/drivers/spi/exynos_spi.c b/drivers/spi/exynos_spi.c
index a9691c7..d682a11 100644
--- a/drivers/spi/exynos_spi.c
+++ b/drivers/spi/exynos_spi.c
@@ -10,6 +10,7 @@
 #include <malloc.h>
 #include <spi.h>
 #include <fdtdec.h>
+#include <time.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/cpu.h>
diff --git a/drivers/spi/rk_spi.c b/drivers/spi/rk_spi.c
index a68553b..c04535a 100644
--- a/drivers/spi/rk_spi.c
+++ b/drivers/spi/rk_spi.c
@@ -16,6 +16,7 @@
 #include <dt-structs.h>
 #include <errno.h>
 #include <spi.h>
+#include <time.h>
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/arch-rockchip/clock.h>
diff --git a/drivers/spi/tegra114_spi.c b/drivers/spi/tegra114_spi.c
index 5c35c22..bb34b20 100644
--- a/drivers/spi/tegra114_spi.c
+++ b/drivers/spi/tegra114_spi.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch-tegra/clk_rst.h>
diff --git a/drivers/spi/tegra20_sflash.c b/drivers/spi/tegra20_sflash.c
index 567e33f..0e68d33 100644
--- a/drivers/spi/tegra20_sflash.c
+++ b/drivers/spi/tegra20_sflash.c
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
 #include <asm/arch/clock.h>
diff --git a/drivers/spi/tegra20_slink.c b/drivers/spi/tegra20_slink.c
index d55e833..ae2fc3e 100644
--- a/drivers/spi/tegra20_slink.c
+++ b/drivers/spi/tegra20_slink.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch-tegra/clk_rst.h>
diff --git a/drivers/spi/tegra210_qspi.c b/drivers/spi/tegra210_qspi.c
index e4b8276..d82ecaa 100644
--- a/drivers/spi/tegra210_qspi.c
+++ b/drivers/spi/tegra210_qspi.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch-tegra/clk_rst.h>
diff --git a/drivers/spi/uniphier_spi.c b/drivers/spi/uniphier_spi.c
index ef02d07..e47b969 100644
--- a/drivers/spi/uniphier_spi.c
+++ b/drivers/spi/uniphier_spi.c
@@ -7,6 +7,7 @@
 #include <clk.h>
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <linux/bitfield.h>
 #include <linux/io.h>
 #include <spi.h>
diff --git a/drivers/spi/zynq_spi.c b/drivers/spi/zynq_spi.c
index 2a02942..0b2b2f4 100644
--- a/drivers/spi/zynq_spi.c
+++ b/drivers/spi/zynq_spi.c
@@ -10,6 +10,7 @@
 #include <dm.h>
 #include <malloc.h>
 #include <spi.h>
+#include <time.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/drivers/timer/tsc_timer.c b/drivers/timer/tsc_timer.c
index 637c8ff..0df551f 100644
--- a/drivers/timer/tsc_timer.c
+++ b/drivers/timer/tsc_timer.c
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <dm.h>
 #include <malloc.h>
+#include <time.h>
 #include <timer.h>
 #include <asm/cpu.h>
 #include <asm/io.h>
diff --git a/drivers/video/sunxi/sunxi_display.c b/drivers/video/sunxi/sunxi_display.c
index 46436b8..c45b3eb 100644
--- a/drivers/video/sunxi/sunxi_display.c
+++ b/drivers/video/sunxi/sunxi_display.c
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <efi_loader.h>
+#include <time.h>
 
 #include <asm/arch/clock.h>
 #include <asm/arch/display.h>
diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c
index 66a3191..c87c919 100644
--- a/drivers/video/sunxi/sunxi_dw_hdmi.c
+++ b/drivers/video/sunxi/sunxi_dw_hdmi.c
@@ -10,6 +10,7 @@
 #include <dm.h>
 #include <dw_hdmi.h>
 #include <edid.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/lcdc.h>
diff --git a/include/common.h b/include/common.h
index e68bed6..cc5f13e 100644
--- a/include/common.h
+++ b/include/common.h
@@ -3,8 +3,8 @@
  * Common header file for U-Boot
  *
  * This file still includes quite a bit of stuff that should be in separate
- * headers like command.h, cpu.h and timer.h. Please think before adding more
- * things. Patches to remove things are welcome.
+ * headers like command.h and cpu.h. Please think before adding more things.
+ * Patches to remove things are welcome.
  *
  * (C) Copyright 2000-2009
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
@@ -281,9 +281,6 @@
  */
 int cleanup_before_linux_select(int flags);
 
-/* arch/$(ARCH)/lib/ticks.S */
-uint64_t get_ticks(void);
-
 /* lib/uuid.c */
 #include <uuid.h>
 
diff --git a/include/time.h b/include/time.h
index 875a2b2..71446c3 100644
--- a/include/time.h
+++ b/include/time.h
@@ -103,4 +103,14 @@
  */
 unsigned long timer_get_us(void);
 
+/**
+ * get_ticks() - Get the current tick value
+ *
+ * This is an internal value used by the timer on the system. Ticks increase
+ * monotonically at the rate given by get_tbclk().
+ *
+ * @return current tick value
+ */
+uint64_t get_ticks(void);
+
 #endif /* _TIME_H */
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index ea52b95..265297e 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -9,6 +9,7 @@
 #include <div64.h>
 #include <efi_loader.h>
 #include <malloc.h>
+#include <time.h>
 #include <linux/libfdt_env.h>
 #include <u-boot/crc.h>
 #include <bootm.h>
diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index a55e4b3..218f7ca 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <charset.h>
+#include <time.h>
 #include <dm/device.h>
 #include <efi_loader.h>
 #include <env.h>
diff --git a/lib/time.c b/lib/time.c
index f30fc05..75de48f 100644
--- a/lib/time.c
+++ b/lib/time.c
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
+#include <time.h>
 #include <timer.h>
 #include <watchdog.h>
 #include <div64.h>
diff --git a/lib/trace.c b/lib/trace.c
index f2402b9..6716c7c 100644
--- a/lib/trace.c
+++ b/lib/trace.c
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <mapmem.h>
+#include <time.h>
 #include <trace.h>
 #include <asm/io.h>
 #include <asm/sections.h>
diff --git a/lib/uuid.c b/lib/uuid.c
index a48e19c..3d3c7ab 100644
--- a/lib/uuid.c
+++ b/lib/uuid.c
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <time.h>
 #include <linux/ctype.h>
 #include <errno.h>
 #include <common.h>
diff --git a/net/nfs.c b/net/nfs.c
index aca0ca5..97e62f1 100644
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -33,6 +33,7 @@
 #include <mapmem.h>
 #include "nfs.h"
 #include "bootp.h"
+#include <time.h>
 
 #define HASHES_PER_LINE 65	/* Number of "loading" hashes per line	*/
 #define NFS_RETRY_COUNT 30
diff --git a/post/post.c b/post/post.c
index fb751d9..f27138d 100644
--- a/post/post.c
+++ b/post/post.c
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <env.h>
 #include <stdio_dev.h>
+#include <time.h>
 #include <watchdog.h>
 #include <div64.h>
 #include <post.h>
diff --git a/test/time_ut.c b/test/time_ut.c
index 28c934e..40a19a5 100644
--- a/test/time_ut.c
+++ b/test/time_ut.c
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <command.h>
 #include <errno.h>
+#include <time.h>
 
 static int test_get_timer(void)
 {