]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
nios2: implement get_ticks and get_tbclk
authorAlex Hornung <alex@alexhornung.com>
Mon, 20 Feb 2012 07:34:48 +0000 (07:34 +0000)
committerThomas Chou <thomas@wytron.com.tw>
Thu, 23 Feb 2012 00:31:20 +0000 (08:31 +0800)
 * 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>
arch/nios2/cpu/interrupts.c

index 0a97fa6b6b513ffe5bd9898bc4f0f515b3640a9d..2ce689f63ff17b4c7239188d254e1998171ed20b 100644 (file)
@@ -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.
  */