* [U-Boot] [PATCH 2/2] nios2: implement get_ticks and get_tbclk
@ 2012-02-20 7:34 Alex Hornung
2012-02-23 0:01 ` Thomas Chou
0 siblings, 1 reply; 2+ messages in thread
From: Alex Hornung @ 2012-02-20 7:34 UTC (permalink / raw)
To: u-boot
* Copy over Blackfin's get_ticks and get_tbclk - they work just fine on
Nios2.
Signed-off-by: Alex Hornung <alex@alexhornung.com>
---
arch/nios2/cpu/interrupts.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/arch/nios2/cpu/interrupts.c b/arch/nios2/cpu/interrupts.c
index 0a97fa6..b7f1a05 100644
--- a/arch/nios2/cpu/interrupts.c
+++ b/arch/nios2/cpu/interrupts.c
@@ -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.
*/
--
1.7.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH 2/2] nios2: implement get_ticks and get_tbclk
2012-02-20 7:34 [U-Boot] [PATCH 2/2] nios2: implement get_ticks and get_tbclk Alex Hornung
@ 2012-02-23 0:01 ` Thomas Chou
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Chou @ 2012-02-23 0:01 UTC (permalink / raw)
To: u-boot
On 02/20/2012 03:34 PM, Alex Hornung wrote:
> * Copy over Blackfin's get_ticks and get_tbclk - they work just fine on
> Nios2.
>
> Signed-off-by: Alex Hornung<alex@alexhornung.com>
> ---
> arch/nios2/cpu/interrupts.c | 22 ++++++++++++++++++++++
> 1 files changed, 22 insertions(+), 0 deletions(-)
Dear Alex,
Applied. Thanks.
Best regards,
Thomas
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-23 0:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-20 7:34 [U-Boot] [PATCH 2/2] nios2: implement get_ticks and get_tbclk Alex Hornung
2012-02-23 0:01 ` Thomas Chou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox