aboutsummaryrefslogtreecommitdiff
path: root/bl2
diff options
context:
space:
mode:
authorAndrew Thoelke <andrew.thoelke@arm.com>2014-05-28 22:22:55 +0100
committerAndrew Thoelke <andrew.thoelke@arm.com>2014-05-29 11:33:34 +0100
commit034626719418e0cb7baed8d7c8eea6de2500efe8 (patch)
tree38623d66db993120ebfb4ff66a394542b4560d75 /bl2
parent05b6edfe26e3674c3e8e8ff6332aae66fe73e4fa (diff)
downloadtrusted-firmware-a-034626719418e0cb7baed8d7c8eea6de2500efe8.tar.gz
Allow platform parameter X1 to be passed to BL3-1
bl2_main() was overwriting any platform set X1 parameter for BL3-1 with the value zero. This patch ensure that any platform set value is correctly passed to BL3-1. The FVP port adds a check to verify this parameter is being passed correctly. Fixes ARM-software/tf-issues#173 Change-Id: Ifbcda73d3d41d2b04a4baf5614e9d2d21f1717c8
Diffstat (limited to 'bl2')
-rw-r--r--bl2/bl2_main.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/bl2/bl2_main.c b/bl2/bl2_main.c
index 46c70a1232..691973f269 100644
--- a/bl2/bl2_main.c
+++ b/bl2/bl2_main.c
@@ -38,24 +38,6 @@
#include <stdio.h>
#include "bl2_private.h"
-/*******************************************************************************
- * Runs BL31 from the given entry point. It jumps to a higher exception level
- * through an SMC.
- ******************************************************************************/
-static void __dead2 bl2_run_bl31(entry_point_info_t *bl31_ep_info,
- unsigned long arg1,
- unsigned long arg2)
-{
- /* Set the args pointer */
- bl31_ep_info->args.arg0 = arg1;
- bl31_ep_info->args.arg1 = arg2;
-
- /* Flush the params to be passed to memory */
- bl2_plat_flush_bl31_params();
-
- smc(RUN_IMAGE, (unsigned long)bl31_ep_info, 0, 0, 0, 0, 0, 0);
-}
-
/*******************************************************************************
* The only thing to do in BL2 is to load further images and pass control to
@@ -91,6 +73,9 @@ void bl2_main(void)
bl2_to_bl31_params = bl2_plat_get_bl31_params();
bl31_ep_info = bl2_plat_get_bl31_ep_info();
+ /* Set the X0 parameter to bl31 */
+ bl31_ep_info->args.arg0 = (unsigned long)bl2_to_bl31_params;
+
/*
* Load BL31. BL1 tells BL2 whether it has been TOP or BOTTOM loaded.
* To avoid fragmentation of trusted SRAM memory, BL31 is always
@@ -163,10 +148,13 @@ void bl2_main(void)
}
#endif /* BL32_BASE */
+ /* Flush the params to be passed to memory */
+ bl2_plat_flush_bl31_params();
+
/*
* Run BL31 via an SMC to BL1. Information on how to pass control to
* the BL32 (if present) and BL33 software images will be passed to
* BL31 as an argument.
*/
- bl2_run_bl31(bl31_ep_info, (unsigned long)bl2_to_bl31_params, 0);
+ smc(RUN_IMAGE, (unsigned long)bl31_ep_info, 0, 0, 0, 0, 0, 0);
}