From 10c669585456bc9122bb86c1710e80599f5eae89 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Mon, 5 Feb 2018 10:42:42 +0100 Subject: aarch32: optee: define the OP-TEE secure payload AArch32 only platforms can boot the OP-TEE secure firmware as a BL32 secure payload. Such configuration can be defined through AARCH32_SP=optee. The source files can rely on AARCH32_SP_OPTEE to condition OP-TEE boot specific instruction sequences. OP-TEE does not expect ARM Trusted Firmware formatted structure as boot argument. Load sequence is expected to have already loaded to OP-TEE boot arguments into the bl32 entrypoint info structure. Last, AArch32 platform can only boot AArch32 OP-TEE images. Change-Id: Ic28eec5004315fc9111051add6bb1a1d607fc815 Signed-off-by: Etienne Carriere --- bl2/bl2_image_load_v2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bl2') diff --git a/bl2/bl2_image_load_v2.c b/bl2/bl2_image_load_v2.c index 6517703d..198b65e4 100644 --- a/bl2/bl2_image_load_v2.c +++ b/bl2/bl2_image_load_v2.c @@ -87,8 +87,10 @@ entry_point_info_t *bl2_load_images(void) assert(bl2_to_next_bl_params->h.version >= VERSION_2); assert(bl2_to_next_bl_params->head->ep_info); - /* Populate arg0 for the next BL image */ - bl2_to_next_bl_params->head->ep_info->args.arg0 = (u_register_t)bl2_to_next_bl_params; + /* Populate arg0 for the next BL image if not already provided */ + if (bl2_to_next_bl_params->head->ep_info->args.arg0 == 0) + bl2_to_next_bl_params->head->ep_info->args.arg0 = + (u_register_t)bl2_to_next_bl_params; /* Flush the parameters to be passed to next image */ plat_flush_next_bl_params(); -- cgit v1.2.3 From 95ae5b00447da02695a653004b86e6b805e058a9 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Tue, 6 Feb 2018 10:58:21 +0100 Subject: [fix] aarch32: optee: define the OP-TEE secure payload As per MISRA C-2012 Rule 10.4. arg0 is a u_register_t, can be a 32bit or 64bit upon architecture. Signed-off-by: Etienne Carriere --- bl2/bl2_image_load_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bl2') diff --git a/bl2/bl2_image_load_v2.c b/bl2/bl2_image_load_v2.c index 198b65e4..f94378ae 100644 --- a/bl2/bl2_image_load_v2.c +++ b/bl2/bl2_image_load_v2.c @@ -88,7 +88,7 @@ entry_point_info_t *bl2_load_images(void) assert(bl2_to_next_bl_params->head->ep_info); /* Populate arg0 for the next BL image if not already provided */ - if (bl2_to_next_bl_params->head->ep_info->args.arg0 == 0) + if (bl2_to_next_bl_params->head->ep_info->args.arg0 == (u_register_t)0) bl2_to_next_bl_params->head->ep_info->args.arg0 = (u_register_t)bl2_to_next_bl_params; -- cgit v1.2.3