All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [RFCv2 05/16] common: Drop time.h from common header
Date: Wed, 19 Aug 2020 09:08:57 -0400	[thread overview]
Message-ID: <20200819130908.4303-6-trini@konsulko.com> (raw)
In-Reply-To: <20200819130908.4303-1-trini@konsulko.com>

From: Simon Glass <sjg@chromium.org>

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

Signed-off-by: Simon Glass <sjg@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/coreboot/timestamp.c            | 1 +
 arch/x86/cpu/intel_common/mrc.c              | 1 +
 arch/x86/cpu/mp_init.c                       | 1 +
 arch/x86/cpu/quark/mrc.c                     | 1 +
 arch/x86/cpu/quark/mrc_util.c                | 1 +
 arch/x86/cpu/quark/smc.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/clone.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 +
 drivers/xen/pvblock.c                        | 1 +
 drivers/xen/xenbus.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 +
 200 files changed, 201 insertions(+), 1 deletion(-)

diff --git a/api/api.c b/api/api.c
index c7f5db776af9..2e955f7baf24 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 c7440278d8f8..2c8fbe6d2846 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@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 c68e0c0c3c44..9b97987fecb8 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 8344daeb39a2..5b8ce52f5c1e 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 6101eee3589c..b68e4bd355fb 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 da9faafe1ddc..940699337f1e 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 ef48d35aa4c2..6c21fd642cd4 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 e6c74bf77e9a..5e3d79b887f0 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 fb5e5b6f05c4..c40d8855125f 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 b1d7290704a4..56e0cfa98876 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 95e15c1a51bc..ada70743a335 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 900dee4c38a6..eb024b85116b 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 631bc04e9506..c5ced7e3f389 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 5b88d6e5e7b3..a1136f1558b8 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 ccc64eb77b4d..711d02c036ff 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 30d0395bb0e5..0af6e256ad18 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 dc076fc6e814..49f246b62e1e 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 27241050aaf5..3fa0e139e751 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 119b3ac50b42..8984bfd74458 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 bda0999327d9..14f32cbd9372 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 70badb15a3be..9baf4f65b366 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 e76f2805d7f9..3514ba215914 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/coreboot/timestamp.c b/arch/x86/cpu/coreboot/timestamp.c
index 016259780950..c2072535658a 100644
--- a/arch/x86/cpu/coreboot/timestamp.c
+++ b/arch/x86/cpu/coreboot/timestamp.c
@@ -9,6 +9,7 @@
 #include <bootstage.h>
 #include <asm/arch/timestamp.h>
 #include <asm/arch/sysinfo.h>
+#include <asm/u-boot-x86.h>
 #include <linux/compiler.h>
 
 struct timestamp_entry {
diff --git a/arch/x86/cpu/intel_common/mrc.c b/arch/x86/cpu/intel_common/mrc.c
index a97b0b7ceb41..eb27f8f18839 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 03bd71c261ab..bd656d09520f 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/arch/x86/cpu/quark/mrc.c b/arch/x86/cpu/quark/mrc.c
index 3e8c0bc28c5f..b55933ff9e55 100644
--- a/arch/x86/cpu/quark/mrc.c
+++ b/arch/x86/cpu/quark/mrc.c
@@ -34,6 +34,7 @@
 
 #include <common.h>
 #include <version.h>
+#include <asm/u-boot-x86.h>
 #include <asm/arch/mrc.h>
 #include <asm/arch/msg_port.h>
 #include "mrc_util.h"
diff --git a/arch/x86/cpu/quark/mrc_util.c b/arch/x86/cpu/quark/mrc_util.c
index b0bc59b71ef5..ce56c54279e9 100644
--- a/arch/x86/cpu/quark/mrc_util.c
+++ b/arch/x86/cpu/quark/mrc_util.c
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <hang.h>
+#include <asm/u-boot-x86.h>
 #include <asm/arch/device.h>
 #include <asm/arch/mrc.h>
 #include <asm/arch/msg_port.h>
diff --git a/arch/x86/cpu/quark/smc.c b/arch/x86/cpu/quark/smc.c
index b4b3e1204bd5..824fe02d754f 100644
--- a/arch/x86/cpu/quark/smc.c
+++ b/arch/x86/cpu/quark/smc.c
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <pci.h>
+#include <asm/u-boot-x86.h>
 #include <asm/arch/device.h>
 #include <asm/arch/mrc.h>
 #include <asm/arch/msg_port.h>
diff --git a/board/astro/mcf5373l/mcf5373l.c b/board/astro/mcf5373l/mcf5373l.c
index 3e2f79a1cf4c..cb336fca0465 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 4337f4879de7..9aa8f118baf5 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 319742178168..d37ba362b6cd 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 516f4e8edcac..a4104a9d202d 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 65be1719c2ce..5cf6a54dc60d 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 c78e90accbc5..b1bed64910cb 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 bc8379cccf6d..3a33e15eacc6 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 3c4133083f54..fb3d1fc42602 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/clone.c b/cmd/clone.c
index 97747f8f0808..ff8737e0d90e 100644
--- a/cmd/clone.c
+++ b/cmd/clone.c
@@ -9,6 +9,7 @@
 #include <malloc.h>
 #include <part.h>
 #include <blk.h>
+#include <time.h>
 #include <vsprintf.h>
 
 #define BUFSIZE (1 * 1024 * 1024)
diff --git a/cmd/gettime.c b/cmd/gettime.c
index 2e74e02b4998..ebaa45812a68 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 aae594c5e686..e8559936984f 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 20ab943494e9..36bca24fb20b 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 b3ff4b5773cf..249e2eee377d 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 d7044336ff2d..fbaa1de66ee1 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 6a87bb54abf6..5cadf732e96e 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 c879e8d6a8fd..75fd3e088ef0 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 e578f0be2846..af088bd72896 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 b316807844b1..3a81a3059956 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 6bf2375671d2..e8eb578f6964 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 47cdea1f586a..f251ee1b74a0 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 9021a00cdb6e..8071fe18a714 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 40fcc8d2e0fc..66dad034fa29 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 0efdfd028cfd..3fd56053faee 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 30a3727433e7..6c5097d94c72 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 3b008facb8c4..477379449ed0 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 4bea7fd900d8..e0674b8beba5 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 fae94f9663ab..355104f77d93 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 e40e427a25fe..95a361b0e861 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 da8fa315e366..bae31c3db1ee 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 b3e0537bab07..aae9250f1980 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 a11e48552534..86df6fa32d4f 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 fdc90c3f0e0a..6100fdfd0a5c 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 ee5dc1db96c1..57fbb0ce2620 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 cf892c69d9f3..6cd5d517de77 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 036fc4282b53..4129d6a68884 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 feeed1e9a2f9..b02f3883b0d1 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 3b79cb40cd3c..a7ac09a27e5c 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 e070caf43f2a..b133aa1175ea 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 4be32a1b38ce..567660f9a747 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 c1204815c20e..e4e504363798 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 ca14a0ecac71..af58c2c76efa 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 c11d6ff93d17..ef04ae5698a2 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 659461088b73..81d8e1eb11d4 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 43699fc24108..0fe92fe2357b 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 6c2fff1c52bf..fc60f5285aba 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 da264f4166ea..24e76052b88f 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 f07a51dc3076..74ece4762e3c 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 a5534b16673b..ccac7a60c129 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 4ad6c8ca66d2..0a4f45b2e89b 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 a191f061b898..8575e56a3371 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 153f971bdebe..d8778eeb3874 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 82abf484e4f7..d9e991355b7f 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 b793028ab53e..a138165855d4 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 7702f4be3f89..ce7cfb5930e5 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 0f9109a2c690..058ba8279408 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 e5ef0bcf6608..c9f0c2528e63 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 71818f964d37..113ed2b7a71b 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 719dd1e5e570..f70ced37d314 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 2899986fcf15..544534a78a71 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 8ec1f57a1b70..8101f6bcc277 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 c5e575286606..c54edd9c8d1f 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 f8da69e95894..94901e6d6b7d 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -15,6 +15,7 @@
 #include <malloc.h>
 #include <mmc.h>
 #include <sdhci.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 0e03b07ce555..f90463059304 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 cc78a2f2f08e..94e062c12464 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 feb46d8cf28f..74cf47b76372 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 48c0ca69de55..a57013e72c47 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 0c1bd7b4740a..32ee212694a5 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 cf20238782c6..964a329023d4 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 1f4c74f0f631..ad34af30e812 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 46dc29df3690..ee778e13aa13 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 7cd1e133c22a..693e088f19ad 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 224db72087b4..bccaa2d82128 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 2946f94b6df3..606e606fe8b6 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 bee273b1a644..02ca385ed2d4 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 63248f648a1b..ae8932d377cd 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 ad9b61f396f3..cfc137c6b956 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 b1034ac2086b..c292ddfb893f 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 4ac2b09f4dd3..3537fa6aaf78 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 0fd986bf9bf3..54f6d773f0fd 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 7c652e6c5351..970c6ee70432 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 c7ea60f5acc2..48cf45d9a8f9 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 2097718057bd..8b4ab9627c3b 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 9440a91882f9..d58ae075830c 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 0ab1a12d762e..c2f3a6483ddc 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 e46a269af909..3ff3824d52f0 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 b9d80a5b08a4..a93358af1a71 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 468be69886ca..c0fc3133afb4 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 d45f17eb8dda..4b94fd6405a0 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 265d813c4f89..d4a92a70e733 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 470c68467cde..ce3c406ea6c2 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 b340c5761087..bbd2aed0ab24 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 24a18ce96876..774c1e3bb51f 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 09cc8398003b..25c258dd3f75 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 1daafbe2b9bd..20d757f5dff0 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 23d5c88a88d3..6ab56e6e6538 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 3f6805791f46..5ff99273a02c 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 51d80f549673..555d9147d11e 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 fea6ba8caaa1..3ae9f805a790 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 a65700020d58..e74cfa993247 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 9f2327b92cd8..321429090f62 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 39284badf202..c69919faafe0 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 d15fabd92260..abd4e26543be 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 33ecd25f848f..dbc8bb81a7cd 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 16b2a2da7e7d..eed5e4289724 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 d025188eae98..ec87d3fea2d0 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 4fba7b527c6b..bc8724882153 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 9e45627a7424..74403a5a8944 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 41773893fd7c..faf291e5763f 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 7b29c368126b..d3b8b3b5afa5 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 cc5e1f6e25b6..a55e552177a6 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 3afe5b2fdd67..188560d3d459 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 aa1d6bb209bb..24e124e8083b 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 26d457255c94..2fead1aeffda 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 61372c52b050..c9ef5a69ea9d 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 f9675f75a401..77ec7c6ecda4 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 e1336b89c5a7..224c2b07919a 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 811b5d44fb27..4f4b7ea22e0e 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 14f68da2ee6e..cb1abf14416e 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 afe80e53d2ba..942db5ca5bab 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 ffba2d84f1fd..d08c26c8f4fe 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 1358bd103555..af130d4418b5 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 5228486082c2..2120b02d4444 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 1942c07c605c..b0075d3bb48c 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 6ea795bc0c98..01d7c2f47c15 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 8ff6c461f19f..195d8be8bf31 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 5489e728b6e2..9444c1b48137 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 32c3a3354206..fe832d413293 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 a253ee150270..60af8385b5d7 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 ef54e3b7b293..edd7d7840b96 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 92b7e9fd7cfc..84d84835cfdf 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 b293a808a3dd..dacf607ed83b 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 e4572ec6481c..a718eae3a0cc 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 af43433d88d6..c6eb22bdfd36 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 d19ac1d03531..2d9f2e4e33d0 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 cefe9d83b1dc..ec0b799e1492 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 f79f06320bfb..26400cac08c1 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 82b99eeef1e9..90a024068362 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 22e7b565b5bf..e9f87cfb7b0e 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 7c823f241a85..39d5988b36ab 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 092ed6eaf104..e3e8d09bf357 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 0a52e09e19f1..ea0a944a87bb 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 4d977aba34fc..20987b77ade2 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 8ac2f0a78adb..c212ecff7af3 100644
--- a/drivers/usb/musb-new/musb_uboot.c
+++ b/drivers/usb/musb-new/musb_uboot.c
@@ -2,6 +2,7 @@
 #include <console.h>
 #include <dm.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 c41b9147fa50..e8bc3f33597f 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 416a1c07b13f..84b31025f742 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 c4fbb1829446..16db3d38a2c2 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 000bd4814088..36d17deea580 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 6c2793226395..4f46b222b44c 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 59758eb93614..b09943897c18 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 52ab1b529159..119219e18bb0 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 1654d02860be..eb234cc9bf41 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 b837b045fa59..1e44df1da293 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/drivers/xen/pvblock.c b/drivers/xen/pvblock.c
index 76e82fbf41d8..916b0cabda31 100644
--- a/drivers/xen/pvblock.c
+++ b/drivers/xen/pvblock.c
@@ -9,6 +9,7 @@
 #include <dm/device-internal.h>
 #include <malloc.h>
 #include <part.h>
+#include <time.h>
 
 #include <asm/armv8/mmu.h>
 #include <asm/io.h>
diff --git a/drivers/xen/xenbus.c b/drivers/xen/xenbus.c
index 177d144723c1..1c5e0ff469e8 100644
--- a/drivers/xen/xenbus.c
+++ b/drivers/xen/xenbus.c
@@ -17,6 +17,7 @@
 
 #include <common.h>
 #include <log.h>
+#include <time.h>
 
 #include <asm/armv8/mmu.h>
 #include <asm/io.h>
diff --git a/fs/fs.c b/fs/fs.c
index 8326b6976bf0..23fad1da80f6 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 4a8fd88cdd79..4f0f680131f1 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 39b913743b55..06355767f6dd 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 a79c2bb49931..a904f41c366b 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 e89cc333e52a..4b9aa5ff405f 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 30183c5e7111..bae96a6ef0bc 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 10a9c073ba11..6a2932e391fb 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 d55ab54df97b..bbb02d4ad9ba 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 1d06ed25722b..7913812b9a22 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 de3dab4114d9..23b5b8ad9b95 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 5b1fe5b01037..677e39dd0318 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 d01d3eba120a..c35953f3e333 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 8aec3c79969b..16bc5c8b90ad 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 28d9eebf9dd3..8ee76fba4902 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 39d7664a2248..8ecc0117ca74 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 6fc8eb598ae4..9ba34d858c2f 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -15,6 +15,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 af701e464d36..7f14670317c1 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 bd21c8365dc3..16dd9b1eaff1 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.17.1

  parent reply	other threads:[~2020-08-19 13:08 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-02 22:59 [PATCH 00/16] common: Drop remaining includes in common.h Simon Glass
2020-08-02 22:59 ` [PATCH 01/16] common: Drop asm/global_data.h from common header Simon Glass
2020-08-02 22:59 ` [PATCH 02/16] common: Drop display_options.h " Simon Glass
2020-08-02 22:59 ` [PATCH 03/16] common: Drop linux/printk.h " Simon Glass
2020-08-02 22:59 ` [PATCH 04/16] Fix code style for time functions Simon Glass
2020-08-02 22:59 ` [PATCH 05/16] common: Drop time.h from common header Simon Glass
2020-08-02 22:59 ` [PATCH 06/16] common: Drop linux/string.h " Simon Glass
2020-08-02 22:59 ` [PATCH 07/16] common: Drop asm/u-boot.h " Simon Glass
2020-08-02 22:59 ` [PATCH 08/16] common: Drop stdio.h " Simon Glass
2020-08-02 22:59 ` [PATCH 09/16] common: Drop stdarg.h " Simon Glass
2020-08-02 22:59 ` [PATCH 10/16] common: Drop vsprintf.h " Simon Glass
2020-08-02 22:59 ` [PATCH 11/16] common: Drop errno.h " Simon Glass
2020-08-02 22:59 ` [PATCH 12/16] common: Drop linux/kernel.h " Simon Glass
2020-08-02 22:59 ` [PATCH 13/16] common: Drop linux/types.h " Simon Glass
2020-08-02 22:59 ` [PATCH 14/16] common: Move the build-system includes to a separate file Simon Glass
2020-08-02 22:59 ` [PATCH 15/16] common: Add a comment about the current state of common.h Simon Glass
2020-08-02 22:59 ` [PATCH 16/16] Makefile: Drop linux/kconfig.h from config.h Simon Glass
2020-08-19 13:08 ` [RFCv2] common: Drop remaining includes in common.h Tom Rini
2020-08-19 13:08   ` [RFCv2 01/16] common: Drop asm/global_data.h from common header Tom Rini
2020-08-19 13:08   ` [RFCv2 02/16] common: Drop display_options.h " Tom Rini
2020-08-19 13:08   ` [RFCv2 03/16] common: Drop linux/printk.h " Tom Rini
2020-08-19 13:08   ` [RFCv2 04/16] Fix code style for time functions Tom Rini
2020-08-19 13:08   ` Tom Rini [this message]
2020-08-19 13:08   ` [RFCv2 06/16] common: Drop linux/string.h from common header Tom Rini
2020-08-19 13:08   ` [RFCv2 07/16] common: Drop asm/u-boot.h " Tom Rini
2020-08-19 13:09   ` [RFCv2 08/16] common: Drop stdio.h " Tom Rini
2020-08-19 13:09   ` [RFCv2 09/16] common: Drop stdarg.h " Tom Rini
2020-08-19 13:09   ` [RFCv2 10/16] common: Drop vsprintf.h " Tom Rini
2020-08-19 13:09   ` [RFCv2 11/16] common: Drop errno.h " Tom Rini
2020-08-19 13:09   ` [RFCv2 12/16] common: Drop linux/kernel.h " Tom Rini
2020-08-19 13:09   ` [RFCv2 13/16] common: Drop linux/types.h " Tom Rini
2020-08-19 13:09   ` [RFCv2 14/16] common: Move the build-system includes to a separate file Tom Rini
2020-08-19 13:09   ` [RFCv2 15/16] common: Add a comment about the current state of common.h Tom Rini
2020-08-19 13:09   ` [RFCv2 16/16] Makefile: Drop linux/kconfig.h from config.h Tom Rini
2020-09-09  2:58   ` [RFCv2] common: Drop remaining includes in common.h Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200819130908.4303-6-trini@konsulko.com \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.