commit 2325fcee1b723ddb76de59e811eddd4b84683cfb
parent 7295f73733261237a25a956e23aea16bc98e024e
Author: Dimitris Papastamos <dimitris.papastamos@arm.com>
Date: Wed, 17 Oct 2018 11:06:40 +0100
[arm64/crt] Scrub SRAM
One of the requirements of the SysArch specification is to scrub SRAM
before using it.
Change-Id: I0dfe4fd1fcc1090fc56fc77207926acccfad06b1
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
Diffstat:
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/arch/arm64/crt-none.s b/arch/arm64/crt-none.s
@@ -9,6 +9,10 @@ _start:
getpc:
sub x30,x30,4
+ ldr x0,=SRAMADDR
+ mov x1,#SRAMSIZE
+ bl initmem
+
adr x0,vectbl
msr S3_6_C12_C0_6,x0 /* VBAR_R */
isb
@@ -28,6 +32,17 @@ getpc:
adr x0,outsync
b panic
+/* Scrub SRAM */
+initmem:
+ stp xzr,xzr,[x0],#16
+ stp xzr,xzr,[x0],#16
+ stp xzr,xzr,[x0],#16
+ stp xzr,xzr,[x0],#16
+ sub x1,x1,#64
+ cmp x1,#0
+ b.ne initmem
+ ret
+
.section .rodata
outsync:
.asciz "out of sync"