Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHi Bernd,
First, do what Danny suggests: read the manual. Then review: http://forum.niosforum.com/forum/index.php?showtopic=3190 (http://forum.niosforum.com/forum/index.php?showtopic=3190) Then the following will be more useful: > I tried to use initd instruction after storing the registers onto the stack and > before resetting the Nios Use flushd to flush the entire data cache. Look at alt_dcache_flush_all() ... but do pay attention to the bug fix by James in the topic above. Or from u-boot: /* flush_dcache (unsigned char *p, int len)
*
* To flush entire cache:
* flush_dcache ((unsigned char *)0L, DCACHE_SIZE)
*/
.text
.global flush_dcache
flush_dcache:
add r5, r5, r4
movhi r8, %hi(CFG_DCACHELINE_SIZE)
ori r8, r8, %lo(CFG_DCACHELINE_SIZE)
0: flushd 0(r4)
add r4, r4, r8
bltu r4, r5, 0b
ret Regards, --Scott