From: Sebastien Bourdeauducq Date: Thu, 2 Apr 2015 08:47:03 +0000 (+0800) Subject: libbase: implement flush_l2_cache for or1k X-Git-Tag: 24jan2021_ls180~2405 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=63f14f3f30f3641d9783740722ab963edf6d8210;p=litex.git libbase: implement flush_l2_cache for or1k --- diff --git a/software/libbase/system.c b/software/libbase/system.c index f0ea28fa..607d122d 100644 --- a/software/libbase/system.c +++ b/software/libbase/system.c @@ -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 } }