microwatt: Add icache flush
authorJoel Stanley <joel@jms.id.au>
Wed, 10 Jun 2020 01:09:16 +0000 (10:39 +0930)
committerJoel Stanley <joel@jms.id.au>
Wed, 10 Jun 2020 03:00:49 +0000 (12:30 +0930)
litex/soc/cores/cpu/microwatt/system.h

index 941dc56444364a40a5281c64eeeae0cebbb64ad6..c8c4e41c203673e3f89a480c4baad240c3be7097 100644 (file)
@@ -5,8 +5,11 @@
 extern "C" {
 #endif
 
-__attribute__((unused)) static void flush_cpu_icache(void){}; /* FIXME: do something useful here! */
-__attribute__((unused)) static void flush_cpu_dcache(void){}; /* FIXME: do something useful here! */
+static inline void flush_cpu_icache(void)
+{
+       __asm__ volatile ("icbi 0,0; isync" : : : "memory");
+}
+static inline void flush_cpu_dcache(void){}; /* FIXME: do something useful here! */
 void flush_l2_cache(void);
 
 void busy_wait(unsigned int ms);