Skip to content

Commit

Permalink
libbase: implement flush_l2_cache for or1k
Browse files Browse the repository at this point in the history
sbourdeauducq committed Apr 2, 2015
1 parent 382ed01 commit 63f14f3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions software/libbase/system.c
Original file line number Diff line number Diff line change
@@ -78,10 +78,12 @@ void flush_l2_cache(void)
l2_nwords = 1 << wishbone2lasmi_cachesize_read();
for(i=0;i<2*l2_nwords;i++) {
addr = MAIN_RAM_BASE + i*4;
#ifdef __lm32__
#if defined (__lm32__)
__asm__ volatile("lw %0, (%1+0)\n":"=r"(dummy):"r"(addr));
#elif defined (__or1k__)
__asm__ volatile("l.lwz %0, 0(%1)\n":"=r"(dummy):"r"(addr));
#else
#warning TODO
#error Unsupported architecture
#endif
}
}

0 comments on commit 63f14f3

Please sign in to comment.