aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Deprez <olivier.deprez@arm.com>2021-03-23 18:22:37 +0100
committerOlivier Deprez <olivier.deprez@arm.com>2021-04-14 13:51:37 +0200
commitbc4cad961a84625bdbdf883dea961daa359fe666 (patch)
tree3619601dba760b524582aa36107a5cf5675fad81
parentd89d11b4838d69d422b6ba19138af6bf50a90b80 (diff)
downloadtf-a-tests-bc4cad961a84625bdbdf883dea961daa359fe666.tar.gz
spm: invalidate the data cache for the cactus image
There may be stale data cache entries prior to enabling MMU left by earlier boot stages. With this change ensure that the region used for the cactus image at SEL1 is invalidated in the data cache prior to enabling MMU. Signed-off-by: Olivier Deprez <olivier.deprez@arm.com> Change-Id: I8683dfe59919a90ecf97ffc9ce62715394afcc9a
-rw-r--r--spm/cactus/aarch64/cactus_entrypoint.S10
1 files changed, 10 insertions, 0 deletions
diff --git a/spm/cactus/aarch64/cactus_entrypoint.S b/spm/cactus/aarch64/cactus_entrypoint.S
index 7e6385694..7775b4697 100644
--- a/spm/cactus/aarch64/cactus_entrypoint.S
+++ b/spm/cactus/aarch64/cactus_entrypoint.S
@@ -32,6 +32,16 @@ secondary_cold_entry:
mul x2, x0, x2
sub sp, x1, x2
+ /*
+ * Invalidate the data cache for the whole partition.
+ * This prevents re-use of stale data cache entries from
+ * prior bootloader stages.
+ */
+ adrp x0, __TEXT_START__
+ adrp x1, __BSS_END__
+ sub x1, x1, x0
+ bl inv_dcache_range
+
/* Enable I-Cache */
mrs x1, sctlr_el1
orr x1, x1, #SCTLR_I_BIT