[PATCH 05/16] common: Drop time.h from common header

Simon Glass sjg at chromium.org
Mon Aug 3 00:59:29 CEST 2020


Move this out of the common header and include it only where needed.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 api/api.c                                    | 1 +
 arch/arm/mach-at91/arm920t/clock.c           | 1 +
 arch/arm/mach-at91/arm926ejs/clock.c         | 1 +
 arch/arm/mach-at91/clock.c                   | 1 +
 arch/arm/mach-at91/phy.c                     | 1 +
 arch/arm/mach-bcm283x/mbox.c                 | 1 +
 arch/arm/mach-exynos/clock.c                 | 1 +
 arch/arm/mach-imx/i2c-mxv7.c                 | 1 +
 arch/arm/mach-imx/mx6/clock.c                | 1 +
 arch/arm/mach-imx/mx7/clock.c                | 1 +
 arch/arm/mach-omap2/omap3/am35x_musb.c       | 1 +
 arch/arm/mach-stm32mp/pwr_regulator.c        | 1 +
 arch/arm/mach-tegra/powergate.c              | 1 +
 arch/arm/mach-tegra/tegra124/xusb-padctl.c   | 1 +
 arch/arm/mach-tegra/tegra210/clock.c         | 1 +
 arch/arm/mach-tegra/tegra210/xusb-padctl.c   | 1 +
 arch/m68k/cpu/mcf547x_8x/slicetimer.c        | 1 +
 arch/mips/mach-mtmips/mt7628/init.c          | 1 +
 arch/mips/mach-octeon/clock.c                | 1 +
 arch/powerpc/lib/interrupts.c                | 1 +
 arch/x86/cpu/acpi_gpe.c                      | 1 +
 arch/x86/cpu/apollolake/punit.c              | 1 +
 arch/x86/cpu/intel_common/mrc.c              | 1 +
 arch/x86/cpu/mp_init.c                       | 1 +
 board/astro/mcf5373l/mcf5373l.c              | 1 +
 board/cobra5272/flash.c                      | 1 +
 board/freescale/m5253demo/flash.c            | 1 +
 board/gdsys/common/phy.c                     | 1 +
 board/nokia/rx51/rx51.c                      | 1 +
 board/sandbox/sandbox.c                      | 1 +
 board/theadorable/fpga.c                     | 1 +
 board/theadorable/theadorable.c              | 1 +
 cmd/gettime.c                                | 1 +
 cmd/mem.c                                    | 1 +
 cmd/misc.c                                   | 1 +
 cmd/sf.c                                     | 1 +
 cmd/tpm_test.c                               | 1 +
 common/command.c                             | 1 +
 common/dfu.c                                 | 1 +
 common/usb_hub.c                             | 1 +
 common/usb_kbd.c                             | 1 +
 common/xyzModem.c                            | 1 +
 drivers/ata/ahci.c                           | 1 +
 drivers/ata/sata_mv.c                        | 1 +
 drivers/ddr/altera/sdram_soc64.c             | 1 +
 drivers/dma/lpc32xx_dma.c                    | 1 +
 drivers/fpga/ACEX1K.c                        | 1 +
 drivers/fpga/cyclon2.c                       | 1 +
 drivers/fpga/socfpga_arria10.c               | 1 +
 drivers/fpga/spartan2.c                      | 1 +
 drivers/fpga/spartan3.c                      | 1 +
 drivers/fpga/stratix10.c                     | 1 +
 drivers/fpga/virtex2.c                       | 1 +
 drivers/fpga/zynqpl.c                        | 1 +
 drivers/hwspinlock/hwspinlock-uclass.c       | 1 +
 drivers/i2c/at91_i2c.c                       | 1 +
 drivers/i2c/designware_i2c.c                 | 1 +
 drivers/i2c/i2c-cortina.c                    | 1 +
 drivers/i2c/imx_lpi2c.c                      | 1 +
 drivers/i2c/intel_i2c.c                      | 1 +
 drivers/i2c/meson_i2c.c                      | 1 +
 drivers/i2c/muxes/i2c-arb-gpio-challenge.c   | 1 +
 drivers/i2c/mxc_i2c.c                        | 1 +
 drivers/i2c/nx_i2c.c                         | 1 +
 drivers/i2c/octeon_i2c.c                     | 1 +
 drivers/i2c/rk_i2c.c                         | 1 +
 drivers/i2c/s3c24x0_i2c.c                    | 1 +
 drivers/i2c/stm32f7_i2c.c                    | 1 +
 drivers/input/input.c                        | 1 +
 drivers/input/tegra-kbc.c                    | 1 +
 drivers/misc/cros_ec.c                       | 1 +
 drivers/misc/cros_ec_lpc.c                   | 1 +
 drivers/misc/cros_ec_sandbox.c               | 1 +
 drivers/misc/cros_ec_spi.c                   | 1 +
 drivers/mmc/am654_sdhci.c                    | 1 +
 drivers/mmc/bcm2835_sdhost.c                 | 1 +
 drivers/mmc/dw_mmc.c                         | 1 +
 drivers/mmc/fsl_esdhc.c                      | 1 +
 drivers/mmc/fsl_esdhc_imx.c                  | 1 +
 drivers/mmc/ftsdc010_mci.c                   | 1 +
 drivers/mmc/meson_gx_mmc.c                   | 1 +
 drivers/mmc/mmc.c                            | 1 +
 drivers/mmc/mvebu_mmc.c                      | 1 +
 drivers/mmc/omap_hsmmc.c                     | 1 +
 drivers/mmc/sdhci.c                          | 1 +
 drivers/mmc/sunxi_mmc.c                      | 1 +
 drivers/mmc/tegra_mmc.c                      | 1 +
 drivers/mtd/cfi_flash.c                      | 1 +
 drivers/mtd/nand/raw/brcmnand/brcmnand.c     | 1 +
 drivers/mtd/nand/raw/fsl_elbc_nand.c         | 1 +
 drivers/mtd/nand/raw/fsl_ifc_nand.c          | 1 +
 drivers/mtd/nand/raw/fsmc_nand.c             | 1 +
 drivers/mtd/nand/raw/mxs_nand_spl.c          | 1 +
 drivers/mtd/nand/raw/nand_base.c             | 1 +
 drivers/mtd/nand/raw/pxa3xx_nand.c           | 1 +
 drivers/mtd/nand/raw/sunxi_nand.c            | 1 +
 drivers/mtd/nand/raw/vf610_nfc.c             | 1 +
 drivers/mtd/nand/spi/core.c                  | 1 +
 drivers/mtd/onenand/onenand_base.c           | 1 +
 drivers/mtd/spi/sf_dataflash.c               | 1 +
 drivers/mtd/spi/spi-nor-core.c               | 1 +
 drivers/mtd/spi/spi-nor-tiny.c               | 1 +
 drivers/mtd/st_smi.c                         | 1 +
 drivers/net/ag7xxx.c                         | 1 +
 drivers/net/altera_tse.c                     | 1 +
 drivers/net/cs8900.c                         | 1 +
 drivers/net/designware.c                     | 1 +
 drivers/net/dm9000x.c                        | 1 +
 drivers/net/ethoc.c                          | 1 +
 drivers/net/fec_mxc.c                        | 1 +
 drivers/net/ftmac100.c                       | 1 +
 drivers/net/ftmac110.c                       | 1 +
 drivers/net/lan91c96.c                       | 1 +
 drivers/net/ldpaa_eth/ldpaa_eth.c            | 1 +
 drivers/net/mtk_eth.c                        | 1 +
 drivers/net/ne2000_base.c                    | 1 +
 drivers/net/pch_gbe.c                        | 1 +
 drivers/net/ravb.c                           | 1 +
 drivers/net/rtl8169.c                        | 1 +
 drivers/net/sandbox.c                        | 1 +
 drivers/net/smc91111.c                       | 1 +
 drivers/net/sun8i_emac.c                     | 1 +
 drivers/net/xilinx_emaclite.c                | 1 +
 drivers/pci/pci_rom.c                        | 1 +
 drivers/pci/pci_tegra.c                      | 1 +
 drivers/pci/pcie_dw_mvebu.c                  | 1 +
 drivers/pci/pcie_dw_ti.c                     | 1 +
 drivers/phy/phy-da8xx-usb.c                  | 1 +
 drivers/power/exynos-tmu.c                   | 1 +
 drivers/power/regulator/tps65090_regulator.c | 1 +
 drivers/ram/rockchip/dmc-rk3368.c            | 1 +
 drivers/ram/stm32mp1/stm32mp1_interactive.c  | 1 +
 drivers/rng/sandbox_rng.c                    | 1 +
 drivers/rtc/rv3029.c                         | 1 +
 drivers/sound/samsung-i2s.c                  | 1 +
 drivers/sound/tegra_ahub.c                   | 1 +
 drivers/spi/altera_spi.c                     | 1 +
 drivers/spi/cadence_qspi_apb.c               | 1 +
 drivers/spi/ich.c                            | 1 +
 drivers/spi/mpc8xxx_spi.c                    | 1 +
 drivers/spi/mxc_spi.c                        | 1 +
 drivers/spi/omap3_spi.c                      | 1 +
 drivers/spi/pic32_spi.c                      | 1 +
 drivers/spi/zynq_qspi.c                      | 1 +
 drivers/timer/sandbox_timer.c                | 1 +
 drivers/tpm/cr50_i2c.c                       | 1 +
 drivers/tpm/tpm-uclass.c                     | 1 +
 drivers/tpm/tpm2_tis_spi.c                   | 1 +
 drivers/tpm/tpm_atmel_twi.c                  | 1 +
 drivers/tpm/tpm_tis_infineon.c               | 1 +
 drivers/tpm/tpm_tis_st33zp24_i2c.c           | 1 +
 drivers/tpm/tpm_tis_st33zp24_spi.c           | 1 +
 drivers/ufs/ufs.c                            | 1 +
 drivers/usb/eth/smsc95xx.c                   | 1 +
 drivers/usb/gadget/ether.c                   | 1 +
 drivers/usb/gadget/fotg210.c                 | 1 +
 drivers/usb/gadget/pxa25x_udc.c              | 1 +
 drivers/usb/host/dwc2.c                      | 1 +
 drivers/usb/host/ehci-hcd.c                  | 1 +
 drivers/usb/host/ehci-omap.c                 | 1 +
 drivers/usb/host/ohci-da8xx.c                | 1 +
 drivers/usb/host/sl811-hcd.c                 | 1 +
 drivers/usb/host/xhci-ring.c                 | 1 +
 drivers/usb/musb-new/am35x.c                 | 1 +
 drivers/usb/musb-new/musb_dsps.c             | 1 +
 drivers/usb/musb-new/musb_uboot.c            | 1 +
 drivers/usb/musb-new/omap2430.c              | 1 +
 drivers/video/broadwell_igd.c                | 1 +
 drivers/video/dw_hdmi.c                      | 1 +
 drivers/video/rockchip/rk_edp.c              | 1 +
 drivers/video/tegra124/display.c             | 1 +
 drivers/video/tegra124/dp.c                  | 1 +
 drivers/video/tegra124/sor.c                 | 1 +
 drivers/video/video-uclass.c                 | 1 +
 drivers/watchdog/sbsa_gwdt.c                 | 1 +
 fs/fs.c                                      | 1 +
 fs/ubifs/debug.c                             | 1 +
 include/cli.h                                | 2 ++
 include/common.h                             | 1 -
 include/exports.h                            | 1 +
 include/regmap.h                             | 1 +
 include/virtio.h                             | 2 ++
 lib/dhry/cmd_dhry.c                          | 1 +
 net/arp.c                                    | 1 +
 net/bootp.c                                  | 1 +
 net/dns.c                                    | 1 +
 net/fastboot.c                               | 1 +
 net/link_local.c                             | 1 +
 net/net.c                                    | 1 +
 net/sntp.c                                   | 1 +
 net/tftp.c                                   | 1 +
 post/drivers/rtc.c                           | 1 +
 test/dm/regmap.c                             | 1 +
 193 files changed, 194 insertions(+), 1 deletion(-)

diff --git a/api/api.c b/api/api.c
index c7f5db776af..2e955f7baf2 100644
--- a/api/api.c
+++ b/api/api.c
@@ -11,6 +11,7 @@
 #include <env.h>
 #include <malloc.h>
 #include <env_internal.h>
+#include <time.h>
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <api_public.h>
diff --git a/arch/arm/mach-at91/arm920t/clock.c b/arch/arm/mach-at91/arm920t/clock.c
index c7440278d8f..2c8fbe6d284 100644
--- a/arch/arm/mach-at91/arm920t/clock.c
+++ b/arch/arm/mach-at91/arm920t/clock.c
@@ -8,6 +8,7 @@
  * Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
  */
 #include <common.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
diff --git a/arch/arm/mach-at91/arm926ejs/clock.c b/arch/arm/mach-at91/arm926ejs/clock.c
index c68e0c0c3c4..9b97987fecb 100644
--- a/arch/arm/mach-at91/arm926ejs/clock.c
+++ b/arch/arm/mach-at91/arm926ejs/clock.c
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index 8344daeb39a..5b8ce52f5c1 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <wdt.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
diff --git a/arch/arm/mach-at91/phy.c b/arch/arm/mach-at91/phy.c
index 6101eee3589..b68e4bd355f 100644
--- a/arch/arm/mach-at91/phy.c
+++ b/arch/arm/mach-at91/phy.c
@@ -12,6 +12,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/hardware.h>
 #include <asm/io.h>
 #include <linux/delay.h>
diff --git a/arch/arm/mach-bcm283x/mbox.c b/arch/arm/mach-bcm283x/mbox.c
index da9faafe1dd..940699337f1 100644
--- a/arch/arm/mach-bcm283x/mbox.c
+++ b/arch/arm/mach-bcm283x/mbox.c
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <cpu_func.h>
 #include <log.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <asm/io.h>
 #include <asm/arch/base.h>
diff --git a/arch/arm/mach-exynos/clock.c b/arch/arm/mach-exynos/clock.c
index ef48d35aa4c..6c21fd642cd 100644
--- a/arch/arm/mach-exynos/clock.c
+++ b/arch/arm/mach-exynos/clock.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <log.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/clk.h>
diff --git a/arch/arm/mach-imx/i2c-mxv7.c b/arch/arm/mach-imx/i2c-mxv7.c
index e6c74bf77e9..5e3d79b887f 100644
--- a/arch/arm/mach-imx/i2c-mxv7.c
+++ b/arch/arm/mach-imx/i2c-mxv7.c
@@ -4,6 +4,7 @@
  */
 #include <common.h>
 #include <malloc.h>
+#include <time.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/imx-regs.h>
 #include <linux/delay.h>
diff --git a/arch/arm/mach-imx/mx6/clock.c b/arch/arm/mach-imx/mx6/clock.c
index fb5e5b6f05c..c40d8855125 100644
--- a/arch/arm/mach-imx/mx6/clock.c
+++ b/arch/arm/mach-imx/mx6/clock.c
@@ -7,6 +7,7 @@
 #include <command.h>
 #include <div64.h>
 #include <log.h>
+#include <time.h>
 #include <asm/io.h>
 #include <linux/errno.h>
 #include <asm/arch/imx-regs.h>
diff --git a/arch/arm/mach-imx/mx7/clock.c b/arch/arm/mach-imx/mx7/clock.c
index b1d7290704a..56e0cfa9887 100644
--- a/arch/arm/mach-imx/mx7/clock.c
+++ b/arch/arm/mach-imx/mx7/clock.c
@@ -11,6 +11,7 @@
 #include <command.h>
 #include <div64.h>
 #include <log.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <linux/errno.h>
diff --git a/arch/arm/mach-omap2/omap3/am35x_musb.c b/arch/arm/mach-omap2/omap3/am35x_musb.c
index 95e15c1a51b..ada70743a33 100644
--- a/arch/arm/mach-omap2/omap3/am35x_musb.c
+++ b/arch/arm/mach-omap2/omap3/am35x_musb.c
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <dm.h>
 #include <log.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/am35x_def.h>
 
diff --git a/arch/arm/mach-stm32mp/pwr_regulator.c b/arch/arm/mach-stm32mp/pwr_regulator.c
index 900dee4c38a..eb024b85116 100644
--- a/arch/arm/mach-stm32mp/pwr_regulator.c
+++ b/arch/arm/mach-stm32mp/pwr_regulator.c
@@ -7,6 +7,7 @@
 #include <dm.h>
 #include <errno.h>
 #include <syscon.h>
+#include <time.h>
 #include <asm/io.h>
 #include <dm/device_compat.h>
 #include <linux/bitops.h>
diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index 631bc04e950..c5ced7e3f38 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <errno.h>
+#include <time.h>
 #include <linux/delay.h>
 
 #include <asm/io.h>
diff --git a/arch/arm/mach-tegra/tegra124/xusb-padctl.c b/arch/arm/mach-tegra/tegra124/xusb-padctl.c
index 5b88d6e5e7b..a1136f1558b 100644
--- a/arch/arm/mach-tegra/tegra124/xusb-padctl.c
+++ b/arch/arm/mach-tegra/tegra124/xusb-padctl.c
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <errno.h>
 #include <log.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <dm/of_access.h>
 #include <dm/ofnode.h>
diff --git a/arch/arm/mach-tegra/tegra210/clock.c b/arch/arm/mach-tegra/tegra210/clock.c
index ccc64eb77b4..711d02c036f 100644
--- a/arch/arm/mach-tegra/tegra210/clock.c
+++ b/arch/arm/mach-tegra/tegra210/clock.c
@@ -10,6 +10,7 @@
 #include <errno.h>
 #include <init.h>
 #include <log.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
diff --git a/arch/arm/mach-tegra/tegra210/xusb-padctl.c b/arch/arm/mach-tegra/tegra210/xusb-padctl.c
index 30d0395bb0e..0af6e256ad1 100644
--- a/arch/arm/mach-tegra/tegra210/xusb-padctl.c
+++ b/arch/arm/mach-tegra/tegra210/xusb-padctl.c
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <errno.h>
 #include <log.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <dm/of_access.h>
 #include <dm/ofnode.h>
diff --git a/arch/m68k/cpu/mcf547x_8x/slicetimer.c b/arch/m68k/cpu/mcf547x_8x/slicetimer.c
index dc076fc6e81..49f246b62e1 100644
--- a/arch/m68k/cpu/mcf547x_8x/slicetimer.c
+++ b/arch/m68k/cpu/mcf547x_8x/slicetimer.c
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <init.h>
 #include <irq_func.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <linux/delay.h>
 
diff --git a/arch/mips/mach-mtmips/mt7628/init.c b/arch/mips/mach-mtmips/mt7628/init.c
index 27241050aaf..3fa0e139e75 100644
--- a/arch/mips/mach-mtmips/mt7628/init.c
+++ b/arch/mips/mach-mtmips/mt7628/init.c
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <clk.h>
 #include <dm.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <dm/uclass.h>
 #include <dt-bindings/clock/mt7628-clk.h>
diff --git a/arch/mips/mach-octeon/clock.c b/arch/mips/mach-octeon/clock.c
index 119b3ac50b4..8984bfd7445 100644
--- a/arch/mips/mach-octeon/clock.c
+++ b/arch/mips/mach-octeon/clock.c
@@ -3,6 +3,7 @@
  * Copyright (C) 2018, 2019 Marvell International Ltd.
  */
 
+#include <time.h>
 #include <asm/global_data.h>
 #include <mach/clock.h>
 
diff --git a/arch/powerpc/lib/interrupts.c b/arch/powerpc/lib/interrupts.c
index bda0999327d..14f32cbd937 100644
--- a/arch/powerpc/lib/interrupts.c
+++ b/arch/powerpc/lib/interrupts.c
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <irq_func.h>
+#include <time.h>
 #include <asm/processor.h>
 #include <watchdog.h>
 #ifdef CONFIG_LED_STATUS
diff --git a/arch/x86/cpu/acpi_gpe.c b/arch/x86/cpu/acpi_gpe.c
index 70badb15a3b..9baf4f65b36 100644
--- a/arch/x86/cpu/acpi_gpe.c
+++ b/arch/x86/cpu/acpi_gpe.c
@@ -8,6 +8,7 @@
 #include <dm.h>
 #include <irq.h>
 #include <log.h>
+#include <time.h>
 #include <acpi/acpi_device.h>
 #include <asm/io.h>
 #include <dt-bindings/interrupt-controller/irq.h>
diff --git a/arch/x86/cpu/apollolake/punit.c b/arch/x86/cpu/apollolake/punit.c
index e76f2805d7f..3514ba21591 100644
--- a/arch/x86/cpu/apollolake/punit.c
+++ b/arch/x86/cpu/apollolake/punit.c
@@ -7,6 +7,7 @@
 #include <dm.h>
 #include <log.h>
 #include <spl.h>
+#include <time.h>
 #include <asm/cpu.h>
 #include <asm/cpu_common.h>
 #include <asm/intel_regs.h>
diff --git a/arch/x86/cpu/intel_common/mrc.c b/arch/x86/cpu/intel_common/mrc.c
index a97b0b7ceb4..eb27f8f1883 100644
--- a/arch/x86/cpu/intel_common/mrc.c
+++ b/arch/x86/cpu/intel_common/mrc.c
@@ -8,6 +8,7 @@
 #include <init.h>
 #include <log.h>
 #include <syscon.h>
+#include <time.h>
 #include <asm/cpu.h>
 #include <asm/global_data.h>
 #include <asm/gpio.h>
diff --git a/arch/x86/cpu/mp_init.c b/arch/x86/cpu/mp_init.c
index 03bd71c261a..bd656d09520 100644
--- a/arch/x86/cpu/mp_init.c
+++ b/arch/x86/cpu/mp_init.c
@@ -12,6 +12,7 @@
 #include <log.h>
 #include <malloc.h>
 #include <qfw.h>
+#include <time.h>
 #include <asm/atomic.h>
 #include <asm/cpu.h>
 #include <asm/global_data.h>
diff --git a/board/astro/mcf5373l/mcf5373l.c b/board/astro/mcf5373l/mcf5373l.c
index 3e2f79a1cf4..cb336fca046 100644
--- a/board/astro/mcf5373l/mcf5373l.c
+++ b/board/astro/mcf5373l/mcf5373l.c
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <init.h>
 #include <serial.h>
+#include <time.h>
 #include <watchdog.h>
 #include <command.h>
 #include <asm/global_data.h>
diff --git a/board/cobra5272/flash.c b/board/cobra5272/flash.c
index 4337f4879de..9aa8f118baf 100644
--- a/board/cobra5272/flash.c
+++ b/board/cobra5272/flash.c
@@ -9,6 +9,7 @@
 #include <cpu_func.h>
 #include <flash.h>
 #include <irq_func.h>
+#include <time.h>
 #include <uuid.h>
 #include <linux/delay.h>
 
diff --git a/board/freescale/m5253demo/flash.c b/board/freescale/m5253demo/flash.c
index 31974217816..d37ba362b6c 100644
--- a/board/freescale/m5253demo/flash.c
+++ b/board/freescale/m5253demo/flash.c
@@ -11,6 +11,7 @@
 #include <flash.h>
 #include <init.h>
 #include <irq_func.h>
+#include <time.h>
 
 #include <asm/immap.h>
 
diff --git a/board/gdsys/common/phy.c b/board/gdsys/common/phy.c
index 516f4e8edca..a4104a9d202 100644
--- a/board/gdsys/common/phy.c
+++ b/board/gdsys/common/phy.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <log.h>
+#include <time.h>
 
 #include <miiphy.h>
 
diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
index 65be1719c2c..5cf6a54dc60 100644
--- a/board/nokia/rx51/rx51.c
+++ b/board/nokia/rx51/rx51.c
@@ -24,6 +24,7 @@
 #include <common.h>
 #include <env.h>
 #include <init.h>
+#include <time.h>
 #include <watchdog.h>
 #include <malloc.h>
 #include <twl4030.h>
diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c
index c78e90accbc..b1bed64910c 100644
--- a/board/sandbox/sandbox.c
+++ b/board/sandbox/sandbox.c
@@ -11,6 +11,7 @@
 #include <init.h>
 #include <led.h>
 #include <os.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/test.h>
 #include <asm/u-boot-sandbox.h>
diff --git a/board/theadorable/fpga.c b/board/theadorable/fpga.c
index bc8379cccf6..3a33e15eacc 100644
--- a/board/theadorable/fpga.c
+++ b/board/theadorable/fpga.c
@@ -7,6 +7,7 @@
 #include <altera.h>
 #include <errno.h>
 #include <log.h>
+#include <time.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
diff --git a/board/theadorable/theadorable.c b/board/theadorable/theadorable.c
index 3c4133083f5..fb3d1fc4260 100644
--- a/board/theadorable/theadorable.c
+++ b/board/theadorable/theadorable.c
@@ -13,6 +13,7 @@
 #if !defined(CONFIG_SPL_BUILD)
 #include <bootcount.h>
 #endif
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
diff --git a/cmd/gettime.c b/cmd/gettime.c
index 2e74e02b499..ebaa45812a6 100644
--- a/cmd/gettime.c
+++ b/cmd/gettime.c
@@ -13,6 +13,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <time.h>
 
 static int do_gettime(struct cmd_tbl *cmdtp, int flag, int argc,
 		      char *const argv[])
diff --git a/cmd/mem.c b/cmd/mem.c
index a9360860d2c..5578dea97ec 100644
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -22,6 +22,7 @@
 #include <log.h>
 #include <mapmem.h>
 #include <rand.h>
+#include <time.h>
 #include <watchdog.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
diff --git a/cmd/misc.c b/cmd/misc.c
index 20ab943494e..36bca24fb20 100644
--- a/cmd/misc.c
+++ b/cmd/misc.c
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <command.h>
 #include <console.h>
+#include <time.h>
 #include <linux/delay.h>
 
 static int do_sleep(struct cmd_tbl *cmdtp, int flag, int argc,
diff --git a/cmd/sf.c b/cmd/sf.c
index b3ff4b5773c..249e2eee377 100644
--- a/cmd/sf.c
+++ b/cmd/sf.c
@@ -16,6 +16,7 @@
 #include <mapmem.h>
 #include <spi.h>
 #include <spi_flash.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <jffs2/jffs2.h>
 #include <linux/mtd/mtd.h>
diff --git a/cmd/tpm_test.c b/cmd/tpm_test.c
index d7044336ff2..fbaa1de66ee 100644
--- a/cmd/tpm_test.c
+++ b/cmd/tpm_test.c
@@ -7,6 +7,7 @@
 #include <command.h>
 #include <cpu_func.h>
 #include <log.h>
+#include <time.h>
 #include <tpm-v1.h>
 #include <linux/printk.h>
 #include "tpm-user-utils.h"
diff --git a/common/command.c b/common/command.c
index 6a87bb54abf..5cadf732e96 100644
--- a/common/command.c
+++ b/common/command.c
@@ -14,6 +14,7 @@
 #include <console.h>
 #include <env.h>
 #include <log.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <linux/ctype.h>
 
diff --git a/common/dfu.c b/common/dfu.c
index c879e8d6a8f..75fd3e088ef 100644
--- a/common/dfu.c
+++ b/common/dfu.c
@@ -13,6 +13,7 @@
 #include <common.h>
 #include <command.h>
 #include <log.h>
+#include <time.h>
 #include <watchdog.h>
 #include <dfu.h>
 #include <console.h>
diff --git a/common/usb_hub.c b/common/usb_hub.c
index e578f0be284..af088bd7289 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -29,6 +29,7 @@
 #include <log.h>
 #include <malloc.h>
 #include <memalign.h>
+#include <time.h>
 #include <asm/processor.h>
 #include <asm/unaligned.h>
 #include <linux/ctype.h>
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index b316807844b..3a81a305995 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -15,6 +15,7 @@
 #include <malloc.h>
 #include <memalign.h>
 #include <stdio_dev.h>
+#include <time.h>
 #include <watchdog.h>
 #include <asm/byteorder.h>
 
diff --git a/common/xyzModem.c b/common/xyzModem.c
index 6bf2375671d..e8eb578f696 100644
--- a/common/xyzModem.c
+++ b/common/xyzModem.c
@@ -22,6 +22,7 @@
  *==========================================================================
  */
 #include <common.h>
+#include <time.h>
 #include <xyzModem.h>
 #include <stdarg.h>
 #include <u-boot/crc.h>
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 47cdea1f586..f251ee1b74a 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -12,6 +12,7 @@
 #include <blk.h>
 #include <cpu_func.h>
 #include <log.h>
+#include <time.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
 
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 9021a00cdb6..8071fe18a71 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -37,6 +37,7 @@
 #include <cpu_func.h>
 #include <dm.h>
 #include <log.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <asm/global_data.h>
 #include <dm/device-internal.h>
diff --git a/drivers/ddr/altera/sdram_soc64.c b/drivers/ddr/altera/sdram_soc64.c
index 40fcc8d2e0f..66dad034fa2 100644
--- a/drivers/ddr/altera/sdram_soc64.c
+++ b/drivers/ddr/altera/sdram_soc64.c
@@ -15,6 +15,7 @@
 #include <log.h>
 #include <ram.h>
 #include <reset.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include "sdram_soc64.h"
 #include <wait_bit.h>
diff --git a/drivers/dma/lpc32xx_dma.c b/drivers/dma/lpc32xx_dma.c
index 0efdfd028cf..3fd56053fae 100644
--- a/drivers/dma/lpc32xx_dma.c
+++ b/drivers/dma/lpc32xx_dma.c
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <errno.h>
 #include <init.h>
+#include <time.h>
 #include <asm/arch/dma.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/clk.h>
diff --git a/drivers/fpga/ACEX1K.c b/drivers/fpga/ACEX1K.c
index 30a3727433e..6c5097d94c7 100644
--- a/drivers/fpga/ACEX1K.c
+++ b/drivers/fpga/ACEX1K.c
@@ -10,6 +10,7 @@
 #include <common.h>		/* core U-Boot definitions */
 #include <console.h>
 #include <ACEX1K.h>		/* ACEX device family */
+#include <time.h>
 #include <linux/delay.h>
 
 /* Define FPGA_DEBUG to get debug printf's */
diff --git a/drivers/fpga/cyclon2.c b/drivers/fpga/cyclon2.c
index 3b008facb8c..477379449ed 100644
--- a/drivers/fpga/cyclon2.c
+++ b/drivers/fpga/cyclon2.c
@@ -8,6 +8,7 @@
 #include <common.h>		/* core U-Boot definitions */
 #include <altera.h>
 #include <ACEX1K.h>		/* ACEX device family */
+#include <time.h>
 #include <linux/delay.h>
 
 /* Define FPGA_DEBUG to get debug printf's */
diff --git a/drivers/fpga/socfpga_arria10.c b/drivers/fpga/socfpga_arria10.c
index 92e6bd1c34f..46018ebe7c6 100644
--- a/drivers/fpga/socfpga_arria10.c
+++ b/drivers/fpga/socfpga_arria10.c
@@ -4,6 +4,7 @@
  */
 #include <image.h>
 #include <log.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/arch/fpga_manager.h>
diff --git a/drivers/fpga/spartan2.c b/drivers/fpga/spartan2.c
index fae94f9663a..355104f77d9 100644
--- a/drivers/fpga/spartan2.c
+++ b/drivers/fpga/spartan2.c
@@ -6,6 +6,7 @@
 
 #include <common.h>		/* core U-Boot definitions */
 #include <spartan2.h>		/* Spartan-II device family */
+#include <time.h>
 
 /* Define FPGA_DEBUG to get debug printf's */
 #ifdef	FPGA_DEBUG
diff --git a/drivers/fpga/spartan3.c b/drivers/fpga/spartan3.c
index e40e427a25f..95a361b0e86 100644
--- a/drivers/fpga/spartan3.c
+++ b/drivers/fpga/spartan3.c
@@ -11,6 +11,7 @@
 
 #include <common.h>		/* core U-Boot definitions */
 #include <spartan3.h>		/* Spartan-II device family */
+#include <time.h>
 
 /* Define FPGA_DEBUG to get debug printf's */
 #ifdef	FPGA_DEBUG
diff --git a/drivers/fpga/stratix10.c b/drivers/fpga/stratix10.c
index da8fa315e36..bae31c3db1e 100644
--- a/drivers/fpga/stratix10.c
+++ b/drivers/fpga/stratix10.c
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <altera.h>
 #include <log.h>
+#include <time.h>
 #include <asm/arch/mailbox_s10.h>
 #include <linux/delay.h>
 
diff --git a/drivers/fpga/virtex2.c b/drivers/fpga/virtex2.c
index b3e0537bab0..aae9250f198 100644
--- a/drivers/fpga/virtex2.c
+++ b/drivers/fpga/virtex2.c
@@ -14,6 +14,7 @@
 
 #include <common.h>
 #include <console.h>
+#include <time.h>
 #include <virtex2.h>
 #include <linux/delay.h>
 
diff --git a/drivers/fpga/zynqpl.c b/drivers/fpga/zynqpl.c
index a11e4855253..86df6fa32d4 100644
--- a/drivers/fpga/zynqpl.c
+++ b/drivers/fpga/zynqpl.c
@@ -10,6 +10,7 @@
 #include <console.h>
 #include <cpu_func.h>
 #include <log.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <asm/io.h>
 #include <fs.h>
diff --git a/drivers/hwspinlock/hwspinlock-uclass.c b/drivers/hwspinlock/hwspinlock-uclass.c
index fdc90c3f0e0..6100fdfd0a5 100644
--- a/drivers/hwspinlock/hwspinlock-uclass.c
+++ b/drivers/hwspinlock/hwspinlock-uclass.c
@@ -8,6 +8,7 @@
 #include <errno.h>
 #include <hwspinlock.h>
 #include <log.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <dm/device-internal.h>
 #include <dm/device_compat.h>
diff --git a/drivers/i2c/at91_i2c.c b/drivers/i2c/at91_i2c.c
index ee5dc1db96c..57fbb0ce262 100644
--- a/drivers/i2c/at91_i2c.c
+++ b/drivers/i2c/at91_i2c.c
@@ -6,6 +6,7 @@
  */
 
 #include <malloc.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <common.h>
diff --git a/drivers/i2c/designware_i2c.c b/drivers/i2c/designware_i2c.c
index cf892c69d9f..6cd5d517de7 100644
--- a/drivers/i2c/designware_i2c.c
+++ b/drivers/i2c/designware_i2c.c
@@ -12,6 +12,7 @@
 #include <malloc.h>
 #include <pci.h>
 #include <reset.h>
+#include <time.h>
 #include <asm/io.h>
 #include <linux/delay.h>
 #include "designware_i2c.h"
diff --git a/drivers/i2c/i2c-cortina.c b/drivers/i2c/i2c-cortina.c
index 036fc4282b5..4129d6a6888 100644
--- a/drivers/i2c/i2c-cortina.c
+++ b/drivers/i2c/i2c-cortina.c
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <i2c.h>
 #include <log.h>
+#include <time.h>
 #include <asm/io.h>
 #include <dm.h>
 #include <mapmem.h>
diff --git a/drivers/i2c/imx_lpi2c.c b/drivers/i2c/imx_lpi2c.c
index feeed1e9a2f..b02f3883b0d 100644
--- a/drivers/i2c/imx_lpi2c.c
+++ b/drivers/i2c/imx_lpi2c.c
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <errno.h>
 #include <log.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/imx-regs.h>
diff --git a/drivers/i2c/intel_i2c.c b/drivers/i2c/intel_i2c.c
index 3b79cb40cd3..a7ac09a27e5 100644
--- a/drivers/i2c/intel_i2c.c
+++ b/drivers/i2c/intel_i2c.c
@@ -12,6 +12,7 @@
 #include <i2c.h>
 #include <log.h>
 #include <pci.h>
+#include <time.h>
 #include <asm/io.h>
 
 /* PCI Configuration Space (D31:F3): SMBus */
diff --git a/drivers/i2c/meson_i2c.c b/drivers/i2c/meson_i2c.c
index e070caf43f2..b133aa1175e 100644
--- a/drivers/i2c/meson_i2c.c
+++ b/drivers/i2c/meson_i2c.c
@@ -4,6 +4,7 @@
  */
 #include <common.h>
 #include <log.h>
+#include <time.h>
 #include <asm/io.h>
 #include <clk.h>
 #include <dm.h>
diff --git a/drivers/i2c/muxes/i2c-arb-gpio-challenge.c b/drivers/i2c/muxes/i2c-arb-gpio-challenge.c
index 4be32a1b38c..567660f9a74 100644
--- a/drivers/i2c/muxes/i2c-arb-gpio-challenge.c
+++ b/drivers/i2c/muxes/i2c-arb-gpio-challenge.c
@@ -10,6 +10,7 @@
 #include <i2c.h>
 #include <log.h>
 #include <malloc.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/gpio.h>
 #include <linux/delay.h>
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index c1204815c20..e4e50436379 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -16,6 +16,7 @@
 
 #include <common.h>
 #include <log.h>
+#include <time.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/global_data.h>
diff --git a/drivers/i2c/nx_i2c.c b/drivers/i2c/nx_i2c.c
index ca14a0ecac7..af58c2c76ef 100644
--- a/drivers/i2c/nx_i2c.c
+++ b/drivers/i2c/nx_i2c.c
@@ -3,6 +3,7 @@
 #include <dm.h>
 #include <i2c.h>
 #include <log.h>
+#include <time.h>
 #include <asm/arch/nexell.h>
 #include <asm/arch/reset.h>
 #include <asm/arch/clk.h>
diff --git a/drivers/i2c/octeon_i2c.c b/drivers/i2c/octeon_i2c.c
index c11d6ff93d1..ef04ae5698a 100644
--- a/drivers/i2c/octeon_i2c.c
+++ b/drivers/i2c/octeon_i2c.c
@@ -8,6 +8,7 @@
 #include <dm.h>
 #include <i2c.h>
 #include <pci_ids.h>
+#include <time.h>
 #include <asm/io.h>
 #include <linux/bitfield.h>
 #include <linux/compat.h>
diff --git a/drivers/i2c/rk_i2c.c b/drivers/i2c/rk_i2c.c
index 659461088b7..81d8e1eb11d 100644
--- a/drivers/i2c/rk_i2c.c
+++ b/drivers/i2c/rk_i2c.c
@@ -12,6 +12,7 @@
 #include <errno.h>
 #include <i2c.h>
 #include <log.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch-rockchip/clock.h>
 #include <asm/arch-rockchip/i2c.h>
diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c
index 43699fc2410..0fe92fe2357 100644
--- a/drivers/i2c/s3c24x0_i2c.c
+++ b/drivers/i2c/s3c24x0_i2c.c
@@ -16,6 +16,7 @@
 #else
 #include <asm/arch/s3c24x0_cpu.h>
 #endif
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <i2c.h>
diff --git a/drivers/i2c/stm32f7_i2c.c b/drivers/i2c/stm32f7_i2c.c
index 6c2fff1c52b..fc60f5285ab 100644
--- a/drivers/i2c/stm32f7_i2c.c
+++ b/drivers/i2c/stm32f7_i2c.c
@@ -11,6 +11,7 @@
 #include <regmap.h>
 #include <reset.h>
 #include <syscon.h>
+#include <time.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
 #include <linux/printk.h>
diff --git a/drivers/input/input.c b/drivers/input/input.c
index da264f4166e..24e76052b88 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -17,6 +17,7 @@
 #ifdef CONFIG_DM_KEYBOARD
 #include <keyboard.h>
 #endif
+#include <time.h>
 #include <linux/input.h>
 
 enum {
diff --git a/drivers/input/tegra-kbc.c b/drivers/input/tegra-kbc.c
index f07a51dc307..74ece4762e3 100644
--- a/drivers/input/tegra-kbc.c
+++ b/drivers/input/tegra-kbc.c
@@ -13,6 +13,7 @@
 #include <log.h>
 #include <stdio_dev.h>
 #include <tegra-kbc.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c
index a5534b16673..ccac7a60c12 100644
--- a/drivers/misc/cros_ec.c
+++ b/drivers/misc/cros_ec.c
@@ -25,6 +25,7 @@
 #include <log.h>
 #include <malloc.h>
 #include <spi.h>
+#include <time.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
 #include <asm/io.h>
diff --git a/drivers/misc/cros_ec_lpc.c b/drivers/misc/cros_ec_lpc.c
index 4ad6c8ca66d..0a4f45b2e89 100644
--- a/drivers/misc/cros_ec_lpc.c
+++ b/drivers/misc/cros_ec_lpc.c
@@ -17,6 +17,7 @@
 #include <command.h>
 #include <cros_ec.h>
 #include <log.h>
+#include <time.h>
 #include <asm/io.h>
 
 #ifdef DEBUG_TRACE
diff --git a/drivers/misc/cros_ec_sandbox.c b/drivers/misc/cros_ec_sandbox.c
index a191f061b89..8575e56a337 100644
--- a/drivers/misc/cros_ec_sandbox.c
+++ b/drivers/misc/cros_ec_sandbox.c
@@ -13,6 +13,7 @@
 #include <hash.h>
 #include <log.h>
 #include <os.h>
+#include <time.h>
 #include <u-boot/sha256.h>
 #include <spi.h>
 #include <asm/malloc.h>
diff --git a/drivers/misc/cros_ec_spi.c b/drivers/misc/cros_ec_spi.c
index 153f971bdeb..d8778eeb387 100644
--- a/drivers/misc/cros_ec_spi.c
+++ b/drivers/misc/cros_ec_spi.c
@@ -18,6 +18,7 @@
 #include <errno.h>
 #include <log.h>
 #include <spi.h>
+#include <time.h>
 
 int cros_ec_spi_packet(struct udevice *udev, int out_bytes, int in_bytes)
 {
diff --git a/drivers/mmc/am654_sdhci.c b/drivers/mmc/am654_sdhci.c
index cbc531dc535..8c6894921d2 100644
--- a/drivers/mmc/am654_sdhci.c
+++ b/drivers/mmc/am654_sdhci.c
@@ -12,6 +12,7 @@
 #include <power-domain.h>
 #include <regmap.h>
 #include <sdhci.h>
+#include <time.h>
 #include <dm/device_compat.h>
 #include <linux/bitops.h>
 #include <linux/err.h>
diff --git a/drivers/mmc/bcm2835_sdhost.c b/drivers/mmc/bcm2835_sdhost.c
index b793028ab53..a138165855d 100644
--- a/drivers/mmc/bcm2835_sdhost.c
+++ b/drivers/mmc/bcm2835_sdhost.c
@@ -33,6 +33,7 @@
 #include <common.h>
 #include <dm.h>
 #include <mmc.h>
+#include <time.h>
 #include <asm/arch/msg.h>
 #include <asm/arch/mbox.h>
 #include <asm/unaligned.h>
diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index 7702f4be3f8..ce7cfb5930e 100644
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -14,6 +14,7 @@
 #include <memalign.h>
 #include <mmc.h>
 #include <dwmmc.h>
+#include <time.h>
 #include <wait_bit.h>
 #include <asm/cache.h>
 #include <linux/delay.h>
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 0f9109a2c69..058ba827940 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -20,6 +20,7 @@
 #include <malloc.h>
 #include <fsl_esdhc.h>
 #include <fdt_support.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
index a2102449bb8..5fdcffd5d2c 100644
--- a/drivers/mmc/fsl_esdhc_imx.c
+++ b/drivers/mmc/fsl_esdhc_imx.c
@@ -20,6 +20,7 @@
 #include <log.h>
 #include <mmc.h>
 #include <part.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <asm/global_data.h>
 #include <dm/device_compat.h>
diff --git a/drivers/mmc/ftsdc010_mci.c b/drivers/mmc/ftsdc010_mci.c
index 71818f964d3..113ed2b7a71 100644
--- a/drivers/mmc/ftsdc010_mci.c
+++ b/drivers/mmc/ftsdc010_mci.c
@@ -15,6 +15,7 @@
 #include <malloc.h>
 #include <part.h>
 #include <mmc.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <linux/bitops.h>
 #include <linux/io.h>
diff --git a/drivers/mmc/meson_gx_mmc.c b/drivers/mmc/meson_gx_mmc.c
index 719dd1e5e57..f70ced37d31 100644
--- a/drivers/mmc/meson_gx_mmc.c
+++ b/drivers/mmc/meson_gx_mmc.c
@@ -11,6 +11,7 @@
 #include <malloc.h>
 #include <pwrseq.h>
 #include <mmc.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
 #include <asm/arch/sd_emmc.h>
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 2899986fcf1..544534a78a7 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -13,6 +13,7 @@
 #include <command.h>
 #include <dm.h>
 #include <log.h>
+#include <time.h>
 #include <dm/device-internal.h>
 #include <errno.h>
 #include <mmc.h>
diff --git a/drivers/mmc/mvebu_mmc.c b/drivers/mmc/mvebu_mmc.c
index 8ec1f57a1b7..8101f6bcc27 100644
--- a/drivers/mmc/mvebu_mmc.c
+++ b/drivers/mmc/mvebu_mmc.c
@@ -13,6 +13,7 @@
 #include <malloc.h>
 #include <part.h>
 #include <mmc.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index c5e57528660..c54edd9c8d1 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -34,6 +34,7 @@
 #if defined(CONFIG_OMAP54XX) || defined(CONFIG_OMAP44XX)
 #include <palmas.h>
 #endif
+#include <time.h>
 #include <asm/cache.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 210087c0af9..01dc9c3fd54 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -16,6 +16,7 @@
 #include <mmc.h>
 #include <sdhci.h>
 #include <dm.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index 0e03b07ce55..f9046305930 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -15,6 +15,7 @@
 #include <mmc.h>
 #include <clk.h>
 #include <reset.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/cpu.h>
diff --git a/drivers/mmc/tegra_mmc.c b/drivers/mmc/tegra_mmc.c
index cc78a2f2f08..94e062c1246 100644
--- a/drivers/mmc/tegra_mmc.c
+++ b/drivers/mmc/tegra_mmc.c
@@ -12,6 +12,7 @@
 #include <errno.h>
 #include <log.h>
 #include <mmc.h>
+#include <time.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch-tegra/tegra_mmc.h>
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index feb46d8cf28..74cf47b7637 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -26,6 +26,7 @@
 #include <init.h>
 #include <irq_func.h>
 #include <log.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/processor.h>
 #include <asm/io.h>
diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index 48c0ca69de5..a57013e72c4 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <memalign.h>
 #include <nand.h>
diff --git a/drivers/mtd/nand/raw/fsl_elbc_nand.c b/drivers/mtd/nand/raw/fsl_elbc_nand.c
index 0c1bd7b4740..32ee212694a 100644
--- a/drivers/mtd/nand/raw/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/raw/fsl_elbc_nand.c
@@ -11,6 +11,7 @@
 #include <command.h>
 #include <malloc.h>
 #include <nand.h>
+#include <time.h>
 #include <dm/devres.h>
 
 #include <linux/mtd/mtd.h>
diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c
index cf20238782c..964a329023d 100644
--- a/drivers/mtd/nand/raw/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c
@@ -10,6 +10,7 @@
 #include <command.h>
 #include <malloc.h>
 #include <nand.h>
+#include <time.h>
 #include <dm/devres.h>
 
 #include <linux/mtd/mtd.h>
diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c
index 1f4c74f0f63..ad34af30e81 100644
--- a/drivers/mtd/nand/raw/fsmc_nand.c
+++ b/drivers/mtd/nand/raw/fsmc_nand.c
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <time.h>
 #include <asm/io.h>
 #include <linux/bitops.h>
 #include <linux/err.h>
diff --git a/drivers/mtd/nand/raw/mxs_nand_spl.c b/drivers/mtd/nand/raw/mxs_nand_spl.c
index 46dc29df369..ee778e13aa1 100644
--- a/drivers/mtd/nand/raw/mxs_nand_spl.c
+++ b/drivers/mtd/nand/raw/mxs_nand_spl.c
@@ -9,6 +9,7 @@
 #include <nand.h>
 #include <malloc.h>
 #include <mxs_nand.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 7cd1e133c22..693e088f19a 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -34,6 +34,7 @@
 #endif
 #include <log.h>
 #include <malloc.h>
+#include <time.h>
 #include <watchdog.h>
 #include <asm/global_data.h>
 #include <dm/devres.h>
diff --git a/drivers/mtd/nand/raw/pxa3xx_nand.c b/drivers/mtd/nand/raw/pxa3xx_nand.c
index 224db72087b..bccaa2d8212 100644
--- a/drivers/mtd/nand/raw/pxa3xx_nand.c
+++ b/drivers/mtd/nand/raw/pxa3xx_nand.c
@@ -10,6 +10,7 @@
 #include <malloc.h>
 #include <fdtdec.h>
 #include <nand.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <dm/device_compat.h>
 #include <dm/devres.h>
diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c
index 2946f94b6df..606e606fe8b 100644
--- a/drivers/mtd/nand/raw/sunxi_nand.c
+++ b/drivers/mtd/nand/raw/sunxi_nand.c
@@ -29,6 +29,7 @@
 #include <malloc.h>
 #include <memalign.h>
 #include <nand.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <dm/device_compat.h>
 #include <dm/devres.h>
diff --git a/drivers/mtd/nand/raw/vf610_nfc.c b/drivers/mtd/nand/raw/vf610_nfc.c
index bee273b1a64..02ca385ed2d 100644
--- a/drivers/mtd/nand/raw/vf610_nfc.c
+++ b/drivers/mtd/nand/raw/vf610_nfc.c
@@ -23,6 +23,7 @@
 
 #include <common.h>
 #include <malloc.h>
+#include <time.h>
 #include <dm/device_compat.h>
 #include <linux/printk.h>
 
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 63248f648a1..ae8932d377c 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -24,6 +24,7 @@
 #include <errno.h>
 #include <spi.h>
 #include <spi-mem.h>
+#include <time.h>
 #include <dm/device_compat.h>
 #include <dm/devres.h>
 #include <linux/bitops.h>
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index ad9b61f396f..cfc137c6b95 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -21,6 +21,7 @@
 
 #include <common.h>
 #include <log.h>
+#include <time.h>
 #include <watchdog.h>
 #include <dm/devres.h>
 #include <linux/bitops.h>
diff --git a/drivers/mtd/spi/sf_dataflash.c b/drivers/mtd/spi/sf_dataflash.c
index b1034ac2086..c292ddfb893 100644
--- a/drivers/mtd/spi/sf_dataflash.c
+++ b/drivers/mtd/spi/sf_dataflash.c
@@ -16,6 +16,7 @@
 #include <spi.h>
 #include <spi_flash.h>
 #include <div64.h>
+#include <time.h>
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/math64.h>
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
index da2777f777e..3baac137aed 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -12,6 +12,7 @@
 #include <common.h>
 #include <display_options.h>
 #include <log.h>
+#include <time.h>
 #include <dm/device_compat.h>
 #include <dm/devres.h>
 #include <linux/bitops.h>
diff --git a/drivers/mtd/spi/spi-nor-tiny.c b/drivers/mtd/spi/spi-nor-tiny.c
index a2c8c30ed7b..532e9a2c9e4 100644
--- a/drivers/mtd/spi/spi-nor-tiny.c
+++ b/drivers/mtd/spi/spi-nor-tiny.c
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <log.h>
+#include <time.h>
 #include <dm/device_compat.h>
 #include <linux/err.h>
 #include <linux/errno.h>
diff --git a/drivers/mtd/st_smi.c b/drivers/mtd/st_smi.c
index 7c652e6c535..970c6ee7043 100644
--- a/drivers/mtd/st_smi.c
+++ b/drivers/mtd/st_smi.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <flash.h>
+#include <time.h>
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/mtd/st_smi.h>
diff --git a/drivers/net/ag7xxx.c b/drivers/net/ag7xxx.c
index c7ea60f5acc..48cf45d9a8f 100644
--- a/drivers/net/ag7xxx.c
+++ b/drivers/net/ag7xxx.c
@@ -15,6 +15,7 @@
 #include <miiphy.h>
 #include <malloc.h>
 #include <net.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <asm/global_data.h>
 #include <linux/bitops.h>
diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c
index 2097718057b..8b4ab9627c3 100644
--- a/drivers/net/altera_tse.c
+++ b/drivers/net/altera_tse.c
@@ -17,6 +17,7 @@
 #include <memalign.h>
 #include <miiphy.h>
 #include <net.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <asm/global_data.h>
 #include <linux/dma-mapping.h>
diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c
index 9440a91882f..d58ae075830 100644
--- a/drivers/net/cs8900.c
+++ b/drivers/net/cs8900.c
@@ -26,6 +26,7 @@
 #include <common.h>
 #include <command.h>
 #include <log.h>
+#include <time.h>
 #include <asm/io.h>
 #include <net.h>
 #include <malloc.h>
diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 0ab1a12d762..c2f3a6483dd 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -19,6 +19,7 @@
 #include <net.h>
 #include <pci.h>
 #include <reset.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <dm/device_compat.h>
 #include <dm/devres.h>
diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index e46a269af90..3ff3824d52f 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -52,6 +52,7 @@ TODO: external MII is not functional, only internal at the moment.
 #include <common.h>
 #include <command.h>
 #include <net.h>
+#include <time.h>
 #include <asm/io.h>
 #include <dm9000.h>
 #include <linux/delay.h>
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index b9d80a5b08a..a93358af1a7 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -13,6 +13,7 @@
 #include <cpu_func.h>
 #include <dm.h>
 #include <log.h>
+#include <time.h>
 #include <dm/platform_data/net_ethoc.h>
 #include <linux/io.h>
 #include <malloc.h>
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 468be69886c..c0fc3133afb 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -17,6 +17,7 @@
 #include <miiphy.h>
 #include <net.h>
 #include <netdev.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <asm/global_data.h>
 #include <linux/delay.h>
diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c
index d45f17eb8dd..4b94fd6405a 100644
--- a/drivers/net/ftmac100.c
+++ b/drivers/net/ftmac100.c
@@ -12,6 +12,7 @@
 #include <env.h>
 #include <malloc.h>
 #include <net.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <linux/delay.h>
 #include <linux/io.h>
diff --git a/drivers/net/ftmac110.c b/drivers/net/ftmac110.c
index 265d813c4f8..d4a92a70e73 100644
--- a/drivers/net/ftmac110.c
+++ b/drivers/net/ftmac110.c
@@ -11,6 +11,7 @@
 #include <log.h>
 #include <malloc.h>
 #include <net.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <linux/errno.h>
 #include <asm/io.h>
diff --git a/drivers/net/lan91c96.c b/drivers/net/lan91c96.c
index 470c68467cd..ce3c406ea6c 100644
--- a/drivers/net/lan91c96.c
+++ b/drivers/net/lan91c96.c
@@ -48,6 +48,7 @@
 #include <command.h>
 #include <env.h>
 #include <malloc.h>
+#include <time.h>
 #include <linux/delay.h>
 #include "lan91c96.h"
 #include <net.h>
diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c
index b340c576108..bbd2aed0ab2 100644
--- a/drivers/net/ldpaa_eth/ldpaa_eth.c
+++ b/drivers/net/ldpaa_eth/ldpaa_eth.c
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <cpu_func.h>
 #include <log.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/types.h>
diff --git a/drivers/net/mtk_eth.c b/drivers/net/mtk_eth.c
index 24a18ce9687..774c1e3bb51 100644
--- a/drivers/net/mtk_eth.c
+++ b/drivers/net/mtk_eth.c
@@ -16,6 +16,7 @@
 #include <regmap.h>
 #include <reset.h>
 #include <syscon.h>
+#include <time.h>
 #include <wait_bit.h>
 #include <asm/cache.h>
 #include <asm/gpio.h>
diff --git a/drivers/net/ne2000_base.c b/drivers/net/ne2000_base.c
index 09cc8398003..25c258dd3f7 100644
--- a/drivers/net/ne2000_base.c
+++ b/drivers/net/ne2000_base.c
@@ -78,6 +78,7 @@ Add SNMP
 #include <log.h>
 #include <net.h>
 #include <malloc.h>
+#include <time.h>
 #include <linux/compiler.h>
 
 /* forward definition of function used for the uboot interface */
diff --git a/drivers/net/pch_gbe.c b/drivers/net/pch_gbe.c
index 1daafbe2b9b..20d757f5dff 100644
--- a/drivers/net/pch_gbe.c
+++ b/drivers/net/pch_gbe.c
@@ -11,6 +11,7 @@
 #include <errno.h>
 #include <log.h>
 #include <malloc.h>
+#include <time.h>
 #include <asm/io.h>
 #include <pci.h>
 #include <miiphy.h>
diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
index 23d5c88a88d..6ab56e6e653 100644
--- a/drivers/net/ravb.c
+++ b/drivers/net/ravb.c
@@ -16,6 +16,7 @@
 #include <log.h>
 #include <miiphy.h>
 #include <malloc.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <asm/global_data.h>
 #include <linux/bitops.h>
diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c
index 3f6805791f4..5ff99273a02 100644
--- a/drivers/net/rtl8169.c
+++ b/drivers/net/rtl8169.c
@@ -50,6 +50,7 @@
 #ifndef CONFIG_DM_ETH
 #include <netdev.h>
 #endif
+#include <time.h>
 #include <asm/cache.h>
 #include <asm/io.h>
 #include <pci.h>
diff --git a/drivers/net/sandbox.c b/drivers/net/sandbox.c
index 51d80f54967..555d9147d11 100644
--- a/drivers/net/sandbox.c
+++ b/drivers/net/sandbox.c
@@ -11,6 +11,7 @@
 #include <log.h>
 #include <malloc.h>
 #include <net.h>
+#include <time.h>
 #include <asm/eth.h>
 #include <asm/global_data.h>
 #include <asm/test.h>
diff --git a/drivers/net/smc91111.c b/drivers/net/smc91111.c
index fea6ba8caaa..3ae9f805a79 100644
--- a/drivers/net/smc91111.c
+++ b/drivers/net/smc91111.c
@@ -51,6 +51,7 @@
 #include <command.h>
 #include <config.h>
 #include <malloc.h>
+#include <time.h>
 #include <linux/delay.h>
 #include "smc91111.h"
 #include <net.h>
diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c
index a65700020d5..e74cfa99324 100644
--- a/drivers/net/sun8i_emac.c
+++ b/drivers/net/sun8i_emac.c
@@ -12,6 +12,7 @@
 
 #include <cpu_func.h>
 #include <log.h>
+#include <time.h>
 #include <asm/cache.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index 9f2327b92cd..321429090f6 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -13,6 +13,7 @@
 #include <dm.h>
 #include <console.h>
 #include <malloc.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <phy.h>
diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c
index 39284badf20..c69919faafe 100644
--- a/drivers/pci/pci_rom.c
+++ b/drivers/pci/pci_rom.c
@@ -34,6 +34,7 @@
 #include <malloc.h>
 #include <pci.h>
 #include <pci_rom.h>
+#include <time.h>
 #include <vbe.h>
 #include <video.h>
 #include <video_fb.h>
diff --git a/drivers/pci/pci_tegra.c b/drivers/pci/pci_tegra.c
index d15fabd9226..abd4e26543b 100644
--- a/drivers/pci/pci_tegra.c
+++ b/drivers/pci/pci_tegra.c
@@ -21,6 +21,7 @@
 #include <pci_tegra.h>
 #include <power-domain.h>
 #include <reset.h>
+#include <time.h>
 #include <linux/delay.h>
 #include <linux/printk.h>
 
diff --git a/drivers/pci/pcie_dw_mvebu.c b/drivers/pci/pcie_dw_mvebu.c
index 33ecd25f848..dbc8bb81a7c 100644
--- a/drivers/pci/pcie_dw_mvebu.c
+++ b/drivers/pci/pcie_dw_mvebu.c
@@ -14,6 +14,7 @@
 #include <dm.h>
 #include <log.h>
 #include <pci.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm-generic/gpio.h>
diff --git a/drivers/pci/pcie_dw_ti.c b/drivers/pci/pcie_dw_ti.c
index 16b2a2da7e7..eed5e428972 100644
--- a/drivers/pci/pcie_dw_ti.c
+++ b/drivers/pci/pcie_dw_ti.c
@@ -11,6 +11,7 @@
 #include <power-domain.h>
 #include <regmap.h>
 #include <syscon.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm-generic/gpio.h>
diff --git a/drivers/phy/phy-da8xx-usb.c b/drivers/phy/phy-da8xx-usb.c
index d025188eae9..ec87d3fea2d 100644
--- a/drivers/phy/phy-da8xx-usb.c
+++ b/drivers/phy/phy-da8xx-usb.c
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <dm.h>
 #include <log.h>
+#include <time.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
 #include <asm/arch/hardware.h>
diff --git a/drivers/power/exynos-tmu.c b/drivers/power/exynos-tmu.c
index 4fba7b527c6..bc872488215 100644
--- a/drivers/power/exynos-tmu.c
+++ b/drivers/power/exynos-tmu.c
@@ -21,6 +21,7 @@
 #include <errno.h>
 #include <fdtdec.h>
 #include <log.h>
+#include <time.h>
 #include <tmu.h>
 #include <asm/arch/tmu.h>
 #include <asm/arch/power.h>
diff --git a/drivers/power/regulator/tps65090_regulator.c b/drivers/power/regulator/tps65090_regulator.c
index 9e45627a742..74403a5a894 100644
--- a/drivers/power/regulator/tps65090_regulator.c
+++ b/drivers/power/regulator/tps65090_regulator.c
@@ -7,6 +7,7 @@
 #include <dm.h>
 #include <errno.h>
 #include <log.h>
+#include <time.h>
 #include <linux/delay.h>
 #include <power/pmic.h>
 #include <power/regulator.h>
diff --git a/drivers/ram/rockchip/dmc-rk3368.c b/drivers/ram/rockchip/dmc-rk3368.c
index 41773893fd7..faf291e5763 100644
--- a/drivers/ram/rockchip/dmc-rk3368.c
+++ b/drivers/ram/rockchip/dmc-rk3368.c
@@ -8,6 +8,7 @@
 #include <dm.h>
 #include <hang.h>
 #include <log.h>
+#include <time.h>
 #include <dt-bindings/memory/rk3368-dmc.h>
 #include <dt-structs.h>
 #include <ram.h>
diff --git a/drivers/ram/stm32mp1/stm32mp1_interactive.c b/drivers/ram/stm32mp1/stm32mp1_interactive.c
index 7b29c368126..d3b8b3b5afa 100644
--- a/drivers/ram/stm32mp1/stm32mp1_interactive.c
+++ b/drivers/ram/stm32mp1/stm32mp1_interactive.c
@@ -12,6 +12,7 @@
 #include <malloc.h>
 #include <ram.h>
 #include <reset.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include "stm32mp1_ddr.h"
 #include "stm32mp1_tests.h"
diff --git a/drivers/rng/sandbox_rng.c b/drivers/rng/sandbox_rng.c
index cc5e1f6e25b..a55e552177a 100644
--- a/drivers/rng/sandbox_rng.c
+++ b/drivers/rng/sandbox_rng.c
@@ -7,6 +7,7 @@
 #include <dm.h>
 #include <rand.h>
 #include <rng.h>
+#include <time.h>
 
 #include <linux/string.h>
 
diff --git a/drivers/rtc/rv3029.c b/drivers/rtc/rv3029.c
index 3afe5b2fdd6..188560d3d45 100644
--- a/drivers/rtc/rv3029.c
+++ b/drivers/rtc/rv3029.c
@@ -14,6 +14,7 @@
 #include <i2c.h>
 #include <log.h>
 #include <rtc.h>
+#include <time.h>
 #include <dm/device_compat.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
diff --git a/drivers/sound/samsung-i2s.c b/drivers/sound/samsung-i2s.c
index aa1d6bb209b..24e124e8083 100644
--- a/drivers/sound/samsung-i2s.c
+++ b/drivers/sound/samsung-i2s.c
@@ -9,6 +9,7 @@
 #include <i2s.h>
 #include <log.h>
 #include <sound.h>
+#include <time.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/i2s-regs.h>
diff --git a/drivers/sound/tegra_ahub.c b/drivers/sound/tegra_ahub.c
index 26d457255c9..2fead1aeffd 100644
--- a/drivers/sound/tegra_ahub.c
+++ b/drivers/sound/tegra_ahub.c
@@ -12,6 +12,7 @@
 #include <i2s.h>
 #include <log.h>
 #include <misc.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch-tegra/tegra_ahub.h>
 #include <asm/arch-tegra/tegra_i2s.h>
diff --git a/drivers/spi/altera_spi.c b/drivers/spi/altera_spi.c
index 61372c52b05..c9ef5a69ea9 100644
--- a/drivers/spi/altera_spi.c
+++ b/drivers/spi/altera_spi.c
@@ -13,6 +13,7 @@
 #include <malloc.h>
 #include <fdtdec.h>
 #include <spi.h>
+#include <time.h>
 #include <asm/io.h>
 #include <linux/bitops.h>
 
diff --git a/drivers/spi/cadence_qspi_apb.c b/drivers/spi/cadence_qspi_apb.c
index f9675f75a40..77ec7c6ecda 100644
--- a/drivers/spi/cadence_qspi_apb.c
+++ b/drivers/spi/cadence_qspi_apb.c
@@ -27,6 +27,7 @@
 
 #include <common.h>
 #include <log.h>
+#include <time.h>
 #include <asm/io.h>
 #include <dma.h>
 #include <linux/bitops.h>
diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c
index e1336b89c5a..224c2b07919 100644
--- a/drivers/spi/ich.c
+++ b/drivers/spi/ich.c
@@ -22,6 +22,7 @@
 #include <spi_flash.h>
 #include <spi-mem.h>
 #include <spl.h>
+#include <time.h>
 #include <asm/fast_spi.h>
 #include <asm/io.h>
 #include <dm/uclass-internal.h>
diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c
index 811b5d44fb2..4f4b7ea22e0 100644
--- a/drivers/spi/mpc8xxx_spi.c
+++ b/drivers/spi/mpc8xxx_spi.c
@@ -11,6 +11,7 @@
 #include <log.h>
 #include <malloc.h>
 #include <spi.h>
+#include <time.h>
 #include <asm/mpc8xxx_spi.h>
 #include <asm-generic/gpio.h>
 #include <dm/device_compat.h>
diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
index 14f68da2ee6..cb1abf14416 100644
--- a/drivers/spi/mxc_spi.c
+++ b/drivers/spi/mxc_spi.c
@@ -8,6 +8,7 @@
 #include <log.h>
 #include <malloc.h>
 #include <spi.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <dm/device_compat.h>
 #include <linux/bitops.h>
diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c
index afe80e53d2b..942db5ca5ba 100644
--- a/drivers/spi/omap3_spi.c
+++ b/drivers/spi/omap3_spi.c
@@ -20,6 +20,7 @@
 #include <dm.h>
 #include <spi.h>
 #include <malloc.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <linux/bitops.h>
diff --git a/drivers/spi/pic32_spi.c b/drivers/spi/pic32_spi.c
index ffba2d84f1f..d08c26c8f4f 100644
--- a/drivers/spi/pic32_spi.c
+++ b/drivers/spi/pic32_spi.c
@@ -10,6 +10,7 @@
 #include <clk.h>
 #include <dm.h>
 #include <log.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <linux/bitops.h>
 #include <linux/compat.h>
diff --git a/drivers/spi/zynq_qspi.c b/drivers/spi/zynq_qspi.c
index 1358bd10355..af130d4418b 100644
--- a/drivers/spi/zynq_qspi.c
+++ b/drivers/spi/zynq_qspi.c
@@ -11,6 +11,7 @@
 #include <log.h>
 #include <malloc.h>
 #include <spi.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <linux/bitops.h>
diff --git a/drivers/timer/sandbox_timer.c b/drivers/timer/sandbox_timer.c
index 5228486082c..2120b02d444 100644
--- a/drivers/timer/sandbox_timer.c
+++ b/drivers/timer/sandbox_timer.c
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
+#include <time.h>
 #include <timer.h>
 #include <os.h>
 
diff --git a/drivers/tpm/cr50_i2c.c b/drivers/tpm/cr50_i2c.c
index 1942c07c605..b0075d3bb48 100644
--- a/drivers/tpm/cr50_i2c.c
+++ b/drivers/tpm/cr50_i2c.c
@@ -13,6 +13,7 @@
 #include <irq.h>
 #include <log.h>
 #include <spl.h>
+#include <time.h>
 #include <tpm-v2.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
diff --git a/drivers/tpm/tpm-uclass.c b/drivers/tpm/tpm-uclass.c
index 6ea795bc0c9..01d7c2f47c1 100644
--- a/drivers/tpm/tpm-uclass.c
+++ b/drivers/tpm/tpm-uclass.c
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <dm.h>
 #include <log.h>
+#include <time.h>
 #include <linux/delay.h>
 #include <linux/unaligned/be_byteshift.h>
 #include <tpm-v1.h>
diff --git a/drivers/tpm/tpm2_tis_spi.c b/drivers/tpm/tpm2_tis_spi.c
index 8ff6c461f19..195d8be8bf3 100644
--- a/drivers/tpm/tpm2_tis_spi.c
+++ b/drivers/tpm/tpm2_tis_spi.c
@@ -18,6 +18,7 @@
 #include <fdtdec.h>
 #include <log.h>
 #include <spi.h>
+#include <time.h>
 #include <tpm-v2.h>
 #include <asm/global_data.h>
 #include <linux/bitops.h>
diff --git a/drivers/tpm/tpm_atmel_twi.c b/drivers/tpm/tpm_atmel_twi.c
index 5489e728b6e..9444c1b4813 100644
--- a/drivers/tpm/tpm_atmel_twi.c
+++ b/drivers/tpm/tpm_atmel_twi.c
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <display_options.h>
 #include <dm.h>
+#include <time.h>
 #include <tpm-v1.h>
 #include <i2c.h>
 #include <asm/unaligned.h>
diff --git a/drivers/tpm/tpm_tis_infineon.c b/drivers/tpm/tpm_tis_infineon.c
index 32c3a335420..fe832d41329 100644
--- a/drivers/tpm/tpm_tis_infineon.c
+++ b/drivers/tpm/tpm_tis_infineon.c
@@ -24,6 +24,7 @@
 #include <fdtdec.h>
 #include <i2c.h>
 #include <log.h>
+#include <time.h>
 #include <tpm-v1.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
diff --git a/drivers/tpm/tpm_tis_st33zp24_i2c.c b/drivers/tpm/tpm_tis_st33zp24_i2c.c
index a253ee15027..60af8385b5d 100644
--- a/drivers/tpm/tpm_tis_st33zp24_i2c.c
+++ b/drivers/tpm/tpm_tis_st33zp24_i2c.c
@@ -17,6 +17,7 @@
 #include <fdtdec.h>
 #include <i2c.h>
 #include <log.h>
+#include <time.h>
 #include <tpm-v1.h>
 #include <errno.h>
 #include <linux/delay.h>
diff --git a/drivers/tpm/tpm_tis_st33zp24_spi.c b/drivers/tpm/tpm_tis_st33zp24_spi.c
index ef54e3b7b29..edd7d7840b9 100644
--- a/drivers/tpm/tpm_tis_st33zp24_spi.c
+++ b/drivers/tpm/tpm_tis_st33zp24_spi.c
@@ -17,6 +17,7 @@
 #include <fdtdec.h>
 #include <log.h>
 #include <spi.h>
+#include <time.h>
 #include <tpm-v1.h>
 #include <errno.h>
 #include <linux/delay.h>
diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c
index 87b4e5fc560..97fa80de068 100644
--- a/drivers/ufs/ufs.c
+++ b/drivers/ufs/ufs.c
@@ -12,6 +12,7 @@
 #include <common.h>
 #include <dm.h>
 #include <log.h>
+#include <time.h>
 #include <dm/device_compat.h>
 #include <dm/devres.h>
 #include <dm/lists.h>
diff --git a/drivers/usb/eth/smsc95xx.c b/drivers/usb/eth/smsc95xx.c
index b293a808a3d..dacf607ed83 100644
--- a/drivers/usb/eth/smsc95xx.c
+++ b/drivers/usb/eth/smsc95xx.c
@@ -13,6 +13,7 @@
 #include <malloc.h>
 #include <memalign.h>
 #include <net.h>
+#include <time.h>
 #include <usb.h>
 #include <asm/unaligned.h>
 #include <linux/delay.h>
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 4a42592b53a..f3885a376b8 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -12,6 +12,7 @@
 #include <env.h>
 #include <log.h>
 #include <part.h>
+#include <time.h>
 #include <linux/errno.h>
 #include <linux/netdevice.h>
 #include <linux/printk.h>
diff --git a/drivers/usb/gadget/fotg210.c b/drivers/usb/gadget/fotg210.c
index af43433d88d..c6eb22bdfd3 100644
--- a/drivers/usb/gadget/fotg210.c
+++ b/drivers/usb/gadget/fotg210.c
@@ -13,6 +13,7 @@
 #include <log.h>
 #include <net.h>
 #include <malloc.h>
+#include <time.h>
 #include <asm/io.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index d19ac1d0353..2d9f2e4e33d 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -19,6 +19,7 @@
 #include <common.h>
 #include <errno.h>
 #include <log.h>
+#include <time.h>
 #include <asm/byteorder.h>
 #include <asm/system.h>
 #include <asm/mach-types.h>
diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index cefe9d83b1d..ec0b799e149 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -14,6 +14,7 @@
 #include <malloc.h>
 #include <memalign.h>
 #include <phys2bus.h>
+#include <time.h>
 #include <usb.h>
 #include <usbroothubdes.h>
 #include <wait_bit.h>
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index f79f06320bf..26400cac08c 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -11,6 +11,7 @@
 #include <dm.h>
 #include <errno.h>
 #include <log.h>
+#include <time.h>
 #include <asm/byteorder.h>
 #include <asm/cache.h>
 #include <asm/unaligned.h>
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 82b99eeef1e..90a02406836 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <log.h>
+#include <time.h>
 #include <usb.h>
 #include <linux/delay.h>
 #include <usb/ulpi.h>
diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c
index 22e7b565b5b..e9f87cfb7b0 100644
--- a/drivers/usb/host/ohci-da8xx.c
+++ b/drivers/usb/host/ohci-da8xx.c
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <malloc.h>
+#include <time.h>
 #include <asm/io.h>
 #include <clk.h>
 #include <dm.h>
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index 7c823f241a8..39d5988b36a 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -20,6 +20,7 @@
 
 #include <common.h>
 #include <mpc8xx.h>
+#include <time.h>
 #include <usb.h>
 #include <linux/delay.h>
 #include "sl811.h"
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 86aeaab412e..1811e4377da 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -16,6 +16,7 @@
 #include <common.h>
 #include <cpu_func.h>
 #include <log.h>
+#include <time.h>
 #include <asm/byteorder.h>
 #include <usb.h>
 #include <asm/unaligned.h>
diff --git a/drivers/usb/musb-new/am35x.c b/drivers/usb/musb-new/am35x.c
index 0a52e09e19f..ea0a944a87b 100644
--- a/drivers/usb/musb-new/am35x.c
+++ b/drivers/usb/musb-new/am35x.c
@@ -25,6 +25,7 @@
 #include <plat/usb.h>
 #else
 #include <common.h>
+#include <time.h>
 #include <asm/omap_musb.h>
 #include <linux/bug.h>
 #include <linux/delay.h>
diff --git a/drivers/usb/musb-new/musb_dsps.c b/drivers/usb/musb-new/musb_dsps.c
index 4d977aba34f..20987b77ade 100644
--- a/drivers/usb/musb-new/musb_dsps.c
+++ b/drivers/usb/musb-new/musb_dsps.c
@@ -32,6 +32,7 @@
 #include <plat/usb.h>
 #else
 #include <common.h>
+#include <time.h>
 #include <asm/omap_musb.h>
 #include <linux/printk.h>
 #include "linux-compat.h"
diff --git a/drivers/usb/musb-new/musb_uboot.c b/drivers/usb/musb-new/musb_uboot.c
index 988071a61d1..6ec8f429951 100644
--- a/drivers/usb/musb-new/musb_uboot.c
+++ b/drivers/usb/musb-new/musb_uboot.c
@@ -1,6 +1,7 @@
 #include <common.h>
 #include <console.h>
 #include <malloc.h>
+#include <time.h>
 #include <watchdog.h>
 #include <linux/delay.h>
 #include <linux/err.h>
diff --git a/drivers/usb/musb-new/omap2430.c b/drivers/usb/musb-new/omap2430.c
index c41b9147fa5..e8bc3f33597 100644
--- a/drivers/usb/musb-new/omap2430.c
+++ b/drivers/usb/musb-new/omap2430.c
@@ -12,6 +12,7 @@
 #include <dm.h>
 #include <log.h>
 #include <serial.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <dm/device-internal.h>
 #include <dm/device_compat.h>
diff --git a/drivers/video/broadwell_igd.c b/drivers/video/broadwell_igd.c
index 416a1c07b13..84b31025f74 100644
--- a/drivers/video/broadwell_igd.c
+++ b/drivers/video/broadwell_igd.c
@@ -11,6 +11,7 @@
 #include <dm.h>
 #include <init.h>
 #include <log.h>
+#include <time.h>
 #include <vbe.h>
 #include <video.h>
 #include <asm/cpu.h>
diff --git a/drivers/video/dw_hdmi.c b/drivers/video/dw_hdmi.c
index c4fbb182944..16db3d38a2c 100644
--- a/drivers/video/dw_hdmi.c
+++ b/drivers/video/dw_hdmi.c
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <fdtdec.h>
 #include <log.h>
+#include <time.h>
 #include <asm/io.h>
 #include <i2c.h>
 #include <media_bus_format.h>
diff --git a/drivers/video/rockchip/rk_edp.c b/drivers/video/rockchip/rk_edp.c
index 000bd481408..36d17deea58 100644
--- a/drivers/video/rockchip/rk_edp.c
+++ b/drivers/video/rockchip/rk_edp.c
@@ -14,6 +14,7 @@
 #include <panel.h>
 #include <regmap.h>
 #include <syscon.h>
+#include <time.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch-rockchip/clock.h>
diff --git a/drivers/video/tegra124/display.c b/drivers/video/tegra124/display.c
index 6c279322639..4f46b222b44 100644
--- a/drivers/video/tegra124/display.c
+++ b/drivers/video/tegra124/display.c
@@ -15,6 +15,7 @@
 #include <lcd.h>
 #include <log.h>
 #include <part.h>
+#include <time.h>
 #include <video.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
diff --git a/drivers/video/tegra124/dp.c b/drivers/video/tegra124/dp.c
index 59758eb9361..b09943897c1 100644
--- a/drivers/video/tegra124/dp.c
+++ b/drivers/video/tegra124/dp.c
@@ -10,6 +10,7 @@
 #include <div64.h>
 #include <errno.h>
 #include <log.h>
+#include <time.h>
 #include <video_bridge.h>
 #include <asm/io.h>
 #include <asm/arch-tegra/dc.h>
diff --git a/drivers/video/tegra124/sor.c b/drivers/video/tegra124/sor.c
index 52ab1b52915..119219e18bb 100644
--- a/drivers/video/tegra124/sor.c
+++ b/drivers/video/tegra124/sor.c
@@ -10,6 +10,7 @@
 #include <malloc.h>
 #include <panel.h>
 #include <syscon.h>
+#include <time.h>
 #include <video_bridge.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 1654d02860b..eb234cc9bf4 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -11,6 +11,7 @@
 #include <malloc.h>
 #include <mapmem.h>
 #include <stdio_dev.h>
+#include <time.h>
 #include <video.h>
 #include <video_console.h>
 #include <asm/cache.h>
diff --git a/drivers/watchdog/sbsa_gwdt.c b/drivers/watchdog/sbsa_gwdt.c
index b837b045fa5..1e44df1da29 100644
--- a/drivers/watchdog/sbsa_gwdt.c
+++ b/drivers/watchdog/sbsa_gwdt.c
@@ -5,6 +5,7 @@
  * Copyright 2020 NXP
  */
 
+#include <time.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <common.h>
diff --git a/fs/fs.c b/fs/fs.c
index 16c54520251..15524c479c6 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -17,6 +17,7 @@
 #include <fat.h>
 #include <fs.h>
 #include <sandboxfs.h>
+#include <time.h>
 #include <ubifs_uboot.h>
 #include <btrfs.h>
 #include <asm/global_data.h>
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index 4a8fd88cdd7..4f0f680131f 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -17,6 +17,7 @@
 
 #include <hexdump.h>
 #include <log.h>
+#include <time.h>
 #include <dm/devres.h>
 #include <linux/printk.h>
 
diff --git a/include/cli.h b/include/cli.h
index 39b913743b5..06355767f6d 100644
--- a/include/cli.h
+++ b/include/cli.h
@@ -7,6 +7,8 @@
 #ifndef __CLI_H
 #define __CLI_H
 
+#include <time.h>
+
 /**
  * Go into the command loop
  *
diff --git a/include/common.h b/include/common.h
index a79c2bb4993..a904f41c366 100644
--- a/include/common.h
+++ b/include/common.h
@@ -15,7 +15,6 @@
 #ifndef __ASSEMBLY__		/* put C only stuff in this section */
 #include <config.h>
 #include <errno.h>
-#include <time.h>
 #include <linux/types.h>
 #include <linux/string.h>
 #include <stdarg.h>
diff --git a/include/exports.h b/include/exports.h
index e89cc333e52..4b9aa5ff405 100644
--- a/include/exports.h
+++ b/include/exports.h
@@ -2,6 +2,7 @@
 #define __EXPORTS_H__
 
 #include <irq_func.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <linux/delay.h>
 
diff --git a/include/regmap.h b/include/regmap.h
index 30183c5e711..bae96a6ef0b 100644
--- a/include/regmap.h
+++ b/include/regmap.h
@@ -7,6 +7,7 @@
 #ifndef __REGMAP_H
 #define __REGMAP_H
 
+#include <time.h>
 #include <linux/delay.h>
 
 /**
diff --git a/include/virtio.h b/include/virtio.h
index 10a9c073ba1..6a2932e391f 100644
--- a/include/virtio.h
+++ b/include/virtio.h
@@ -20,8 +20,10 @@
 #ifndef __VIRTIO_H__
 #define __VIRTIO_H__
 
+#include <compiler.h>
 #include <linux/bitops.h>
 #include <linux/bug.h>
+#include <linux/typecheck.h>
 #define VIRTIO_ID_NET		1 /* virtio net */
 #define VIRTIO_ID_BLOCK		2 /* virtio block */
 #define VIRTIO_ID_RNG		4 /* virtio rng */
diff --git a/lib/dhry/cmd_dhry.c b/lib/dhry/cmd_dhry.c
index d55ab54df97..bbb02d4ad9b 100644
--- a/lib/dhry/cmd_dhry.c
+++ b/lib/dhry/cmd_dhry.c
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <div64.h>
+#include <time.h>
 #include "dhry.h"
 
 static int do_dhry(struct cmd_tbl *cmdtp, int flag, int argc,
diff --git a/net/arp.c b/net/arp.c
index 1d06ed25722..7913812b9a2 100644
--- a/net/arp.c
+++ b/net/arp.c
@@ -13,6 +13,7 @@
 #include <env.h>
 #include <log.h>
 #include <net.h>
+#include <time.h>
 #include <linux/delay.h>
 
 #include "arp.h"
diff --git a/net/bootp.c b/net/bootp.c
index de3dab4114d..23b5b8ad9b9 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -16,6 +16,7 @@
 #include <log.h>
 #include <net.h>
 #include <rand.h>
+#include <time.h>
 #include <uuid.h>
 #include <linux/delay.h>
 #include <net/tftp.h>
diff --git a/net/dns.c b/net/dns.c
index 5b1fe5b0103..677e39dd031 100644
--- a/net/dns.c
+++ b/net/dns.c
@@ -27,6 +27,7 @@
 #include <env.h>
 #include <log.h>
 #include <net.h>
+#include <time.h>
 #include <asm/unaligned.h>
 
 #include "dns.h"
diff --git a/net/fastboot.c b/net/fastboot.c
index d01d3eba120..c35953f3e33 100644
--- a/net/fastboot.c
+++ b/net/fastboot.c
@@ -7,6 +7,7 @@
 #include <command.h>
 #include <fastboot.h>
 #include <net.h>
+#include <time.h>
 #include <linux/printk.h>
 #include <net/fastboot.h>
 
diff --git a/net/link_local.c b/net/link_local.c
index 8aec3c79969..16bc5c8b90a 100644
--- a/net/link_local.c
+++ b/net/link_local.c
@@ -16,6 +16,7 @@
 #include <log.h>
 #include <net.h>
 #include <rand.h>
+#include <time.h>
 #include "arp.h"
 #include "net_rand.h"
 
diff --git a/net/net.c b/net/net.c
index 1e7f633cb69..23d1988c181 100644
--- a/net/net.c
+++ b/net/net.c
@@ -97,6 +97,7 @@
 #include <image.h>
 #include <log.h>
 #include <net.h>
+#include <time.h>
 #include <net/fastboot.h>
 #include <net/tftp.h>
 #if defined(CONFIG_CMD_PCAP)
diff --git a/net/sntp.c b/net/sntp.c
index 39d7664a224..8ecc0117ca7 100644
--- a/net/sntp.c
+++ b/net/sntp.c
@@ -11,6 +11,7 @@
 #include <log.h>
 #include <net.h>
 #include <rtc.h>
+#include <time.h>
 
 #include "sntp.h"
 
diff --git a/net/tftp.c b/net/tftp.c
index bffadd04ebd..e1e0042f157 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -16,6 +16,7 @@
 #include <log.h>
 #include <mapmem.h>
 #include <net.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <net/tftp.h>
 #include "bootp.h"
diff --git a/post/drivers/rtc.c b/post/drivers/rtc.c
index af701e464d3..7f14670317c 100644
--- a/post/drivers/rtc.c
+++ b/post/drivers/rtc.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 
 /*
  * RTC test
diff --git a/test/dm/regmap.c b/test/dm/regmap.c
index 809494d585e..4082778a56a 100644
--- a/test/dm/regmap.c
+++ b/test/dm/regmap.c
@@ -9,6 +9,7 @@
 #include <mapmem.h>
 #include <regmap.h>
 #include <syscon.h>
+#include <time.h>
 #include <asm/test.h>
 #include <dm/test.h>
 #include <linux/err.h>
-- 
2.28.0.163.g6104cc2f0b6-goog



More information about the U-Boot mailing list