aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2012-04-09 17:00:45 +0200
committerWolfgang Denk <wd@denx.de>2012-04-09 17:00:45 +0200
commit5c877b1ae0a4219ed6bd8d32cf3f7106b81ecb3b (patch)
treecdcad9a534e5cd03a40c69bd51ab1b84d7092231 /arch
parent8ec57a9dc1de46836bf8f81f0911b4bc26e0e6c7 (diff)
parentbb60db634c26d609b289e114f44cc2c94ee64c4f (diff)
Merge branch 'master' of git://git.denx.de/u-boot-nios
* 'master' of git://git.denx.de/u-boot-nios: nios2 - adjust gbl data off to account for bd_info nios2: implement get_ticks and get_tbclk nios2: add flush_dcache_range function
Diffstat (limited to 'arch')
-rw-r--r--arch/nios2/cpu/interrupts.c21
-rw-r--r--arch/nios2/lib/cache.S10
2 files changed, 31 insertions, 0 deletions
diff --git a/arch/nios2/cpu/interrupts.c b/arch/nios2/cpu/interrupts.c
index 0a97fa6b6..2ce689f63 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.
*/
diff --git a/arch/nios2/lib/cache.S b/arch/nios2/lib/cache.S
index ee3b4b79b..b952d0c90 100644
--- a/arch/nios2/lib/cache.S
+++ b/arch/nios2/lib/cache.S
@@ -48,6 +48,16 @@ flush_icache:
bltu r4, r5, 1b
ret
+ .global flush_dcache_range
+
+flush_dcache_range:
+ movhi r8, %hi(CONFIG_SYS_DCACHELINE_SIZE)
+ ori r8, r8, %lo(CONFIG_SYS_DCACHELINE_SIZE)
+0: flushd 0(r4)
+ add r4, r4, r8
+ bltu r4, r5, 0b
+ ret
+
.global flush_cache
flush_cache: