Browse Source

efi: Correct cache flush alignment

Make sure that the cache flushes correctly by ensuring that the end
address is correctly aligned.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Simon Glass 7 years ago
parent
commit
d0d9099365
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lib/efi_loader/efi_image_loader.c

+ 2 - 1
lib/efi_loader/efi_image_loader.c

@@ -174,7 +174,8 @@ void *efi_load_pe(void *efi, struct efi_loaded_image *loaded_image_info)
 	efi_loader_relocate(rel, rel_size, efi_reloc);
 
 	/* Flush cache */
-	flush_cache((ulong)efi_reloc, virt_size);
+	flush_cache((ulong)efi_reloc,
+		    ALIGN(virt_size, CONFIG_SYS_CACHELINE_SIZE));
 	invalidate_icache_all();
 
 	/* Populate the loaded image interface bits */