Skip to contentSkip to conversation

nios2: implement get_ticks and get_tbclk

PATCH New Alex Hornung 2 participants 2 messages Feb 20, 2012 – Feb 23, 2012 NIOS2 architecture

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 nios2: implement get_ticks and get_tbclk

* Copy over Blackfin's get_ticks and get_tbclk - they work just fine on Nios2.

---
 arch/nios2/cpu/interrupts.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
arch/nios2/cpu/interrupts.c +22 -0
index 0a97fa6..b7f1a05 100644
@@ -98,6 +98,28 @@ 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.
  */
Signature · 1 line
1.7.3.4
Applied
#1 lore raw

PATCH 2/2 nios2: implement get_ticks and get_tbclk

Quoted 7 lines · Alex Hornung

* Copy over Blackfin's get_ticks and get_tbclk - they work just fine on

    Nios2.
---
  arch/nios2/cpu/interrupts.c |   22 ++++++++++++++++++++++
  1 files changed, 22 insertions(+), 0 deletions(-)

Dear Alex,

Applied. Thanks.

Best regards,
Thomas