summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/lib/cache.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c
index 1a589c7e2a..7a16015867 100644
--- a/arch/arm/lib/cache.c
+++ b/arch/arm/lib/cache.c
@@ -159,6 +159,15 @@ __weak int arm_reserve_mmu(void)
*/
gd->arch.tlb_allocated = gd->arch.tlb_addr;
#endif
+
+ if (IS_ENABLED(CONFIG_CMO_BY_VA_ONLY)) {
+ /*
+ * As invalidate_dcache_all() will be called before
+ * mmu_setup(), we should make sure that the PTs are
+ * already in a valid state.
+ */
+ memset((void *)gd->arch.tlb_addr, 0, gd->arch.tlb_size);
+ }
#endif
return 0;