Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / sh / lib / time_sh2.c
index be3896c3ed71a62129b63d94e0989aff4bc30b0a..5484c543c6c8284a67716e3dcff824dd1ff16c1b 100644 (file)
@@ -1,16 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2007,2008 Nobobuhiro Iwamatsu <iwamatsu@nigauri.org>
  * Copyright (C) 2008 Renesas Solutions Corp.
  *
  * (C) Copyright 2003
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <init.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/processor.h>
+#include <linux/delay.h>
 
 #define CMT_CMCSR_INIT 0x0001  /* PCLK/32 */
 #define CMT_CMCSR_CALIB 0x0000
@@ -84,5 +86,5 @@ void __udelay(unsigned long usec)
 
 unsigned long get_tbclk(void)
 {
-       return CONFIG_SYS_HZ;
+       return CONFIG_SH_CMT_CLK_FREQ;
 }