Browse Source

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

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

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Simon Glass 4 years ago
parent
commit
1045315df0
68 changed files with 78 additions and 5 deletions
  1. 1 0
      arch/arm/cpu/arm920t/ep93xx/timer.c
  2. 1 0
      arch/arm/cpu/arm920t/imx/timer.c
  3. 1 0
      arch/arm/cpu/arm926ejs/armada100/timer.c
  4. 1 0
      arch/arm/cpu/arm926ejs/lpc32xx/timer.c
  5. 1 0
      arch/arm/cpu/arm926ejs/mx27/timer.c
  6. 1 0
      arch/arm/cpu/arm926ejs/mxs/timer.c
  7. 1 0
      arch/arm/cpu/arm926ejs/spear/timer.c
  8. 1 0
      arch/arm/cpu/armv7/arch_timer.c
  9. 1 0
      arch/arm/cpu/armv7/iproc-common/timer.c
  10. 1 0
      arch/arm/cpu/armv7/s5p-common/timer.c
  11. 1 0
      arch/arm/cpu/armv7/stv0991/timer.c
  12. 1 0
      arch/arm/cpu/armv7/sunxi/timer.c
  13. 1 0
      arch/arm/cpu/armv7/vf610/timer.c
  14. 1 0
      arch/arm/cpu/armv7m/systick-timer.c
  15. 1 0
      arch/arm/cpu/sa1100/timer.c
  16. 1 0
      arch/arm/mach-at91/arm920t/timer.c
  17. 1 0
      arch/arm/mach-davinci/timer.c
  18. 1 0
      arch/arm/mach-omap2/timer.c
  19. 1 0
      arch/arm/mach-orion5x/timer.c
  20. 1 0
      arch/arm/mach-rmobile/timer.c
  21. 1 0
      arch/arm/mach-socfpga/clock_manager_gen5.c
  22. 1 0
      arch/arm/mach-sunxi/dram_helpers.c
  23. 1 0
      arch/arm/mach-sunxi/p2wi.c
  24. 1 0
      arch/arm/mach-sunxi/rsb.c
  25. 1 0
      arch/arm/mach-tegra/clock.c
  26. 1 0
      arch/microblaze/cpu/timer.c
  27. 1 0
      arch/mips/mach-jz47xx/jz4780/timer.c
  28. 1 0
      arch/nds32/cpu/n1213/ag101/timer.c
  29. 1 0
      arch/sh/lib/time_sh2.c
  30. 1 0
      arch/xtensa/lib/time.c
  31. 1 0
      board/armltd/integrator/timer.c
  32. 1 0
      board/broadcom/bcmstb/bcmstb.c
  33. 1 0
      board/xilinx/versal/board.c
  34. 1 0
      common/autoboot.c
  35. 1 0
      common/bootretry.c
  36. 1 0
      common/cli_readline.c
  37. 1 0
      common/iotrace.c
  38. 1 0
      drivers/clk/clk_stm32mp1.c
  39. 1 0
      drivers/mailbox/mailbox-uclass.c
  40. 1 0
      drivers/misc/tegra186_bpmp.c
  41. 1 0
      drivers/mmc/bcm2835_sdhci.c
  42. 1 0
      drivers/mmc/mxcmmc.c
  43. 1 0
      drivers/net/pic32_eth.c
  44. 1 0
      drivers/nvme/nvme.c
  45. 1 0
      drivers/power/pmic/stpmic1.c
  46. 1 0
      drivers/sound/broadwell_i2s.c
  47. 1 0
      drivers/spi/ath79_spi.c
  48. 1 0
      drivers/spi/exynos_spi.c
  49. 1 0
      drivers/spi/rk_spi.c
  50. 1 0
      drivers/spi/tegra114_spi.c
  51. 1 0
      drivers/spi/tegra20_sflash.c
  52. 1 0
      drivers/spi/tegra20_slink.c
  53. 1 0
      drivers/spi/tegra210_qspi.c
  54. 1 0
      drivers/spi/uniphier_spi.c
  55. 1 0
      drivers/spi/zynq_spi.c
  56. 1 0
      drivers/timer/tsc_timer.c
  57. 1 0
      drivers/video/sunxi/sunxi_display.c
  58. 1 0
      drivers/video/sunxi/sunxi_dw_hdmi.c
  59. 2 5
      include/common.h
  60. 10 0
      include/time.h
  61. 1 0
      lib/efi_loader/efi_boottime.c
  62. 1 0
      lib/efi_loader/efi_console.c
  63. 1 0
      lib/time.c
  64. 1 0
      lib/trace.c
  65. 1 0
      lib/uuid.c
  66. 1 0
      net/nfs.c
  67. 1 0
      post/post.c
  68. 1 0
      test/time_ut.c

+ 1 - 0
arch/arm/cpu/arm920t/ep93xx/timer.c

@@ -12,6 +12,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <linux/types.h>
 #include <asm/arch/ep93xx.h>
 #include <asm/io.h>

+ 1 - 0
arch/arm/cpu/arm920t/imx/timer.c

@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #if defined (CONFIG_IMX)
 
 #include <asm/arch/imx-regs.h>

+ 1 - 0
arch/arm/cpu/arm926ejs/armada100/timer.c

@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/armada100.h>
 

+ 1 - 0
arch/arm/cpu/arm926ejs/lpc32xx/timer.c

@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/timer.h>

+ 1 - 0
arch/arm/cpu/arm926ejs/mx27/timer.c

@@ -17,6 +17,7 @@
 
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 

+ 1 - 0
arch/arm/cpu/arm926ejs/mxs/timer.c

@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>

+ 1 - 0
arch/arm/cpu/arm926ejs/spear/timer.c

@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_gpt.h>

+ 1 - 0
arch/arm/cpu/armv7/arch_timer.c

@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <div64.h>
 #include <bootstage.h>

+ 1 - 0
arch/arm/cpu/armv7/iproc-common/timer.c

@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/iproc-common/timer.h>
 #include <asm/iproc-common/sysmap.h>

+ 1 - 0
arch/arm/cpu/armv7/s5p-common/timer.c

@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/pwm.h>
 #include <asm/arch/clk.h>

+ 1 - 0
arch/arm/cpu/armv7/stv0991/timer.c

@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch-stv0991/hardware.h>
 #include <asm/arch-stv0991/stv0991_cgu.h>

+ 1 - 0
arch/arm/cpu/armv7/sunxi/timer.c

@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/timer.h>
 

+ 1 - 0
arch/arm/cpu/armv7/vf610/timer.c

@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <div64.h>
 #include <asm/arch/imx-regs.h>

+ 1 - 0
arch/arm/cpu/armv7m/systick-timer.c

@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;

+ 1 - 0
arch/arm/cpu/sa1100/timer.c

@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <SA-1100.h>
+#include <time.h>
 
 static ulong get_timer_masked (void)
 {

+ 1 - 0
arch/arm/mach-at91/arm920t/timer.c

@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 
 #include <asm/io.h>
 #include <asm/arch/hardware.h>

+ 1 - 0
arch/arm/mach-davinci/timer.c

@@ -21,6 +21,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/timer_defs.h>
 #include <div64.h>

+ 1 - 0
arch/arm/mach-omap2/timer.c

@@ -16,6 +16,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/clock.h>

+ 1 - 0
arch/arm/mach-orion5x/timer.c

@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 
 #define UBOOT_CNTR	0	/* counter to use for uboot timer */

+ 1 - 0
arch/arm/mach-rmobile/timer.c

@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch-armv7/globaltimer.h>
 #include <asm/arch/rmobile.h>

+ 1 - 0
arch/arm/mach-socfpga/clock_manager_gen5.c

@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <dm.h>
 #include <asm/arch/clock_manager.h>

+ 1 - 0
arch/arm/mach-sunxi/dram_helpers.c

@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/barriers.h>
 #include <asm/io.h>
 #include <asm/arch/dram.h>

+ 1 - 0
arch/arm/mach-sunxi/p2wi.c

@@ -15,6 +15,7 @@
 
 #include <common.h>
 #include <errno.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/gpio.h>

+ 1 - 0
arch/arm/mach-sunxi/rsb.c

@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <errno.h>
+#include <time.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/prcm.h>

+ 1 - 0
arch/arm/mach-tegra/clock.c

@@ -9,6 +9,7 @@
 #include <div64.h>
 #include <dm.h>
 #include <errno.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/tegra.h>

+ 1 - 0
arch/microblaze/cpu/timer.c

@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <fdtdec.h>
+#include <time.h>
 #include <asm/microblaze_timer.h>
 #include <asm/microblaze_intc.h>
 

+ 1 - 0
arch/mips/mach-jz47xx/jz4780/timer.c

@@ -9,6 +9,7 @@
 #include <config.h>
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/mipsregs.h>
 #include <mach/jz4780.h>

+ 1 - 0
arch/nds32/cpu/n1213/ag101/timer.c

@@ -9,6 +9,7 @@
  */
 #ifndef CONFIG_TIMER
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <faraday/fttmr010.h>
 

+ 1 - 0
arch/sh/lib/time_sh2.c

@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 

+ 1 - 0
arch/xtensa/lib/time.c

@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <linux/stringify.h>
 

+ 1 - 0
board/armltd/integrator/timer.c

@@ -18,6 +18,7 @@
 
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 
 #ifdef CONFIG_ARCH_CINTEGRATOR
 #define DIV_CLOCK_INIT	1

+ 1 - 0
board/broadcom/bcmstb/bcmstb.c

@@ -6,6 +6,7 @@
  * Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
  */
 
+#include <time.h>
 #include <linux/types.h>
 #include <common.h>
 #include <env.h>

+ 1 - 0
board/xilinx/versal/board.c

@@ -7,6 +7,7 @@
 #include <common.h>
 #include <fdtdec.h>
 #include <malloc.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>

+ 1 - 0
common/autoboot.c

@@ -15,6 +15,7 @@
 #include <memalign.h>
 #include <menu.h>
 #include <post.h>
+#include <time.h>
 #include <u-boot/sha256.h>
 #include <bootcount.h>
 

+ 1 - 0
common/bootretry.c

@@ -9,6 +9,7 @@
 #include <cli.h>
 #include <env.h>
 #include <errno.h>
+#include <time.h>
 #include <watchdog.h>
 
 #ifndef CONFIG_BOOT_RETRY_MIN

+ 1 - 0
common/cli_readline.c

@@ -11,6 +11,7 @@
 #include <common.h>
 #include <bootretry.h>
 #include <cli.h>
+#include <time.h>
 #include <watchdog.h>
 
 DECLARE_GLOBAL_DATA_PTR;

+ 1 - 0
common/iotrace.c

@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <mapmem.h>
+#include <time.h>
 #include <asm/io.h>
 #include <u-boot/crc.h>
 

+ 1 - 0
drivers/clk/clk_stm32mp1.c

@@ -10,6 +10,7 @@
 #include <regmap.h>
 #include <spl.h>
 #include <syscon.h>
+#include <time.h>
 #include <vsprintf.h>
 #include <linux/io.h>
 #include <linux/iopoll.h>

+ 1 - 0
drivers/mailbox/mailbox-uclass.c

@@ -7,6 +7,7 @@
 #include <dm.h>
 #include <mailbox.h>
 #include <mailbox-uclass.h>
+#include <time.h>
 
 static inline struct mbox_ops *mbox_dev_ops(struct udevice *dev)
 {

+ 1 - 0
drivers/misc/tegra186_bpmp.c

@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <dm/lists.h>
 #include <dm/root.h>
 #include <mailbox.h>

+ 1 - 0
drivers/mmc/bcm2835_sdhci.c

@@ -41,6 +41,7 @@
 #include <malloc.h>
 #include <memalign.h>
 #include <sdhci.h>
+#include <time.h>
 #include <asm/arch/msg.h>
 #include <asm/arch/mbox.h>
 #include <mach/sdhci.h>

+ 1 - 0
drivers/mmc/mxcmmc.c

@@ -23,6 +23,7 @@
 #include <part.h>
 #include <malloc.h>
 #include <mmc.h>
+#include <time.h>
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>

+ 1 - 0
drivers/net/pic32_eth.c

@@ -9,6 +9,7 @@
 #include <net.h>
 #include <miiphy.h>
 #include <console.h>
+#include <time.h>
 #include <wait_bit.h>
 #include <asm/gpio.h>
 

+ 1 - 0
drivers/nvme/nvme.c

@@ -9,6 +9,7 @@
 #include <errno.h>
 #include <memalign.h>
 #include <pci.h>
+#include <time.h>
 #include <dm/device-internal.h>
 #include "nvme.h"
 

+ 1 - 0
drivers/power/pmic/stpmic1.c

@@ -9,6 +9,7 @@
 #include <i2c.h>
 #include <misc.h>
 #include <sysreset.h>
+#include <time.h>
 #include <dm/device.h>
 #include <dm/lists.h>
 #include <power/pmic.h>

+ 1 - 0
drivers/sound/broadwell_i2s.c

@@ -12,6 +12,7 @@
 #include <common.h>
 #include <dm.h>
 #include <i2s.h>
+#include <time.h>
 #include <asm/io.h>
 #include "broadwell_i2s.h"
 

+ 1 - 0
drivers/spi/ath79_spi.c

@@ -8,6 +8,7 @@
 #include <dm.h>
 #include <div64.h>
 #include <errno.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/addrspace.h>
 #include <asm/types.h>

+ 1 - 0
drivers/spi/exynos_spi.c

@@ -10,6 +10,7 @@
 #include <malloc.h>
 #include <spi.h>
 #include <fdtdec.h>
+#include <time.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/cpu.h>

+ 1 - 0
drivers/spi/rk_spi.c

@@ -16,6 +16,7 @@
 #include <dt-structs.h>
 #include <errno.h>
 #include <spi.h>
+#include <time.h>
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/arch-rockchip/clock.h>

+ 1 - 0
drivers/spi/tegra114_spi.c

@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch-tegra/clk_rst.h>

+ 1 - 0
drivers/spi/tegra20_sflash.c

@@ -8,6 +8,7 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
 #include <asm/arch/clock.h>

+ 1 - 0
drivers/spi/tegra20_slink.c

@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch-tegra/clk_rst.h>

+ 1 - 0
drivers/spi/tegra210_qspi.c

@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch-tegra/clk_rst.h>

+ 1 - 0
drivers/spi/uniphier_spi.c

@@ -7,6 +7,7 @@
 #include <clk.h>
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <linux/bitfield.h>
 #include <linux/io.h>
 #include <spi.h>

+ 1 - 0
drivers/spi/zynq_spi.c

@@ -10,6 +10,7 @@
 #include <dm.h>
 #include <malloc.h>
 #include <spi.h>
+#include <time.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;

+ 1 - 0
drivers/timer/tsc_timer.c

@@ -9,6 +9,7 @@
 #include <common.h>
 #include <dm.h>
 #include <malloc.h>
+#include <time.h>
 #include <timer.h>
 #include <asm/cpu.h>
 #include <asm/io.h>

+ 1 - 0
drivers/video/sunxi/sunxi_display.c

@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <efi_loader.h>
+#include <time.h>
 
 #include <asm/arch/clock.h>
 #include <asm/arch/display.h>

+ 1 - 0
drivers/video/sunxi/sunxi_dw_hdmi.c

@@ -10,6 +10,7 @@
 #include <dm.h>
 #include <dw_hdmi.h>
 #include <edid.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/lcdc.h>

+ 2 - 5
include/common.h

@@ -3,8 +3,8 @@
  * Common header file for U-Boot
  *
  * This file still includes quite a bit of stuff that should be in separate
- * headers like command.h, cpu.h and timer.h. Please think before adding more
- * things. Patches to remove things are welcome.
+ * headers like command.h and cpu.h. Please think before adding more things.
+ * Patches to remove things are welcome.
  *
  * (C) Copyright 2000-2009
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
@@ -281,9 +281,6 @@ enum {
  */
 int cleanup_before_linux_select(int flags);
 
-/* arch/$(ARCH)/lib/ticks.S */
-uint64_t get_ticks(void);
-
 /* lib/uuid.c */
 #include <uuid.h>
 

+ 10 - 0
include/time.h

@@ -103,4 +103,14 @@ void wait_ticks(unsigned long ticks);
  */
 unsigned long timer_get_us(void);
 
+/**
+ * get_ticks() - Get the current tick value
+ *
+ * This is an internal value used by the timer on the system. Ticks increase
+ * monotonically at the rate given by get_tbclk().
+ *
+ * @return current tick value
+ */
+uint64_t get_ticks(void);
+
 #endif /* _TIME_H */

+ 1 - 0
lib/efi_loader/efi_boottime.c

@@ -9,6 +9,7 @@
 #include <div64.h>
 #include <efi_loader.h>
 #include <malloc.h>
+#include <time.h>
 #include <linux/libfdt_env.h>
 #include <u-boot/crc.h>
 #include <bootm.h>

+ 1 - 0
lib/efi_loader/efi_console.c

@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <charset.h>
+#include <time.h>
 #include <dm/device.h>
 #include <efi_loader.h>
 #include <env.h>

+ 1 - 0
lib/time.c

@@ -7,6 +7,7 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
+#include <time.h>
 #include <timer.h>
 #include <watchdog.h>
 #include <div64.h>

+ 1 - 0
lib/trace.c

@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <mapmem.h>
+#include <time.h>
 #include <trace.h>
 #include <asm/io.h>
 #include <asm/sections.h>

+ 1 - 0
lib/uuid.c

@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <time.h>
 #include <linux/ctype.h>
 #include <errno.h>
 #include <common.h>

+ 1 - 0
net/nfs.c

@@ -33,6 +33,7 @@
 #include <mapmem.h>
 #include "nfs.h"
 #include "bootp.h"
+#include <time.h>
 
 #define HASHES_PER_LINE 65	/* Number of "loading" hashes per line	*/
 #define NFS_RETRY_COUNT 30

+ 1 - 0
post/post.c

@@ -7,6 +7,7 @@
 #include <common.h>
 #include <env.h>
 #include <stdio_dev.h>
+#include <time.h>
 #include <watchdog.h>
 #include <div64.h>
 #include <post.h>

+ 1 - 0
test/time_ut.c

@@ -7,6 +7,7 @@
 #include <common.h>
 #include <command.h>
 #include <errno.h>
+#include <time.h>
 
 static int test_get_timer(void)
 {