summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <javier.jardon@codethink.co.uk>2015-05-06 21:24:22 +0100
committerJavier Jardón <jjardon@gnome.org>2015-05-06 22:26:12 +0100
commitfa757c05347386169c94e070a61619c70d0f4ba6 (patch)
tree8d723ce320e3c84f6693e486a0139b8cd6ef2d09
parenta5d63454aa36d3dc85835041f856c40cf1a40dd4 (diff)
downloadu-boot-fa757c05347386169c94e070a61619c70d0f4ba6.tar.gz
arch/arm/cpu/arm926ejs/aspeed/timer.c: Fix build
-rw-r--r--arch/arm/cpu/arm926ejs/aspeed/timer.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/arm/cpu/arm926ejs/aspeed/timer.c b/arch/arm/cpu/arm926ejs/aspeed/timer.c
index add4c0eef3..890d477fcd 100644
--- a/arch/arm/cpu/arm926ejs/aspeed/timer.c
+++ b/arch/arm/cpu/arm926ejs/aspeed/timer.c
@@ -17,17 +17,28 @@
#include <common.h>
+#define TIMER_LOAD_VAL 0xffffffff
+
+#ifdef CONFIG_ASPEED_TIMER_CLK
+
#if CONFIG_ASPEED_TIMER_CLK < CONFIG_SYS_HZ
#error "CONFIG_ASPEED_TIMER_CLK must be as large as CONFIG_SYS_HZ"
#endif
-#define TIMER_LOAD_VAL 0xffffffff
#define CLK_PER_HZ (CONFIG_ASPEED_TIMER_CLK / CONFIG_SYS_HZ)
/* macro to read the 32 bit timer */
#define READ_CLK (*(volatile ulong *)(CONFIG_SYS_TIMERBASE + 0))
#define READ_TIMER (READ_CLK / CLK_PER_HZ)
+#else
+
+/* macro to read the 32 bit timer */
+#define READ_TIMER (*(volatile ulong *)(CONFIG_SYS_TIMERBASE+0))
+
+#endif /* CONFIG_ASPEED_TIMER_CLK */
+
+
static ulong timestamp;
static ulong lastdec;