summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Hornung <alex@alexhornung.com>2012-02-20 07:34:48 +0000
committerThomas Chou <thomas@wytron.com.tw>2012-02-23 08:31:20 +0800
commit7bd7b31574518bf9c7b3c83ef2831e27abb6b14e (patch)
tree412f701fab94ca7e8a258496cd1eb77c502c4e6e
parent8875833a86e567c0ca4258353116294089d24625 (diff)
downloadblackbird-obmc-uboot-7bd7b31574518bf9c7b3c83ef2831e27abb6b14e.tar.gz
blackbird-obmc-uboot-7bd7b31574518bf9c7b3c83ef2831e27abb6b14e.zip
nios2: implement get_ticks and get_tbclk
* Copy over Blackfin's get_ticks and get_tbclk - they work just fine on Nios2. Signed-off-by: Alex Hornung <alex@alexhornung.com> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
-rw-r--r--arch/nios2/cpu/interrupts.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/nios2/cpu/interrupts.c b/arch/nios2/cpu/interrupts.c
index 0a97fa6b6b..2ce689f63f 100644
--- a/arch/nios2/cpu/interrupts.c
+++ b/arch/nios2/cpu/interrupts.c
@@ -98,6 +98,27 @@ ulong get_timer (ulong base)
return (timestamp - base);
}
+/*
+ * This function is derived from Blackfin code (read timebase as long long).
+ * On Nios2 it just returns the timer value.
+ */
+unsigned long long get_ticks(void)
+{
+ return get_timer(0);
+}
+
+/*
+ * This function is derived from Blackfin code.
+ * On Nios2 it returns the number of timer ticks per second.
+ */
+ulong get_tbclk(void)
+{
+ ulong tbclk;
+
+ tbclk = CONFIG_SYS_HZ;
+ return tbclk;
+}
+
/* The board must handle this interrupt if a timer is not
* provided.
*/
OpenPOWER on IntegriCloud