summaryrefslogtreecommitdiff
path: root/arch/arc/lib/init_helpers.c
diff options
context:
space:
mode:
authorAlexey Brodkin <abrodkin@synopsys.com>2015-02-24 16:40:36 (GMT)
committerAlexey Brodkin <abrodkin@synopsys.com>2015-04-03 06:47:49 (GMT)
commit3fb8016360d5433f3c4da51f8dd57550e7ef9018 (patch)
tree1cc2fe2a4723565e60279386122a35abe44cb36a /arch/arc/lib/init_helpers.c
parent8ee28251d95e237302c7c44929e59a813e147622 (diff)
downloadu-boot-fsl-qoriq-3fb8016360d5433f3c4da51f8dd57550e7ef9018.tar.xz
arc: clean-up init procedure
Intention behind this work was elimination of as much assembly-written code as it is possible. In case of ARC we already have relocation fix-up implemented in C so why don't we use C for U-Boot copying, .bss zeroing etc. It turned out x86 uses pretty similar approach so we re-used parts of code in "board_f.c" initially implemented for x86. Now assembly usage during init is limited to stack- and frame-pointer setup before and after relocation. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arc/lib/init_helpers.c')
-rw-r--r--arch/arc/lib/init_helpers.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arc/lib/init_helpers.c b/arch/arc/lib/init_helpers.c
new file mode 100644
index 0000000..25690ee
--- /dev/null
+++ b/arch/arc/lib/init_helpers.c
@@ -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;
+}