Commit e114412f authored by Ard Biesheuvel's avatar Ard Biesheuvel

ARM: decompressor: prepare cache_clean_flush for doing by-VA maintenance

In preparation for turning the decompressor's cache clean/flush
operations into proper by-VA maintenance for v7 cores, pass the
start and end addresses of the regions that need cache maintenance
into cache_clean_flush in registers r0 and r1.

Currently, all implementations of cache_clean_flush ignore these
values, so no functional change is expected as a result of this
patch.
Tested-by: default avatarTony Lindgren <tony@atomide.com>
Tested-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent 184bf653
...@@ -528,6 +528,8 @@ dtb_check_done: ...@@ -528,6 +528,8 @@ dtb_check_done:
/* Preserve offset to relocated code. */ /* Preserve offset to relocated code. */
sub r6, r9, r6 sub r6, r9, r6
mov r0, r9 @ start of relocated zImage
add r1, sp, r6 @ end of relocated zImage
#ifndef CONFIG_ZBOOT_ROM #ifndef CONFIG_ZBOOT_ROM
/* cache_clean_flush may use the stack, so relocate it */ /* cache_clean_flush may use the stack, so relocate it */
add sp, sp, r6 add sp, sp, r6
...@@ -629,6 +631,11 @@ not_relocated: mov r0, #0 ...@@ -629,6 +631,11 @@ not_relocated: mov r0, #0
add r2, sp, #0x10000 @ 64k max add r2, sp, #0x10000 @ 64k max
mov r3, r7 mov r3, r7
bl decompress_kernel bl decompress_kernel
get_inflated_image_size r1, r2, r3
mov r0, r4 @ start of inflated image
add r1, r1, r0 @ end of inflated image
bl cache_clean_flush bl cache_clean_flush
bl cache_off bl cache_off
...@@ -1182,6 +1189,9 @@ __armv7_mmu_cache_off: ...@@ -1182,6 +1189,9 @@ __armv7_mmu_cache_off:
/* /*
* Clean and flush the cache to maintain consistency. * Clean and flush the cache to maintain consistency.
* *
* On entry,
* r0 = start address
* r1 = end address (exclusive)
* On exit, * On exit,
* r1, r2, r3, r9, r10, r11, r12 corrupted * r1, r2, r3, r9, r10, r11, r12 corrupted
* This routine must preserve: * This routine must preserve:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment