|
@@ -65,3 +65,26 @@ __weak void l2_cache_disable(void) {}
|
|
#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD)
|
|
#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD)
|
|
__weak void invalidate_l2_cache(void) {}
|
|
__weak void invalidate_l2_cache(void) {}
|
|
#endif
|
|
#endif
|
|
|
|
+
|
|
|
|
+#ifndef CONFIG_SYS_ICACHE_OFF
|
|
|
|
+/* Invalidate entire I-cache and branch predictor array */
|
|
|
|
+void invalidate_icache_all(void)
|
|
|
|
+{
|
|
|
|
+ unsigned long i = 0;
|
|
|
|
+
|
|
|
|
+ asm ("mcr p15, 0, %0, c7, c5, 0" : : "r" (i));
|
|
|
|
+}
|
|
|
|
+#else
|
|
|
|
+void invalidate_icache_all(void) {}
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+void enable_caches(void)
|
|
|
|
+{
|
|
|
|
+#ifndef CONFIG_SYS_ICACHE_OFF
|
|
|
|
+ icache_enable();
|
|
|
|
+#endif
|
|
|
|
+#ifndef CONFIG_SYS_DCACHE_OFF
|
|
|
|
+ dcache_enable();
|
|
|
|
+#endif
|
|
|
|
+}
|
|
|
|
+
|