From 63f14f3f30f3641d9783740722ab963edf6d8210 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 2 Apr 2015 16:47:03 +0800 Subject: [PATCH] libbase: implement flush_l2_cache for or1k --- software/libbase/system.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 } } -- 2.30.2