]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arc/lib/init_helpers.c
arc: clean-up init procedure
[karo-tx-uboot.git] / arch / arc / lib / init_helpers.c
diff --git a/arch/arc/lib/init_helpers.c b/arch/arc/lib/init_helpers.c
new file mode 100644 (file)
index 0000000..25690ee
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int init_cache_f_r(void)
+{
+#ifndef CONFIG_SYS_ICACHE_OFF
+       icache_enable();
+       /* Make sure no stale entries persist from before we disabled cache */
+       invalidate_icache_all();
+#endif
+
+#ifndef CONFIG_SYS_DCACHE_OFF
+       dcache_enable();
+       /* Make sure no stale entries persist from before we disabled cache */
+       invalidate_dcache_all();
+#endif
+       return 0;
+}