[PATCH v2 22/35] common: Move get_tbclk() to time.h

Simon Glass sjg at chromium.org
Sat Dec 28 18:44:59 CET 2019


This function related to timer and most of the timer functions are in
time.h, so move this function there.

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

Changes in v2: None

 arch/arm/cpu/arm920t/imx/timer.c            | 2 +-
 arch/arm/cpu/arm926ejs/armada100/timer.c    | 2 +-
 arch/arm/cpu/sa1100/timer.c                 | 2 +-
 arch/arm/mach-at91/arm926ejs/timer.c        | 1 +
 arch/arm/mach-at91/armv7/timer.c            | 1 +
 arch/arm/mach-orion5x/timer.c               | 2 +-
 arch/arm/mach-versal/clk.c                  | 1 +
 arch/arm/mach-zynq/timer.c                  | 1 +
 arch/arm/mach-zynqmp/clk.c                  | 1 +
 arch/arm/mach-zynqmp/cpu.c                  | 1 +
 arch/mips/cpu/time.c                        | 1 +
 arch/powerpc/cpu/mpc83xx/cpu.c              | 1 +
 arch/powerpc/cpu/mpc83xx/spd_sdram.c        | 1 +
 arch/powerpc/cpu/mpc83xx/spl_minimal.c      | 1 +
 arch/powerpc/cpu/mpc85xx/cpu.c              | 3 ++-
 arch/powerpc/cpu/mpc85xx/fdt.c              | 1 +
 arch/powerpc/cpu/mpc85xx/interrupts.c       | 1 +
 arch/powerpc/cpu/mpc86xx/cpu.c              | 1 +
 arch/powerpc/cpu/mpc86xx/interrupts.c       | 1 +
 arch/powerpc/cpu/mpc8xx/cpu.c               | 1 +
 arch/powerpc/cpu/mpc8xx/fdt.c               | 1 +
 arch/powerpc/cpu/mpc8xx/interrupts.c        | 1 +
 board/armltd/integrator/timer.c             | 2 +-
 board/freescale/qemu-ppce500/qemu-ppce500.c | 3 ++-
 drivers/clk/clk_pic32.c                     | 1 +
 include/common.h                            | 1 -
 include/time.h                              | 2 ++
 27 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/arch/arm/cpu/arm920t/imx/timer.c b/arch/arm/cpu/arm920t/imx/timer.c
index 17081ddb6d..403cd8ae57 100644
--- a/arch/arm/cpu/arm920t/imx/timer.c
+++ b/arch/arm/cpu/arm920t/imx/timer.c
@@ -71,7 +71,7 @@ unsigned long long get_ticks(void)
  * This function is derived from PowerPC code (timebase clock frequency).
  * On ARM it returns the number of timer ticks per second.
  */
-ulong get_tbclk (void)
+ulong get_tbclk(void)
 {
 	return CONFIG_SYS_HZ;
 }
diff --git a/arch/arm/cpu/arm926ejs/armada100/timer.c b/arch/arm/cpu/arm926ejs/armada100/timer.c
index 6c6948a8ef..a11a4f3a5b 100644
--- a/arch/arm/cpu/arm926ejs/armada100/timer.c
+++ b/arch/arm/cpu/arm926ejs/armada100/timer.c
@@ -188,7 +188,7 @@ unsigned long long get_ticks(void)
  * This function is derived from PowerPC code (timebase clock frequency).
  * On ARM it returns the number of timer ticks per second.
  */
-ulong get_tbclk (void)
+ulong get_tbclk(void)
 {
 	return (ulong)CONFIG_SYS_HZ;
 }
diff --git a/arch/arm/cpu/sa1100/timer.c b/arch/arm/cpu/sa1100/timer.c
index c6b1b2c177..8e20c96bcd 100644
--- a/arch/arm/cpu/sa1100/timer.c
+++ b/arch/arm/cpu/sa1100/timer.c
@@ -59,7 +59,7 @@ unsigned long long get_ticks(void)
  * This function is derived from PowerPC code (timebase clock frequency).
  * On ARM it returns the number of timer ticks per second.
  */
-ulong get_tbclk (void)
+ulong get_tbclk(void)
 {
 	return CONFIG_SYS_HZ;
 }
diff --git a/arch/arm/mach-at91/arm926ejs/timer.c b/arch/arm/mach-at91/arm926ejs/timer.c
index f81e845593..31ad0bf702 100644
--- a/arch/arm/mach-at91/arm926ejs/timer.c
+++ b/arch/arm/mach-at91/arm926ejs/timer.c
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/at91_pit.h>
diff --git a/arch/arm/mach-at91/armv7/timer.c b/arch/arm/mach-at91/armv7/timer.c
index 9f08806fb1..15c036cc27 100644
--- a/arch/arm/mach-at91/armv7/timer.c
+++ b/arch/arm/mach-at91/armv7/timer.c
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/at91_pit.h>
diff --git a/arch/arm/mach-orion5x/timer.c b/arch/arm/mach-orion5x/timer.c
index 9da9783822..077eb63e74 100644
--- a/arch/arm/mach-orion5x/timer.c
+++ b/arch/arm/mach-orion5x/timer.c
@@ -165,7 +165,7 @@ unsigned long long get_ticks(void)
  * This function is derived from PowerPC code (timebase clock frequency).
  * On ARM it returns the number of timer ticks per second.
  */
-ulong get_tbclk (void)
+ulong get_tbclk(void)
 {
 	return (ulong)CONFIG_SYS_HZ;
 }
diff --git a/arch/arm/mach-versal/clk.c b/arch/arm/mach-versal/clk.c
index b82cea4ccb..9184714e47 100644
--- a/arch/arm/mach-versal/clk.c
+++ b/arch/arm/mach-versal/clk.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/arch/arm/mach-zynq/timer.c b/arch/arm/mach-zynq/timer.c
index 8658abb457..211ea15884 100644
--- a/arch/arm/mach-zynq/timer.c
+++ b/arch/arm/mach-zynq/timer.c
@@ -31,6 +31,7 @@
 #include <common.h>
 #include <div64.h>
 #include <dm.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/clk.h>
diff --git a/arch/arm/mach-zynqmp/clk.c b/arch/arm/mach-zynqmp/clk.c
index 0593b6310f..db2b4a8be2 100644
--- a/arch/arm/mach-zynqmp/clk.c
+++ b/arch/arm/mach-zynqmp/clk.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
diff --git a/arch/arm/mach-zynqmp/cpu.c b/arch/arm/mach-zynqmp/cpu.c
index b90d08bbdd..442427bc11 100644
--- a/arch/arm/mach-zynqmp/cpu.c
+++ b/arch/arm/mach-zynqmp/cpu.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/armv8/mmu.h>
diff --git a/arch/mips/cpu/time.c b/arch/mips/cpu/time.c
index af324f77ce..a1508e3b88 100644
--- a/arch/mips/cpu/time.c
+++ b/arch/mips/cpu/time.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/mipsregs.h>
 
 unsigned long notrace timer_read_counter(void)
diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c
index c3e25978a8..f4e25f1f59 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu.c
@@ -12,6 +12,7 @@
 #include <common.h>
 #include <cpu_func.h>
 #include <irq_func.h>
+#include <time.h>
 #include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
diff --git a/arch/powerpc/cpu/mpc83xx/spd_sdram.c b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
index a14a438b02..22506a5be5 100644
--- a/arch/powerpc/cpu/mpc83xx/spd_sdram.c
+++ b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
@@ -14,6 +14,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <time.h>
 #include <vsprintf.h>
 #include <asm/processor.h>
 #include <asm/io.h>
diff --git a/arch/powerpc/cpu/mpc83xx/spl_minimal.c b/arch/powerpc/cpu/mpc83xx/spl_minimal.c
index 75b03f3879..34c8187259 100644
--- a/arch/powerpc/cpu/mpc83xx/spl_minimal.c
+++ b/arch/powerpc/cpu/mpc83xx/spl_minimal.c
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <clock_legacy.h>
 #include <mpc83xx.h>
+#include <time.h>
 
 #include "lblaw/lblaw.h"
 #include "elbc/elbc.h"
diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c
index 18556629c3..9f9eed165b 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu.c
@@ -12,6 +12,7 @@
 #include <common.h>
 #include <cpu_func.h>
 #include <irq_func.h>
+#include <time.h>
 #include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
@@ -332,7 +333,7 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #ifndef CONFIG_SYS_FSL_TBCLK_DIV
 #define CONFIG_SYS_FSL_TBCLK_DIV 8
 #endif
-__weak unsigned long get_tbclk (void)
+__weak unsigned long get_tbclk(void)
 {
 	unsigned long tbclk_div = CONFIG_SYS_FSL_TBCLK_DIV;
 
diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c b/arch/powerpc/cpu/mpc85xx/fdt.c
index 4c3693e840..65f909fd1e 100644
--- a/arch/powerpc/cpu/mpc85xx/fdt.c
+++ b/arch/powerpc/cpu/mpc85xx/fdt.c
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <clock_legacy.h>
 #include <env.h>
+#include <time.h>
 #include <linux/libfdt.h>
 #include <fdt_support.h>
 #include <asm/processor.h>
diff --git a/arch/powerpc/cpu/mpc85xx/interrupts.c b/arch/powerpc/cpu/mpc85xx/interrupts.c
index e767573193..6f539d2677 100644
--- a/arch/powerpc/cpu/mpc85xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc85xx/interrupts.c
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <irq_func.h>
+#include <time.h>
 #include <watchdog.h>
 #include <command.h>
 #include <asm/processor.h>
diff --git a/arch/powerpc/cpu/mpc86xx/cpu.c b/arch/powerpc/cpu/mpc86xx/cpu.c
index bb14444a2e..97b93f0213 100644
--- a/arch/powerpc/cpu/mpc86xx/cpu.c
+++ b/arch/powerpc/cpu/mpc86xx/cpu.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <time.h>
 #include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
diff --git a/arch/powerpc/cpu/mpc86xx/interrupts.c b/arch/powerpc/cpu/mpc86xx/interrupts.c
index 0f930fcd9e..eb8e73e41c 100644
--- a/arch/powerpc/cpu/mpc86xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc86xx/interrupts.c
@@ -18,6 +18,7 @@
 #include <irq_func.h>
 #include <mpc86xx.h>
 #include <command.h>
+#include <time.h>
 #include <asm/processor.h>
 #ifdef CONFIG_POST
 #include <post.h>
diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c
index 0604433e72..4a1698d3bc 100644
--- a/arch/powerpc/cpu/mpc8xx/cpu.c
+++ b/arch/powerpc/cpu/mpc8xx/cpu.c
@@ -18,6 +18,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <time.h>
 #include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
diff --git a/arch/powerpc/cpu/mpc8xx/fdt.c b/arch/powerpc/cpu/mpc8xx/fdt.c
index 55c6588249..4719de4d72 100644
--- a/arch/powerpc/cpu/mpc8xx/fdt.c
+++ b/arch/powerpc/cpu/mpc8xx/fdt.c
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <linux/libfdt.h>
 #include <fdt_support.h>
 
diff --git a/arch/powerpc/cpu/mpc8xx/interrupts.c b/arch/powerpc/cpu/mpc8xx/interrupts.c
index 6ee6088fa8..3efe8956ec 100644
--- a/arch/powerpc/cpu/mpc8xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc8xx/interrupts.c
@@ -8,6 +8,7 @@
 #include <irq_func.h>
 #include <mpc8xx.h>
 #include <mpc8xx_irq.h>
+#include <time.h>
 #include <asm/cpm_8xx.h>
 #include <asm/processor.h>
 #include <asm/io.h>
diff --git a/board/armltd/integrator/timer.c b/board/armltd/integrator/timer.c
index e65ae997fd..d701669be0 100644
--- a/board/armltd/integrator/timer.c
+++ b/board/armltd/integrator/timer.c
@@ -153,7 +153,7 @@ unsigned long long get_ticks(void)
  * Return the timebase clock frequency
  * i.e. how often the timer decrements
  */
-ulong get_tbclk (void)
+ulong get_tbclk(void)
 {
 	unsigned long long tmp = CONFIG_SYS_HZ_CLOCK;
 
diff --git a/board/freescale/qemu-ppce500/qemu-ppce500.c b/board/freescale/qemu-ppce500/qemu-ppce500.c
index b9c7146466..e804cfe986 100644
--- a/board/freescale/qemu-ppce500/qemu-ppce500.c
+++ b/board/freescale/qemu-ppce500/qemu-ppce500.c
@@ -9,6 +9,7 @@
 #include <env.h>
 #include <init.h>
 #include <pci.h>
+#include <time.h>
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/fsl_pci.h>
@@ -337,7 +338,7 @@ int get_clocks(void)
 	return 0;
 }
 
-unsigned long get_tbclk (void)
+unsigned long get_tbclk(void)
 {
 	void *fdt = get_fdt_virt();
 	int cpus_node = fdt_path_offset(fdt, "/cpus");
diff --git a/drivers/clk/clk_pic32.c b/drivers/clk/clk_pic32.c
index b3ac0d5a92..79469c454f 100644
--- a/drivers/clk/clk_pic32.c
+++ b/drivers/clk/clk_pic32.c
@@ -8,6 +8,7 @@
 #include <clk-uclass.h>
 #include <dm.h>
 #include <div64.h>
+#include <time.h>
 #include <wait_bit.h>
 #include <dm/lists.h>
 #include <asm/io.h>
diff --git a/include/common.h b/include/common.h
index cc3d212a3d..1d85e5a68c 100644
--- a/include/common.h
+++ b/include/common.h
@@ -74,7 +74,6 @@ phys_size_t get_effective_memsize(void);
 int testdram(void);
 #endif /* CONFIG_SYS_DRAM_TEST */
 
-ulong	get_tbclk     (void);
 void	reset_misc    (void);
 void	reset_cpu     (ulong addr);
 
diff --git a/include/time.h b/include/time.h
index 71446c3171..e99f9c8012 100644
--- a/include/time.h
+++ b/include/time.h
@@ -6,6 +6,8 @@
 #include <linux/typecheck.h>
 #include <linux/types.h>
 
+ulong get_tbclk(void);
+
 unsigned long get_timer(unsigned long base);
 
 /*
-- 
2.24.1.735.g03f4e72817-goog



More information about the U-Boot mailing list