summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew F. Davis <afd@ti.com>2017-07-26 14:53:19 -0500
committerTom Rini <trini@konsulko.com>2017-07-31 12:21:39 -0400
commitef3fc42ded96403284e5e9bf37b63d332aedd7b4 (patch)
tree19d8ce5f4b67ed1495fa6f3e5f5d9c32e1990fef
parentc826d1728673b7c692091048f0e434fcb9fd0d80 (diff)
arm: mach-omap2: Align image address before cache operations
The image address passed to secure_boot_verify_image() may not be cacheline aligned, round the address down to the nearest cacheline. Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
-rw-r--r--arch/arm/mach-omap2/sec-common.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/sec-common.c b/arch/arm/mach-omap2/sec-common.c
index 030b36f332..2d54a3165e 100644
--- a/arch/arm/mach-omap2/sec-common.c
+++ b/arch/arm/mach-omap2/sec-common.c
@@ -112,8 +112,8 @@ int secure_boot_verify_image(void **image, size_t *size)
/* Perform cache writeback on input buffer */
flush_dcache_range(
- (u32)*image,
- (u32)*image + roundup(*size, ARCH_DMA_MINALIGN));
+ rounddown((u32)*image, ARCH_DMA_MINALIGN),
+ roundup((u32)*image + *size, ARCH_DMA_MINALIGN));
cert_addr = (uint32_t)*image;
sig_addr = find_sig_start((char *)*image, *size);
@@ -151,8 +151,8 @@ int secure_boot_verify_image(void **image, size_t *size)
/* Perform cache writeback on output buffer */
flush_dcache_range(
- (u32)*image,
- (u32)*image + roundup(*size, ARCH_DMA_MINALIGN));
+ rounddown((u32)*image, ARCH_DMA_MINALIGN),
+ roundup((u32)*image + *size, ARCH_DMA_MINALIGN));
auth_exit:
if (result != 0) {