aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Daniel Kachhap <amit.kachhap@arm.com>2018-03-02 18:47:55 +0530
committerDavid Cunado <david.cunado@arm.com>2018-03-05 11:58:22 +0000
commit1cc99de889f43e913b22c2422ff4a10f45adde37 (patch)
treebfa4ad1733b1eeffddd44b4d1dd07e0e5633114d
parenteb4ff4c10e970b86fd4129a474fa9762136b6127 (diff)
downloadtrusted-firmware-a-1cc99de889f43e913b22c2422ff4a10f45adde37.tar.gz
Dynamic cfg: Do not populate args if already initialized
This patch modifies the common utility function `populate_next_bl_params_config()` to only modify the entrypoint arguments to an executable image only if they are not initialized earlier. This issue was detected while testing Optee on ARM platforms which needed the current arguments to be preserved in the absence of corresponding config files. Change-Id: I1e3fb4be8176fc173959e72442396dd33a99a316 Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com> Signed-off-by: David Cunado <david.cunado@arm.com>
-rw-r--r--common/desc_image_load.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/common/desc_image_load.c b/common/desc_image_load.c
index 0ea247c694..28745d41d2 100644
--- a/common/desc_image_load.c
+++ b/common/desc_image_load.c
@@ -239,14 +239,23 @@ void populate_next_bl_params_config(bl_params_t *bl2_to_next_bl_params)
/*
* Pass hw and tb_fw config addresses to next images. NOTE - for
* EL3 runtime images (BL31 for AArch64 and BL32 for AArch32),
- * arg0 is already used by generic code.
+ * arg0 is already used by generic code. Take care of not
+ * overwriting the previous initialisations.
*/
if (params_node == bl2_to_next_bl_params->head) {
- params_node->ep_info->args.arg1 = fw_config_base;
- params_node->ep_info->args.arg2 = hw_config_base;
+ if (params_node->ep_info->args.arg1 == 0)
+ params_node->ep_info->args.arg1 =
+ fw_config_base;
+ if (params_node->ep_info->args.arg2 == 0)
+ params_node->ep_info->args.arg2 =
+ hw_config_base;
} else {
- params_node->ep_info->args.arg0 = fw_config_base;
- params_node->ep_info->args.arg1 = hw_config_base;
+ if (params_node->ep_info->args.arg0 == 0)
+ params_node->ep_info->args.arg0 =
+ fw_config_base;
+ if (params_node->ep_info->args.arg1 == 0)
+ params_node->ep_info->args.arg1 =
+ hw_config_base;
}
}
}