diff options
author | danh-arm <dan.handley@arm.com> | 2016-08-18 11:38:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-18 11:38:48 +0100 |
commit | efc759ad82b0acd87ffbf019fd65e54e1abf1db5 (patch) | |
tree | a8756896b69da1f7304685b0a787d45fd0891697 /common | |
parent | 937108a04a998c9e6d6ce5734bf62c7eb8c9d42c (diff) | |
parent | ad4494dc38a39d06a31ef3386829ef1af79db39a (diff) |
Merge pull request #686 from danh-arm/dh/remove-inv-dcache-after-auth
Remove dcache invalidation after image authentication
Diffstat (limited to 'common')
-rw-r--r-- | common/bl_common.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/common/bl_common.c b/common/bl_common.c index be56256b..6dcd4c18 100644 --- a/common/bl_common.c +++ b/common/bl_common.c @@ -321,12 +321,16 @@ int load_image(meminfo_t *mem_layout, (void *) image_base, image_size); } +#if !TRUSTED_BOARD_BOOT /* * File has been successfully loaded. - * Flush the image in Trusted SRAM so that the next exception level can - * see it. + * Flush the image to main memory so that it can be executed later by + * any CPU, regardless of cache and MMU state. + * When TBB is enabled the image is flushed later, after image + * authentication. */ flush_dcache_range(image_base, image_size); +#endif /* TRUSTED_BOARD_BOOT */ INFO("Image id=%u loaded at address %p, size = 0x%zx\n", image_id, (void *) image_base, image_size); @@ -388,10 +392,12 @@ int load_auth_image(meminfo_t *mem_layout, image_data->image_size); return -EAUTH; } - - /* After working with data, invalidate the data cache */ - inv_dcache_range(image_data->image_base, - (size_t)image_data->image_size); + /* + * File has been successfully loaded and authenticated. + * Flush the image to main memory so that it can be executed later by + * any CPU, regardless of cache and MMU state. + */ + flush_dcache_range(image_data->image_base, image_data->image_size); #endif /* TRUSTED_BOARD_BOOT */ return 0; |