summaryrefslogtreecommitdiff
path: root/bl2/bl2_main.c
diff options
context:
space:
mode:
authorVikram Kanigiri <vikram.kanigiri@arm.com>2014-05-16 18:48:12 +0100
committerVikram Kanigiri <vikram.kanigiri@arm.com>2014-05-22 16:19:32 +0100
commit6871c5d3a227cb95008a25e90e358ec0ac615222 (patch)
treefe40950e7d517aa673ab2cc11b5255c4268ae291 /bl2/bl2_main.c
parent4112bfa0c223eda73af1cfe57ca7dc926f767dd8 (diff)
Rework memory information passing to BL3-x images
The issues addressed in this patch are: 1. Remove meminfo_t from the common interfaces in BL3-x, expecting that platform code will find a suitable mechanism to determine the memory extents in these images and provide it to the BL3-x images. 2. Remove meminfo_t and bl31_plat_params_t from all FVP BL3-x code as the images use link-time information to determine memory extents. meminfo_t is still used by common interface in BL1/BL2 for loading images Change-Id: I4e825ebf6f515b59d84dc2bdddf6edbf15e2d60f
Diffstat (limited to 'bl2/bl2_main.c')
-rw-r--r--bl2/bl2_main.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/bl2/bl2_main.c b/bl2/bl2_main.c
index 1969981d..33c63eef 100644
--- a/bl2/bl2_main.c
+++ b/bl2/bl2_main.c
@@ -67,9 +67,10 @@ void bl2_main(void)
{
meminfo_t *bl2_tzram_layout;
bl31_params_t *bl2_to_bl31_params;
- bl31_plat_params_t *bl2_to_bl31_plat_params;
unsigned int bl2_load, bl31_load;
entry_point_info_t *bl31_ep_info;
+ meminfo_t bl32_mem_info;
+ meminfo_t bl33_mem_info;
int e;
/* Perform remaining generic architectural setup in S-El1 */
@@ -88,7 +89,6 @@ void bl2_main(void)
* information to BL31.
*/
bl2_to_bl31_params = bl2_plat_get_bl31_params();
- bl2_to_bl31_plat_params = bl2_plat_get_bl31_plat_params();
bl31_ep_info = bl2_plat_get_bl31_ep_info();
/*
@@ -116,16 +116,10 @@ void bl2_main(void)
bl2_plat_set_bl31_ep_info(bl2_to_bl31_params->bl31_image_info,
bl31_ep_info);
- /*
- * Create a new layout of memory for BL31 as seen by BL2. This
- * will gobble up all the BL2 memory.
- */
- init_bl31_mem_layout(bl2_tzram_layout,
- &bl2_to_bl31_plat_params->bl31_meminfo,
- bl31_load);
+ bl2_plat_get_bl33_meminfo(&bl33_mem_info);
/* Load the BL33 image in non-secure memory provided by the platform */
- e = load_image(&bl2_to_bl31_plat_params->bl33_meminfo,
+ e = load_image(&bl33_mem_info,
BL33_IMAGE_NAME,
BOT_LOAD,
plat_get_ns_image_entrypoint(),
@@ -147,10 +141,11 @@ void bl2_main(void)
* completely different memory. A zero size indicates that the
* platform does not want to load a BL32 image.
*/
- if (bl2_to_bl31_plat_params->bl32_meminfo.total_size) {
- e = load_image(&bl2_to_bl31_plat_params->bl32_meminfo,
+ bl2_plat_get_bl32_meminfo(&bl32_mem_info);
+ if (bl32_mem_info.total_size) {
+ e = load_image(&bl32_mem_info,
BL32_IMAGE_NAME,
- bl2_to_bl31_plat_params->bl32_meminfo.attr &
+ bl32_mem_info.attr &
LOAD_MASK,
BL32_BASE,
bl2_to_bl31_params->bl32_image_info,
@@ -166,12 +161,10 @@ void bl2_main(void)
}
}
-
/*
* 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,
- (unsigned long)bl2_to_bl31_plat_params);
+ bl2_run_bl31(bl31_ep_info, (unsigned long)bl2_to_bl31_params, 0);
}