From 5c9bf1d65530d85dcdcca329bee7ce93818a6e3e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Sun, 4 Sep 2022 03:28:59 +0200 Subject: [PATCH] Nokia RX-51: Do not clear unknown memory in lowlevel_init.S MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If kernel image in uImage or zImage format is not detected by lowlevel_init.S code then do not clear memory location where image was expected. If image is not detected then this memory region is unknown. So do not unconditionally clear it. Signed-off-by: Pali Rohár --- board/nokia/rx51/lowlevel_init.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/board/nokia/rx51/lowlevel_init.S b/board/nokia/rx51/lowlevel_init.S index 53697fd4e1..1cf8f8d8b2 100644 --- a/board/nokia/rx51/lowlevel_init.S +++ b/board/nokia/rx51/lowlevel_init.S @@ -76,7 +76,7 @@ save_boot_params: ldr r4, [r0, #36] /* r4 - 4 bytes header of kernel at offset 36 */ ldr r5, z_magic /* r5 - LINUX_ARM_ZIMAGE_MAGIC */ cmp r4, r5 - bne copy_kernel_end /* skip if invalid image */ + bne skip_copy /* skip if invalid image */ copy_kernel_loop: ldmdb r1!, {r3 - r10} @@ -84,12 +84,12 @@ copy_kernel_loop: cmp r1, r0 bhi copy_kernel_loop -copy_kernel_end: - /* remove header in source kernel image */ mov r5, #0 str r5, [r0] /* remove 4 bytes header of kernel uImage */ str r5, [r0, #36] /* remove 4 bytes header of kernel zImage */ +skip_copy: + /* Returns */ b save_boot_params_ret -- 2.39.5