summaryrefslogtreecommitdiffstats
path: root/arch/sparc/include
diff options
context:
space:
mode:
authorFrancois Retief <fgretief@spaceteq.co.za>2015-10-28 15:18:22 +0200
committerFrancois Retief <fgretief@spaceteq.co.za>2015-12-03 13:15:49 +0200
commitc97088c3cfa84e7e53fddd26896f145cc8c431a2 (patch)
tree6aed60fefa95f3b01e05a5ecf7e56bdb4e8eb409 /arch/sparc/include
parentc837901bf15616dd08997c30461e0f62bcd55245 (diff)
downloadtalos-obmc-uboot-c97088c3cfa84e7e53fddd26896f145cc8c431a2.tar.gz
talos-obmc-uboot-c97088c3cfa84e7e53fddd26896f145cc8c431a2.zip
sparc: Update cpu_init.c to use generic timer infrastructure
Introduce the CONFIG_SYS_TIMER_* macros in include/asm/config.h to make use of the generic timer infrastructure in lib/time.c. Created a timer_init() function to initialize the timer hardware and update the #ifdef in board_init_f to allow this function to be called during the start-up sequence. Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>
Diffstat (limited to 'arch/sparc/include')
-rw-r--r--arch/sparc/include/asm/config.h4
-rw-r--r--arch/sparc/include/asm/global_data.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/arch/sparc/include/asm/config.h b/arch/sparc/include/asm/config.h
index c884b250fe..455fbc1b73 100644
--- a/arch/sparc/include/asm/config.h
+++ b/arch/sparc/include/asm/config.h
@@ -14,4 +14,8 @@
#define CONFIG_LMB
#define CONFIG_SYS_BOOT_RAMDISK_HIGH
+#define CONFIG_SYS_TIMER_RATE 1000000 /* 1MHz */
+#define CONFIG_SYS_TIMER_COUNTER gd->arch.timer
+#define CONFIG_SYS_TIMER_COUNTS_DOWN
+
#endif
diff --git a/arch/sparc/include/asm/global_data.h b/arch/sparc/include/asm/global_data.h
index 8c6557ad1f..af38d17b0d 100644
--- a/arch/sparc/include/asm/global_data.h
+++ b/arch/sparc/include/asm/global_data.h
@@ -15,6 +15,7 @@
/* Architecture-specific global data */
struct arch_global_data {
+ void *timer;
void *uart;
unsigned int uart_freq;
#ifdef CONFIG_LEON3
OpenPOWER on IntegriCloud