Skip to content
Snippets Groups Projects
Commit 7bd7b315 authored by Alex Hornung's avatar Alex Hornung Committed by Thomas Chou
Browse files

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: default avatarAlex Hornung <alex@alexhornung.com>
Signed-off-by: default avatarThomas Chou <thomas@wytron.com.tw>
parent 8875833a
No related branches found
No related tags found
No related merge requests found
......@@ -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.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment