summaryrefslogtreecommitdiff
path: root/bl2/bl2_main.c
diff options
context:
space:
mode:
authorDan Handley <dan.handley@arm.com>2014-04-15 11:38:38 +0100
committerAndrew Thoelke <andrew.thoelke@arm.com>2014-05-22 23:15:36 +0100
commit1151c82101eb3cb2472d3b513f0c828ad098b13c (patch)
treed98c5e19feaecdb4c970ce160caa1a9bed35f9ea /bl2/bl2_main.c
parentdbad1bacba0a7adfd3c7c559f0fd0805087aeddd (diff)
Allow BL3-2 platform definitions to be optional
The generic image loading and IO FIP code no longer forces the platform to create BL3-2 (Secure-EL1 Payload) specific definitions. The BL3-2 loading code in bl2/bl2main.c is wrapped by a #ifdef BL32_BASE blocks, allowing the BL3-2 definitions to be optional. Similarly for the name_uuid array defintion in drivers/io/io_fip.c. Also update the porting guide to reflect this change. The BL3-2 platform definitions remain non-configurably present in the FVP port. Fixes ARM-software/tf-issues#68 Change-Id: Iea28b4e94d87a31f5522f271e290919a8a955460
Diffstat (limited to 'bl2/bl2_main.c')
-rw-r--r--bl2/bl2_main.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/bl2/bl2_main.c b/bl2/bl2_main.c
index 33c63eef..81fecd67 100644
--- a/bl2/bl2_main.c
+++ b/bl2/bl2_main.c
@@ -134,32 +134,34 @@ void bl2_main(void)
bl2_plat_set_bl33_ep_info(bl2_to_bl31_params->bl33_image_info,
bl2_to_bl31_params->bl33_ep_info);
+
+#ifdef BL32_BASE
/*
* Load the BL32 image if there's one. It is upto to platform
* to specify where BL32 should be loaded if it exists. It
* could create space in the secure sram or point to a
- * completely different memory. A zero size indicates that the
- * platform does not want to load a BL32 image.
+ * completely different memory.
+ *
+ * If a platform does not want to attempt to load BL3-2 image
+ * it must leave BL32_BASE undefined
*/
bl2_plat_get_bl32_meminfo(&bl32_mem_info);
- if (bl32_mem_info.total_size) {
- e = load_image(&bl32_mem_info,
- BL32_IMAGE_NAME,
- bl32_mem_info.attr &
- LOAD_MASK,
- BL32_BASE,
- bl2_to_bl31_params->bl32_image_info,
- bl2_to_bl31_params->bl32_ep_info);
-
- /* Halt if failed to load normal world firmware. */
- if (e) {
- WARN("Failed to load BL3-2.\n");
- } else {
- bl2_plat_set_bl32_ep_info(
- bl2_to_bl31_params->bl32_image_info,
- bl2_to_bl31_params->bl32_ep_info);
- }
+ e = load_image(&bl32_mem_info,
+ BL32_IMAGE_NAME,
+ bl32_mem_info.attr & LOAD_MASK,
+ BL32_BASE,
+ bl2_to_bl31_params->bl32_image_info,
+ bl2_to_bl31_params->bl32_ep_info);
+
+ /* Issue a diagnostic if no Secure Payload could be loaded */
+ if (e) {
+ WARN("Failed to load BL3-2.\n");
+ } else {
+ bl2_plat_set_bl32_ep_info(
+ bl2_to_bl31_params->bl32_image_info,
+ bl2_to_bl31_params->bl32_ep_info);
}
+#endif /* BL32_BASE */
/*
* Run BL31 via an SMC to BL1. Information on how to pass control to