summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-03-15 12:29:01 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-04-04 07:44:27 +0200
commit4b57aae26c0ada3139ccb1011bdcbd88dc7e1a91 (patch)
tree027528aa2f7dd853dea84683bcadcba1bf58c441
parent4800d18fb0680d080b73999dd39198411fbf8f4f (diff)
downloadbarebox-4b57aae26c0ada3139ccb1011bdcbd88dc7e1a91.tar.gz
barebox-4b57aae26c0ada3139ccb1011bdcbd88dc7e1a91.tar.xz
ARM: Create own cache.c file for aarch64
cache.c does not work properly for aarch64. We create a struct cache_fns using C preprocessor foo which assumes the existence of cache maintenance operations with a certain name. These functions have other names on aarch64. While we could fix this we do not need the automatic cache function selection on aarch64 since here we only have one function set. Create a separate file and be done with this issue. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/cpu/Makefile4
-rw-r--r--arch/arm/cpu/cache.c16
-rw-r--r--arch/arm/cpu/cache_64.c35
3 files changed, 37 insertions, 18 deletions
diff --git a/arch/arm/cpu/Makefile b/arch/arm/cpu/Makefile
index edd4a290ca..f79cedd085 100644
--- a/arch/arm/cpu/Makefile
+++ b/arch/arm/cpu/Makefile
@@ -10,7 +10,7 @@ endif
obj-y += start.o entry.o
-obj-pbl-y += setupc$(S64).o
+obj-pbl-y += setupc$(S64).o cache$(S64).o
#
# Any variants can be called as start-armxyz.S
@@ -44,4 +44,4 @@ pbl-y += entry.o
pbl-$(CONFIG_PBL_SINGLE_IMAGE) += start-pbl.o
pbl-$(CONFIG_PBL_MULTI_IMAGES) += uncompress.o
-obj-pbl-y += common.o cache.o sections.o
+obj-pbl-y += common.o sections.o
diff --git a/arch/arm/cpu/cache.c b/arch/arm/cpu/cache.c
index 1a8f49d301..7047470f0c 100644
--- a/arch/arm/cpu/cache.c
+++ b/arch/arm/cpu/cache.c
@@ -102,11 +102,6 @@ int arm_set_cache_functions(void)
cache_fns = &cache_fns_armv7;
break;
#endif
-#ifdef CONFIG_CPU_64v8
- case CPU_ARCH_ARMv8:
- cache_fns = &cache_fns_armv8;
- break;
-#endif
default:
while(1);
}
@@ -144,11 +139,6 @@ void arm_early_mmu_cache_flush(void)
v7_mmu_cache_flush();
return;
#endif
-#ifdef CONFIG_CPU_64v8
- case CPU_ARCH_ARMv8:
- v8_flush_dcache_all();
- return;
-#endif
}
}
@@ -171,12 +161,6 @@ void arm_early_mmu_cache_invalidate(void)
v7_mmu_cache_invalidate();
return;
#endif
-#else
-#ifdef CONFIG_CPU_64v8
- case CPU_ARCH_ARMv8:
- v8_invalidate_icache_all();
- return;
-#endif
#endif
}
}
diff --git a/arch/arm/cpu/cache_64.c b/arch/arm/cpu/cache_64.c
new file mode 100644
index 0000000000..45f01e8dc9
--- /dev/null
+++ b/arch/arm/cpu/cache_64.c
@@ -0,0 +1,35 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#include <common.h>
+#include <init.h>
+#include <asm/mmu.h>
+#include <asm/cache.h>
+#include <asm/system_info.h>
+
+int arm_set_cache_functions(void)
+{
+ return 0;
+}
+
+/*
+ * Early function to flush the caches. This is for use when the
+ * C environment is not yet fully initialized.
+ */
+void arm_early_mmu_cache_flush(void)
+{
+ v8_flush_dcache_all();
+}
+
+void arm_early_mmu_cache_invalidate(void)
+{
+ v8_invalidate_icache_all();
+}